2using System.Collections.Generic;
5using System.Threading.Tasks;
26 private string informationHash =
string.Empty;
27 private bool consented =
false;
28 private DateTime consentedTimestamp = DateTime.MinValue;
43 [DefaultValueStringEmpty]
46 get => this.informationHash;
47 set => this.informationHash = value;
56 get => this.consented;
57 set => this.consented = value;
63 [DefaultValueDateTimeMinValue]
66 get => this.consentedTimestamp;
67 set => this.consentedTimestamp = value;
73 public override string Resource =>
"/Settings/PersonalData.md";
95 return Task.CompletedTask;
113 await base.InitSetup(WebServer);
115 this.consent = WebServer.
Register(
"/Settings/Consent",
null, this.Consent,
true,
false,
true);
117 List<IProcessingActivity> Activities =
new List<IProcessingActivity>();
121 if (T.IsAbstract || T.IsInterface || T.IsGenericTypeDefinition)
134 Activities.Sort((A1, A2) =>
136 int i = A1.Priority - A2.Priority;
140 return A1.GetType().FullName.CompareTo(A2.GetType().FullName);
143 processingActivities = Activities.ToArray();
187 return base.UnregisterSetup(WebServer);
203 if (!(Obj is Dictionary<string, object> Parameters))
206 if (!Parameters.TryGetValue(
"consent", out Obj) || !(Obj is
bool Consent))
209 string TabID = Request.
Header[
"X-TabID"];
210 if (
string.IsNullOrEmpty(TabID))
213 if (this.consented != Consent)
215 this.consented = Consent;
216 this.consentedTimestamp = Consent ? DateTime.Now : DateTime.MinValue;
222 {
"consent", Consent }
223 },
false),
true,
"User");
226 Response.StatusCode = 200;
241 return Task.FromResult(
false);
243 this.consentedTimestamp = DateTime.Now;
244 return Task.FromResult(
true);
Helps with common JSON-related tasks.
static string Encode(string s)
Encodes a string for inclusion in JSON.
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
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.
Provides information about personal data processing.
const string GATEWAY_PII_CONSENT
Environment variable name for personal data consent configuration.
override Task< bool > EnvironmentConfiguration()
Environment configuration by configuring values available in environment variables.
static PersonalDataConfiguration Instance
Current instance of configuration.
override Task UnregisterSetup(HttpServer WebServer)
Unregisters the setup object.
override async Task InitSetup(HttpServer WebServer)
Initializes the setup object.
override int Priority
Priority of the setting. Configurations are sorted in ascending order.
override void SetStaticInstance(ISystemConfiguration Configuration)
Sets the static instance of the configuration.
override Task< string > Title(Language Language)
Gets a title for the system configuration.
override Task ConfigureSystem()
Is called during startup to configure the system.
string InformationHash
Digest of transparent information presented to which consent is asked.
DateTime ConsentedTimestamp
When consent to personal data processing has been received.
static IProcessingActivity[] ProcessingActivities
Available processing activities.
override string ConfigPrivilege
Minimum required privilege for a user to be allowed to change the configuration defined by the class.
bool Consented
If consent to personal data processing has been received.
override string Resource
Resource to be redirected to, to perform the configuration.
Abstract base class for system configurations.
bool TryGetEnvironmentVariable(string VariableName, bool Required, out string Value)
Tries to get a string-valued environment variable.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
HttpRequestHeader Header
Request header.
bool HasData
If the request has data.
async Task< object > DecodeDataAsync()
Decodes data sent in request.
Base class for all HTTP resources.
Represets a response of an HTTP client request.
Implements an HTTP server.
HttpResource Register(HttpResource Resource)
Registers a resource with the server.
bool Unregister(HttpResource Resource)
Unregisters a resource from the server.
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.
Static class that dynamically manages types and interfaces available in the runtime environment.
static object Instantiate(Type Type, params object[] Arguments)
Returns an instance of the type Type . If one needs to be created, it is. If the constructor requires...
static Type[] GetTypesImplementingInterface(string InterfaceFullName)
Gets all types implementing a given interface.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Interface for system configurations. The gateway will scan all module for system configuration classe...
Interface for Personal Data Processing Activities