using StellaOps.Router.Common.Enums; using StellaOps.Microservice.AspNetCore; namespace StellaOps.Router.AspNet; /// /// Base configuration options for Stella Router integration that can be embedded /// in any WebService's options class. Services should include a property of this type /// named "Router" to enable Router integration. /// /// /// /// public class MyServiceOptions /// { /// public StellaRouterOptionsBase? Router { get; set; } /// } /// /// public class StellaRouterOptionsBase { /// /// Enable Stella Router integration. When true, ASP.NET endpoints /// are automatically registered with the Router for discovery and dispatch. /// Default: false. /// public bool Enabled { get; set; } /// /// Deployment region for this service instance. /// Default: "default". /// public string Region { get; set; } = "default"; /// /// Default request timeout in seconds. /// Default: 30 seconds. /// public int DefaultTimeoutSeconds { get; set; } = 30; /// /// Heartbeat interval in seconds for health reporting. /// Default: 45 seconds. /// public int HeartbeatIntervalSeconds { get; set; } = 45; /// /// Maximum interval in seconds between HELLO refreshes on an already-live transport. /// Default: 10 seconds to keep gateway restarts from leaving the frontdoor cold for minutes. /// public int RegistrationRefreshIntervalSeconds { get; set; } = 10; /// /// Service trust mode for gateway-enforced authorization semantics. /// Default: Hybrid. /// public GatewayAuthorizationTrustMode AuthorizationTrustMode { get; set; } = GatewayAuthorizationTrustMode.Hybrid; /// /// Shared signing key used to verify gateway identity envelopes. /// Required when AuthorizationTrustMode is GatewayEnforced. /// public string? IdentityEnvelopeSigningKey { get; set; } /// /// Allowed clock skew in seconds when validating gateway identity envelopes. /// Default: 30 seconds. /// public int IdentityEnvelopeClockSkewSeconds { get; set; } = 30; /// /// Gateway endpoints to connect to for endpoint registration. /// public IList Gateways { get; set; } = new List(); } /// /// Base configuration for a Router gateway connection. /// public class StellaRouterGatewayOptionsBase { /// /// Gateway host. /// Default: "localhost". /// public string Host { get; set; } = "localhost"; /// /// Gateway port. /// Default: 9100. /// public int Port { get; set; } = 9100; /// /// Transport type (InMemory, Tcp, Tls, Messaging). /// Default: InMemory. /// public TransportType TransportType { get; set; } = TransportType.InMemory; /// /// Enable TLS for TCP transport. /// Default: false. /// public bool UseTls { get; set; } /// /// TLS certificate path (if UseTls is true). /// public string? CertificatePath { get; set; } }