1using System.Collections.Generic;
2using System.Threading.Tasks;
19 : base(
"Account/DomainInfo")
43 await base.GET(Request, Response);
47 string Name = this.SelectString(Request,
52 string Description = this.SelectString(Request,
61 {
"humanReadableName", Name?? string.Empty },
62 {
"humanReadableDescription", Description ?? string.Empty }
66 private string SelectString(
HttpRequest Request,
string Default,
string DefaultLanguage,
72 string[] Languages = GetLanguages(DefaultLanguage, Localizations);
75 if (
string.IsNullOrEmpty(Language) || DefaultLanguage == Language)
78 if (!(Localizations is
null))
82 if (Localization.
Key == Language)
83 return Localization.
Value;
90 private static string[] GetLanguages(
string DefaultLanguage,
AlternativeField[] Localizations)
92 List<string> Languages =
new List<string>();
94 if (!
string.IsNullOrEmpty(DefaultLanguage))
95 Languages.Add(DefaultLanguage);
97 if (!(Localizations is
null))
101 if (!
string.IsNullOrEmpty(Localization.
Key))
102 Languages.Add(Localization.
Key);
106 return Languages.ToArray();
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Represents an alternative field in a legal identity.
string Value
Alternative field Value.
string Key
Alternative field name.
AlternativeField[] LocalizedDescriptions
Localized descriptions of domain
static DomainConfiguration Instance
Current instance of configuration.
string HumanReadableDescription
Human-readable description of domain
string HumanReadableDescriptionLanguage
Language of HumanReadableDescription.
string HumanReadableName
Human-readable name of domain
AlternativeField[] LocalizedNames
Localized names of domain
bool UseEncryption
If the server uses server-side encryption.
string Domain
Principal domain name
string HumanReadableNameLanguage
Language of HumanReadableName.
Base class for all HTTP authentication schemes, as defined in RFC-7235: https://datatracker....
Represents an HTTP request.
HttpRequestHeader Header
Request header.
static void SetTransparentCorsHeaders(HttpResource Resource, HttpRequest Request, HttpResponse Response)
Sets CORS headers for a resource, allowing it to be embedded in other sites.
Represets a response of an HTTP client request.
async Task Return(object Object)
Returns an object to the client. This method can only be called once per response,...
Gets information about the domain.
DomainInfo()
Gets information about the domain.
override HttpAuthenticationScheme[] GetAuthenticationSchemes(HttpRequest Request)
Any authentication schemes used to authenticate users before access is granted to the corresponding r...
override async Task GET(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
Abstract base class for agent resources supporting the GET method.
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd