1using System.Collections.Generic;
2using System.Threading.Tasks;
13 : base(
"/CreateAccount")
17 public override bool HandlesSubPaths =>
false;
18 public override bool UserSessions =>
true;
29 if (!(Obj is Dictionary<string, string> Form))
40 if (!Form.ContainsKey(
"Password") ||
string.IsNullOrEmpty(Password = Form[
"Password"]))
47 PhoneNr =
string.
Empty;
50 KeyValuePair<IAccount, string[]> P = await PersistenceLayer.
CreateAccount(
string.Empty, UserName, Password, EMail, PhoneNr, Request.
RemoteEndPoint);
56 internal static KeyValuePair<string, string>[] GetAlterntivesHeaders(
string[] Alternatives)
58 int i, c = Alternatives?.Length ?? 0;
59 KeyValuePair<string, string>[] Suggestions =
new KeyValuePair<string, string>[c];
61 for (i = 0; i < c; i++)
62 Suggestions[i] =
new KeyValuePair<string, string>(
"X-AlternativeName" + (i + 1).ToString(), Alternatives[i]);
Static class managing the runtime environment of the IoT Gateway.
static IUser AssertUserAuthenticated(HttpRequest Request, string Privilege)
Makes sure a request is being made from a session with a successful user login.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
The request could not be completed due to a conflict with the current state of the resource....
Represents an HTTP request.
string RemoteEndPoint
Remote end-point.
bool HasData
If the request has data.
async Task< object > DecodeDataAsync()
Decodes data sent in request.
Represets a response of an HTTP client request.
Base class for all synchronous HTTP resources. A synchronous resource responds within the method hand...
The response to the request can be found under a different URI and SHOULD be retrieved using a GET me...
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
async Task< KeyValuePair< Networking.XMPP.Server.IAccount, string[]> > CreateAccount(string ApiKey, CaseInsensitiveString UserName, string Password, CaseInsensitiveString EMail, CaseInsensitiveString PhoneNr, string RemoteEndpoint)
Creates an account.
async Task POST(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
bool AllowsPOST
If the POST method is allowed.
POST Interface for HTTP resources.
CaseInsensitiveString UserName
User Name
Interface for XMPP user accounts.