using Esiur.Core; using Esiur.Data; using Esiur.Net.Packets; using Esiur.Resource; using Esiur.Security.Authority; using Esiur.Security.Authority.Providers; using Esiur.Security.Cryptography; using Esiur.Security.Membership; using Esiur.Security.Permissions; using System; using System.Collections.Generic; using System.Text; namespace Esiur.Protocol; public class EpConnectionContext : IResourceContext { public ExceptionLevel ExceptionLevel { get; set; } = ExceptionLevel.Code | ExceptionLevel.Message | ExceptionLevel.Source | ExceptionLevel.Trace; //public Func> Authenticator { get; set; } //public Func> Authenticator { get; set; } public AuthenticationMode AuthenticationMode { get; set; } = AuthenticationMode.None; public string Identity { get; set; } /// /// Expected responder identity for responder-authenticated and dual-identity /// protocols. Leaving this unset accepts any responder identity trusted by the /// selected authentication provider for the requested domain. /// public string ResponderIdentity { get; set; } public string AuthenticationProtocol { get; set; } = PasswordAuthenticationProvider.ProtocolName; /// /// Controls whether the authenticated session key must protect EP traffic. /// public EncryptionMode EncryptionMode { get; set; } = EncryptionMode.None; /// /// Encryption provider protocol names offered to the responder, in preference order. /// public string[] EncryptionProviders { get; set; } = new[] { "aes-gcm" }; public bool AutoReconnect { get; set; } = false; /// Delay between reconnect attempts, in seconds. public uint ReconnectInterval { get; set; } = 5; /// /// Maximum time allowed for authentication, encryption setup, and any required /// protected key rotation. A non-positive value disables the deadline. /// public TimeSpan AuthenticationTimeout { get; set; } = TimeSpan.FromSeconds(30); //public string Username { get; set; } /// /// Uses WebSocket transport when set. The absolute ws or wss /// URI can include the endpoint path and query string. /// public Uri WebSocketUri { get; set; } // public string Password { get; set; } //public string Token { get; set; } //public ulong TokenIndex { get; set; } public string Domain { get; set; } public Map Attributes { get; set; } public Map Properties { get; set; } public ulong Age { get; } }