namespace ItWorx.KnowledgeHub.Application.Automation; public sealed record IssuedToken(string PublicId, string SecretHash, string RawToken); /// /// Generates and verifies ikh_<public-id>_<secret> bearer tokens /// (docs/09-api-contract.md "Service account"). The raw secret is never persisted — /// only its hash. /// public interface IServiceAccountTokenIssuer { IssuedToken IssueNewToken(); /// Parses a presented Authorization: Bearer value into its public /// ID and secret, or returns false if it is not well-formed — never throws on /// attacker-controlled input. bool TryParse(string presentedToken, out string publicId, out string secret); string HashSecret(string secret); }