Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LoginAuditorExceptionNode.cs
1using System;
3using System.Threading.Tasks;
5using Waher.Things;
8
10{
15 {
16 private readonly string id = Guid.NewGuid().ToString();
17
22 : base()
23 {
24 }
25
31 : base(Source, null)
32 {
33 }
34
38 public override string NodeId => this.id;
39
43 public override string LocalId
44 {
45 get
46 {
47 if (!string.IsNullOrEmpty(this.EndPoint))
48 return this.EndPoint;
49
50 IEnumerable<ConfigurationNode> Siblings = this.Siblings;
51 if (Siblings is null)
52 return this.id;
53
54 int i = 0;
55
56 foreach (ConfigurationNode Sibling in Siblings)
57 {
58 if (Sibling is LoginAuditorExceptionNode)
59 {
60 i++;
61 if (Sibling == this)
62 return "Exception " + i.ToString();
63 }
64 }
65
66 return this.id;
67 }
68 }
69
73 [Page(7, "Configuration")]
74 [Header(134, "End Point:")]
75 [ToolTip(135, "Make an exception for this endpoint or endpoints. Can be an IP Address, an IP Range (using IP CIDR format) or a domain name (if endpoint uses mTLS).")]
76 [Required]
77 public string EndPoint { get; set; }
78
83 public override Task<string> GetTypeNameAsync(Language Language) => Language.GetStringAsync(typeof(GatewayConfigSource), 133, "Exception");
84
90 public override Task<bool> AcceptsParentAsync(INode Parent)
91 {
92 return Task.FromResult(Parent is LoginAuditorNode);
93 }
94
100 public override Task<bool> AcceptsChildAsync(INode Child)
101 {
102 return Task.FromResult(Child is IntervalNode);
103 }
104
110 public override Task<bool> CanDestroyAsync(RequestOrigin Caller)
111 {
112 return Task.FromResult(false);
113 }
114
118 public override bool ChildrenOrdered => true;
119
126 public override async Task<IEnumerable<Parameter>> GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
127 {
128 LinkedList<Parameter> Parameters = new LinkedList<Parameter>();
130
131 Parameters.AddLast(new StringParameter("EndPoint", await Namespace.GetStringAsync(136, "End Point"), this.EndPoint));
132
133 return Parameters;
134 }
135
136 }
137}
Contains information about a language.
Definition: Language.cs:17
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 ...
Definition: Language.cs:209
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Definition: Language.cs:99
Contains information about a namespace in a language.
Definition: Namespace.cs:17
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Definition: Namespace.cs:65
Abstract base class for gateway configuration nodes.
virtual INode Parent
Parent Node, or null if a root node.
GatewayConfigSource Source
Source hosting the node.
Represents an interval in a LoginAuditor configuration.
Definition: IntervalNode.cs:16
override Task< bool > CanDestroyAsync(RequestOrigin Caller)
If the node can be destroyed to by the caller.
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
LoginAuditorExceptionNode()
Contains information about a Login Auditor Exception.
override bool ChildrenOrdered
If the children of the node have an intrinsic order (true), or if the order is not important (false).
override string LocalId
If provided, an ID for the node, but unique locally between siblings. Can be null,...
LoginAuditorExceptionNode(GatewayConfigSource Source)
Contains information about a Login Auditor Exception.
Contains configuration of the Login Auditor.
Tokens available in request.
Definition: RequestOrigin.cs:9
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49