Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HttpProtectedResource.cs
1using System;
3using System.Reflection;
4using System.Threading.Tasks;
5using Waher.Events;
7
9{
17 public abstract class HttpProtectedResource : HttpResource
18 {
28 : base(ResourceName)
29 {
30 }
31
36 public override void AddReference(HttpServer Server)
37 {
38 base.AddReference(Server);
39
40 Task.Run(async () =>
41 {
42 try
43 {
44 IEnumerable<OAuthMetaDataAttribute> OAuthMetaDAtaAttributes = this.GetType().GetCustomAttributes<OAuthMetaDataAttribute>(true);
45
46 foreach (OAuthMetaDataAttribute Attribute in OAuthMetaDAtaAttributes)
47 await Attribute.RegisterMetaData(this);
48 }
49 catch (Exception ex)
50 {
51 Log.Exception(ex);
52 }
53 });
54 }
55 }
56}
Static class managing the application event log. Applications and services log events on this static ...
Definition: Log.cs:14
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.
Definition: Log.cs:1657
Base class for all HTTP resources.
Definition: HttpResource.cs:23
string ResourceName
Name of resource.
Implements an HTTP server.
Definition: HttpServer.cs:41
Base class for all asynchronous HTTP resources. An asynchronous resource responds outside of the meth...
override void AddReference(HttpServer Server)
Method called when a resource has been registered on a server.
HttpProtectedResource(string ResourceName)
Base class for all asynchronous HTTP resources. An asynchronous resource responds outside of the meth...
Abstract base class for OAUTH meta-data attributes.
virtual Task RegisterMetaData(HttpResource Resource)
Registers any meta-data used that requires registration.