2using System.Runtime.Serialization;
3using System.Threading.Tasks;
22 : base(
"/KillMachine")
26 public override bool HandlesSubPaths =>
false;
27 public override bool UserSessions =>
true;
41 if (Content.
HasError || !(Content.
Decoded is Dictionary<string, object> Obj) ||
42 !Obj.TryGetValue(
"tokenId", out
object Obj2) || !(Obj2 is
string TokenId) ||
43 !Obj.TryGetValue(
"tabId", out Obj2) || !(Obj2 is
string TabId))
58 Response.StatusCode = 200;
59 Response.StatusMessage =
"OK";
61 string LegalId =
null;
64 if (User is Security.Users.User AdminUser)
66 if (
string.IsNullOrEmpty(AdminUser.LegalId))
69 LegalId = AdminUser.LegalId;
82 else if (User.GetType().FullName == typeof(
Login).FullName +
"+InternalUser")
89 if (
string.IsNullOrEmpty(LegalId))
98 e.Response ?
"RequestAccepted" :
"RequestRejected",
null);
103 await Response.
Return(
new Dictionary<string, object>()
105 {
"result", Result.Value }
Contains information about a response to a content request.
bool HasError
If an error occurred.
object Decoded
Decoded object.
The ClientEvents class allows applications to push information asynchronously to web clients connecte...
static Task< int > PushEvent(string[] TabIDs, string Type, object Data)
Puses an event to a set of Tabs, given their Tab IDs.
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.
Configures legal identity for the gateway.
static LegalIdentity LatestApprovedLegalIdentity
Latest approved Legal Identity.
Provides a resource that allows the caller to login to the gateway through a POST method call.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
string RemoteEndPoint
Remote end-point.
bool HasData
If the request has data.
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...
Task Return(Exception ex)
Returns an error to the client.
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...
Represents a case-insensitive string.
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
This filter selects objects that have a named field equal to a given value.
IdentityState? LatestIdentityState
State of Last Legal Identity approved for account.
CaseInsensitiveString LatestIdentity
Last Legal Identity approved for account. Note: Identity object might not be approved any longer.
Account Account
Account object.
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.
Basic interface for a user.