2using System.Collections.Generic;
4using System.Threading.Tasks;
16 : base(
"/InstallPackage")
20 public override bool HandlesSubPaths =>
false;
21 public override bool UserSessions =>
true;
29 !Obj.TryGetValue(
"package", out
object Value) || !(Value is
string FileName) ||
30 !Obj.TryGetValue(
"key", out Value) || !(Value is
string KeyStr))
35 if (KeyStr.Length != 76 && KeyStr.Length != 76 + 32)
38 byte[] PublicKey = Convert.FromBase64String(KeyStr.Substring(0, 76));
41 string FullFileName = Path.Combine(
XmppServerModule.PackagesFolder, FileName);
42 if (!File.Exists(FullFileName))
45 Package Package = await Provisioning.ProvisioningComponent.GetPackage(FileName);
52 using (FileStream fs = File.OpenRead(FullFileName))
59 Package.PublicKey = PublicKey;
60 Package.AesKey = AesKey;
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...
Represents an HTTP request.
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 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 Update(object Object)
Updates an object in the database.
Contains methods for simple hash calculations.
static byte[] StringToBinary(string s)
Parses a hex string.
Identity of the IoT Broker package.
const string FileName
IoTBroker.package
Contains information about a software package.
byte[] Signature
Cryptographic signature of package, as calculated by the issuer of the package.
CaseInsensitiveString FileName
Filename of package.
DateTime Published
When package was published.
bool AllowsPOST
If the POST method is allowed.
async Task POST(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
Service Module hosting the XMPP broker and its components.
POST Interface for HTTP resources.