3using System.Threading.Tasks;
59 return authenticationSchemes;
77 if (
string.IsNullOrEmpty(Request.
SubPath))
83 string TokenId = Request.
SubPath[1..];
84 int i = TokenId.IndexOf(
'@');
85 if (i < 0 || !Guid.TryParse(TokenId[..i], out
_))
111 if (Content.
Decoded is
string TextNote)
126 Timestamp = DateTime.UtcNow,
127 TokenId = Token.TokenId
133 else if (Content.
Decoded is XmlDocument XmlNote)
141 if (XmlNote.DocumentElement is
null)
147 if (
string.IsNullOrEmpty(XmlNote.DocumentElement.NamespaceURI))
153 AssertXmlSafe(XmlNote);
155 (string, Dictionary<string, ValidationSchema>) P = await
XmppServerModule.Legal.ValidateContent(XmlNote,
null);
156 if (!
string.IsNullOrEmpty(P.Item1))
167 Note = XmlNote.DocumentElement.OuterXml,
168 LocalName = XmlNote.DocumentElement.LocalName,
169 Namespace = XmlNote.DocumentElement.NamespaceURI,
171 Timestamp = DateTime.UtcNow,
172 TokenId = Token.TokenId
185 private static void AssertXmlSafe(XmlNode Xml)
187 if (Xml is XmlProcessingInstruction)
190 if (Xml.HasChildNodes)
192 foreach (XmlNode N
in Xml.ChildNodes)
Contains information about a response to a content request.
bool HasError
If an error occurred.
object Decoded
Decoded object.
Exception Error
Error response.
mTLS authentication mechanism, where identity is taken from a valid client certificate.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
The server understood the request, but is refusing to fulfill it. Authorization will not help and the...
Base class for all HTTP authentication schemes, as defined in RFC-7235: https://datatracker....
Represents an HTTP request.
bool HasData
If the request has data.
string SubPath
Sub-path. If a resource is found handling the request, this property contains the trailing sub-path o...
IUser User
Authenticated user, if available, or null if not available.
async Task< ContentResponse > DecodeDataAsync()
Decodes data sent in request.
Represets a response of an HTTP client request.
async Task SendResponse()
Sends the response back to the client. If the resource is synchronous, there's no need to call this m...
Base class for all synchronous HTTP resources. A synchronous resource responds within the method hand...
The server has not found anything matching the Request-URI. No indication is given of whether the con...
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Corresponds to a user in the system.
bool HasPrivilege(string Privilege)
If the user has a given privilege.
Maintains the collection of all users in the system.
static IUserSource Source
User source.
A text note logged on the token from an external source.
An xml note logged on the token from an external source.
Marketplace processor, brokering sales of items via tenders and offers defined in smart contracts.
Duration? ArchiveOptional
Duration after which token expires, and the required archiving time, the token can optionally be arch...
Duration? ArchiveRequired
Duration after which token expires, the token is required to be archived.
DateTime Expires
Expiry date of token.
Adds an external note to a token.
bool AllowsPOST
If the POST method is allowed.
async Task POST(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
override bool UserSessions
If the resource uses user sessions.
AddNote()
Adds an external note to a token.
override bool HandlesSubPaths
If the resource handles sub-paths.
override HttpAuthenticationScheme[] GetAuthenticationSchemes(HttpRequest Request)
Any authentication schemes used to authenticate users before access is granted to the corresponding r...
Service Module hosting the XMPP broker and its components.
POST Interface for HTTP resources.
Basic interface for a user.