Documentation
¶
Overview ¶
Package postgres composes durable identity-facing passkey mappings. It does not own WebAuthn ceremonies, cryptographic credentials, counters or sessions.
Index ¶
- func PasskeyAuthorityKey(namespace string, tenant identity.TenantID, user identity.UserID) (string, error)
- type CredentialMetadata
- type DeletionConfig
- type DeletionService
- type DiscoverableSigninCompletion
- type DiscoverableSigninRequest
- type EnrollmentConfig
- type EnrollmentService
- func (EnrollmentService) Format(s fmt.State, _ rune)
- func (s *EnrollmentService) KeyedRegistrationOptions(ctx context.Context, r KeyedRegistrationOptionsRequest) (out KeyedRegistrationOptionsResult, err error)
- func (s *EnrollmentService) RecoverEnrollment(ctx context.Context, q identity.RecoveryQuery, ...) (out identity.CommandResult, err error)
- func (s *EnrollmentService) Register(ctx context.Context, r RegistrationCompletion) (webauthn.VerifiedRegistration, error)
- func (s *EnrollmentService) RegistrationOptions(ctx context.Context, r RegistrationRequest) (webauthn.RegistrationOptions, error)
- func (s *EnrollmentService) RegistrationRateSource(ctx context.Context, r passkey.RegistrationCeremonyRateRequest) (passkey.CeremonyRateSource, error)
- type InventoryConfig
- type InventoryPage
- type InventoryRequest
- type InventoryService
- type KeyedAssertionOptionsResult
- type KeyedDiscoverableOptionsRequest
- type KeyedRegistrationOptionsRequest
- type KeyedRegistrationOptionsResult
- type KeyedSigninOptionsRequest
- type MFAPasskeyPrimary
- type ManagementConfig
- type ManagementService
- type MetadataVersionMigrationSource
- type MigrationSource
- type OptionsRequestConfig
- type RegistrationCompletion
- type RegistrationRequest
- type SessionAuthority
- func (SessionAuthority) Format(s fmt.State, _ rune)
- func (a *SessionAuthority) ObserveMFAPasskeySession(ctx context.Context, namespace string, record session.Session) (sessionpg.MFAPasskeySessionAuthorityObservation, error)
- func (a *SessionAuthority) ObservePasskeySession(ctx context.Context, namespace string, record session.Session) (sessionpg.PasskeySessionAuthorityObservation, error)
- func (a *SessionAuthority) RequireMFAPasskeySession(ctx context.Context, w kernel.Work, owner kernel.FeatureExecutionContributor, ...) error
- func (a *SessionAuthority) RequirePasskeySession(ctx context.Context, w kernel.Work, owner kernel.FeatureExecutionContributor, ...) error
- func (a *SessionAuthority) RequirePasskeySignupSession(ctx context.Context, w kernel.Work, ...) error
- type SessionAuthorityConfig
- type SessionDeletionConfig
- type SessionDeletionService
- func (s *SessionDeletionService) Delete(ctx context.Context, custody passkey.SessionDeleteCompletion) (passkey.SessionDeleteResult, error)
- func (s *SessionDeletionService) DeleteOptions(ctx context.Context, r passkey.SessionDeleteOptionsRequest) (out passkey.KeyedAssertionOptionsResult, err error)
- func (SessionDeletionService) Format(f fmt.State, _ rune)
- func (SessionDeletionService) MarshalJSON() ([]byte, error)
- func (SessionDeletionService) MarshalText() ([]byte, error)
- func (s *SessionDeletionService) RecoverDelete(ctx context.Context, custody passkey.SessionDeleteRequest, ...) (passkey.SessionDeleteResult, error)
- type SessionEnrollmentConfig
- type SessionEnrollmentService
- func (s *SessionEnrollmentService) EnrollmentAssertionOptions(ctx context.Context, r passkey.SessionEnrollmentOptionsRequest) (out passkey.KeyedAssertionOptionsResult, err error)
- func (SessionEnrollmentService) Format(f fmt.State, _ rune)
- func (SessionEnrollmentService) MarshalJSON() ([]byte, error)
- func (SessionEnrollmentService) MarshalText() ([]byte, error)
- func (s *SessionEnrollmentService) Register(ctx context.Context, custody passkey.SessionEnrollmentCompletion) (out passkey.SessionEnrollmentResult, err error)
- func (s *SessionEnrollmentService) RegistrationOptions(ctx context.Context, custody passkey.SessionEnrollmentAuthorization) (out passkey.KeyedRegistrationOptionsResult, err error)
- func (s *SessionEnrollmentService) RegistrationOptionsForDelivery(ctx context.Context, custody passkey.SessionEnrollmentAuthorization) (out passkey.KeyedRegistrationOptionsResult, authorizationExpiry time.Time, ...)
- func (s *SessionEnrollmentService) SessionRegistrationRateSource(ctx context.Context, custody passkey.SessionEnrollmentRequest, ...) (passkey.CeremonyRateSource, error)
- type SessionManagementConfig
- type SessionManagementService
- func (SessionManagementService) Format(s fmt.State, _ rune)
- func (SessionManagementService) MarshalJSON() ([]byte, error)
- func (SessionManagementService) MarshalText() ([]byte, error)
- func (s *SessionManagementService) Update(ctx context.Context, r passkey.SessionUpdateCompletion) (out passkey.UpdateResult, err error)
- func (s *SessionManagementService) UpdateOptions(ctx context.Context, r passkey.SessionUpdateOptionsRequest) (out passkey.KeyedAssertionOptionsResult, err error)
- type SigninCompletion
- type SigninConfig
- type SigninMFAConfig
- type SigninMigrationSource
- type SigninRequest
- type SigninResult
- type SigninService
- func (s *SigninService) AuthenticationOptions(ctx context.Context, r SigninRequest) (webauthn.AssertionOptions, error)
- func (s *SigninService) ConditionalAuthenticationOptions(ctx context.Context, r DiscoverableSigninRequest) (passkey.ConditionalAssertionOptions, error)
- func (s *SigninService) DiscoverableAuthenticationOptions(ctx context.Context, r DiscoverableSigninRequest) (webauthn.AssertionOptions, error)
- func (s *SigninService) DiscoverableSignin(ctx context.Context, r DiscoverableSigninCompletion) (SigninResult, error)
- func (s *SigninService) DiscoverableSigninRateSource(ctx context.Context, r passkey.DiscoverableCeremonyRateRequest) (passkey.CeremonyRateSource, error)
- func (SigninService) Format(s fmt.State, _ rune)
- func (s *SigninService) IssueFlow(ctx context.Context, p session.PreparedPreAuthIssuance) (session.PreAuthIssueResult, error)
- func (s *SigninService) KeyedAuthenticationOptions(ctx context.Context, r KeyedSigninOptionsRequest) (KeyedAssertionOptionsResult, error)
- func (s *SigninService) KeyedConditionalAuthenticationOptions(ctx context.Context, r KeyedDiscoverableOptionsRequest) (passkey.KeyedConditionalOptionsResult, error)
- func (s *SigninService) KeyedDiscoverableAuthenticationOptions(ctx context.Context, r KeyedDiscoverableOptionsRequest) (KeyedAssertionOptionsResult, error)
- func (s *SigninService) PrepareFlow(i session.PreAuthPrepareInput) (session.PreparedPreAuthIssuance, error)
- func (s *SigninService) ReadMFAPasskeyPrimary(ctx context.Context, proof capability.Proof, ...) (out MFAPasskeyPrimary, err error)
- func (s *SigninService) RecoverSignin(ctx context.Context, q identity.RecoveryQuery, ...) (identity.CommandResult, error)
- func (s *SigninService) Signin(ctx context.Context, r SigninCompletion) (SigninResult, error)
- func (s *SigninService) SigninRateSource(ctx context.Context, r passkey.SigninCeremonyRateRequest) (passkey.CeremonyRateSource, error)
- type SignupConfig
- type SignupMigrationSource
- type SignupService
- func (SignupService) Format(s fmt.State, _ rune)
- func (s *SignupService) IssueFlow(ctx context.Context, p session.PreparedPreAuthIssuance) (session.PreAuthIssueResult, error)
- func (s *SignupService) KeyedRegistrationOptions(ctx context.Context, r passkey.KeyedSignupOptionsRequest) (out KeyedRegistrationOptionsResult, err error)
- func (s *SignupService) PrepareFlow(i session.PreAuthPrepareInput) (session.PreparedPreAuthIssuance, error)
- func (s *SignupService) RecoverRegistrationOptions(ctx context.Context, r passkey.SignupRequest, ...) (identity.CommandResult, error)
- func (s *SignupService) RecoverSignup(ctx context.Context, r passkey.SignupRequest, ceremonyID string, ...) (identity.CommandResult, error)
- func (s *SignupService) RegistrationOptions(ctx context.Context, r passkey.SignupRequest) (webauthn.RegistrationOptions, error)
- func (s *SignupService) Signup(ctx context.Context, r passkey.SignupCompletion) (passkey.SignupResult, error)
- func (s *SignupService) SignupRateSource(ctx context.Context, r passkey.SignupCeremonyRateRequest) (passkey.CeremonyRateSource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PasskeyAuthorityKey ¶
func PasskeyAuthorityKey(namespace string, tenant identity.TenantID, user identity.UserID) (string, error)
PasskeyAuthorityKey derives the version-one RP/tenant/user mapping scope from exact canonical IDs. It is not authentication or current validity. The owned format is passkey:v1: plus unpadded base64url SHA-256 over the domain below and three big-endian uint16 length-prefixed IDs. Tenant never disambiguates RP-wide credential/handle uniqueness; it remains mandatory authorization scope here.
Types ¶
type CredentialMetadata ¶
type CredentialMetadata = passkey.CredentialMetadata
CredentialMetadata is the adapter-neutral passkey data contract.
type DeletionConfig ¶
type DeletionConfig struct {
ManagementConfig
Recovery *passwordpg.PasskeyRemovalRecoverySource
}
DeletionConfig selects one trusted tenant/RP, genuine delete-specific signed password proof and actual configured emailed-password-reset recovery source. ManagementConfig supplies the shared password reader, original-key, risk and coordinator configuration, but Source must select identity.passkey.delete. Install the password owner's append-only deletion proof suffix after the complete installed proof history. Dependencies and the primary pool are borrowed; keep them immutable and alive for concurrent calls.
func (DeletionConfig) MarshalJSON ¶
func (DeletionConfig) MarshalJSON() ([]byte, error)
func (DeletionConfig) MarshalText ¶
func (DeletionConfig) MarshalText() ([]byte, error)
type DeletionService ¶
type DeletionService struct {
// contains filtered or unexported fields
}
DeletionService removes authority for an existing self-user passkey. The original signed proof, recovery check, protocol/key erasure, disabled kernel reference, mapping/passkey versions and canonical audit/lifecycle effects share the existing coordinator Work. It owns no transaction, journal, retry, goroutine or pool. Removed identifiers remain reserved; no authenticator-local erasure is claimed. Password-session authority is not revoked by removal.
func NewDeletionService ¶
func NewDeletionService(pool *database.Pool, c DeletionConfig) (*DeletionService, error)
NewDeletionService validates and freezes actual native owners without IO. A boolean recovery assertion, completion-only reset owner, foreign primary, different password realm or wrong proof action cannot enable this service.
func (*DeletionService) Delete ¶
func (s *DeletionService) Delete(ctx context.Context, r passkey.DeleteRequest) (out passkey.DeleteResult, err error)
Delete admits exact original-key self-removal. Incoming command/record/target overrides deny. ExpectedVersion is the observed safe metadata version; kernel reference and protocol versions are separately fenced. Fresh commitment and historical retry return metadata only. A matching retry authenticates the original current password session but never consumes proof, checks recovery anew or reruns removal. Unknown is not rollback: retain the same key/input.
func (DeletionService) MarshalJSON ¶
func (DeletionService) MarshalJSON() ([]byte, error)
func (DeletionService) MarshalText ¶
func (DeletionService) MarshalText() ([]byte, error)
type DiscoverableSigninCompletion ¶
type DiscoverableSigninCompletion = passkey.DiscoverableSigninCompletion
DiscoverableSigninCompletion is the adapter-neutral passkey data contract.
type DiscoverableSigninRequest ¶
type DiscoverableSigninRequest = passkey.DiscoverableSigninRequest
DiscoverableSigninRequest is the adapter-neutral passkey data contract.
type EnrollmentConfig ¶
type EnrollmentConfig struct {
// OptionsRequests explicitly enables the additive keyed options API only.
OptionsRequests OptionsRequestConfig
Protocol webauthn.Config
RPNamespace string
Coordinator kernel.CoordinatorConfig
Authorization authorization.Service
OptionsSource, RegistrationSource *passwordpg.ActionPrimarySource
Risk *riskpg.Repository
PolicyID string
PolicyVersion uint64
}
EnrollmentConfig selects existing-account, known-empty-MFA, resident-required UV/none enrollment with selected ES256/Ed25519 algorithms. Each phase has its exact signed fresh-action source; no boolean freshness or application domain store can replace it. Dependencies are borrowed and must outlive calls. The native risk owner charges protected attempts through this command, not a separate workflow. Apply the actual kernel/password/MFA/risk/WebAuthn/audit/outbox and passkey histories first.
type EnrollmentService ¶
type EnrollmentService struct {
// contains filtered or unexported fields
}
EnrollmentService owns real protocol/fresh-proof/mapping composition through the existing coordinator. It starts no goroutines, owns no pool lifetime and supports concurrent calls through invocation-private participants. It does not expose passkey-first registration, MFA fallback or credential management.
func NewEnrollmentService ¶
func NewEnrollmentService(pool *database.Pool, c EnrollmentConfig) (*EnrollmentService, error)
NewEnrollmentService validates trusted owned dependencies without IO. It fixes the RP/profile before browser input; disabled/unsupported variants have no path through this service. No callback supplies missing orchestration.
func (EnrollmentService) Format ¶
func (EnrollmentService) Format(s fmt.State, _ rune)
Format prevents borrowed infrastructure/configuration disclosure.
func (*EnrollmentService) KeyedRegistrationOptions ¶
func (s *EnrollmentService) KeyedRegistrationOptions(ctx context.Context, r KeyedRegistrationOptionsRequest) (out KeyedRegistrationOptionsResult, err error)
KeyedRegistrationOptions admits the original request through the existing kernel request-key owner before native preparation. Matching retries recover only original command metadata, even after proof consumption. Exact possession digests and structural input are checked before historical metadata disclosure.
func (*EnrollmentService) RecoverEnrollment ¶
func (s *EnrollmentService) RecoverEnrollment(ctx context.Context, q identity.RecoveryQuery, caller authorization.DecisionContext) (out identity.CommandResult, err error)
RecoverEnrollment discloses or reconciles only the exact original options or completion command under the current coordinator QueryPolicy. The caller must supply trusted authenticated attribution; a historical proof or ceremony is not disclosure authority. Results are historical command metadata, never a challenge, verified credential, session or permission to replay effects. Calls borrow the configured pool and honor its bounded operation deadline.
func (*EnrollmentService) Register ¶
func (s *EnrollmentService) Register(ctx context.Context, r RegistrationCompletion) (webauthn.VerifiedRegistration, error)
Register verifies the browser response with the real protocol owner, then atomically consumes ceremony/proof and persists mapping/kernel reference plus required lifecycle/audit effects. It returns no credential on ambiguous or historical outcomes and never issues a session for authenticated enrollment.
func (*EnrollmentService) RegistrationOptions ¶
func (s *EnrollmentService) RegistrationOptions(ctx context.Context, r RegistrationRequest) (webauthn.RegistrationOptions, error)
RegistrationOptions authenticates a genuine existing session and exact fresh enrollment proof before emitting a committed resident-required UV ceremony. The browser challenge is reveal-once; replay/unknown never generates another.
func (*EnrollmentService) RegistrationRateSource ¶
func (s *EnrollmentService) RegistrationRateSource(ctx context.Context, r passkey.RegistrationCeremonyRateRequest) (passkey.CeremonyRateSource, error)
RegistrationRateSource authenticates genuine completion-phase session/action custody and the original committed native ceremony context. It returns only sensitive rate metadata, not a current-validity lease. Historical consumed metadata may remain readable; Register still revalidates/consumes atomically. No proof, challenge, risk admission, credential or account lookup is created. Calls are bounded by Protocol.MaximumDuration and preserve cancellation.
type InventoryConfig ¶
type InventoryConfig struct {
TenantID identity.TenantID
RPNamespace, RPID string
Password *sessionpg.SessionServiceConfig
Passkey *sessionpg.PasskeySessionServiceConfig
MFAPasskey *sessionpg.MFAPasskeySessionAdmission
Protocol webauthnpg.Config
Authorization authorization.Service
PolicyVersion uint64
Rate *risk.CounterCoordinator
MaximumDuration time.Duration
}
InventoryConfig selects one concrete native session reader and one trusted tenant/RP. Exactly one Password or Passkey profile is required. MFAPasskey explicitly adds completed passkey/TOTP admission to Passkey, sharing its repository and validation configuration. Stored provenance selects the owner; there is no try-another-method fallback after a denial. All histories must be installed in the borrowed primary pool. Rate must use the owned risk counter adapter and StateNeutralRead policy; zero/missing/unknown counter results deny. Authorization is a trusted bounded policy callback, not a domain store. MaximumDuration is 1ms..5s; no resources or goroutines are owned.
type InventoryPage ¶
type InventoryPage = passkey.InventoryPage
InventoryPage is the adapter-neutral passkey data contract.
type InventoryRequest ¶
type InventoryRequest = passkey.InventoryRequest
InventoryRequest is the adapter-neutral passkey data contract.
type InventoryService ¶
type InventoryService struct {
// contains filtered or unexported fields
}
InventoryService authenticates and authorizes self-user metadata reads. It borrows concrete native owners, performs no credential mutation and exposes no protocol parser or application-written domain store. Concurrent calls are supported; the borrowed pool and callbacks must outlive them.
func NewInventoryService ¶
func NewInventoryService(pool *database.Pool, c InventoryConfig) (*InventoryService, error)
NewInventoryService freezes concrete native readers without IO. Select the same trusted deployment, tenant/RP and session authority as enrollment/signin. An unselected authentication profile is unavailable, never approximated.
func (*InventoryService) List ¶
func (s *InventoryService) List(ctx context.Context, r InventoryRequest) (InventoryPage, error)
List returns no partial data on failure. It checks genuine current session authority and exact self-user authorization, charges the existing safe-read rate owner, reads at most Limit+1 indexed mappings, obtains protocol metadata through its public native reader, then rechecks session/policy after IO. No locks span policy callbacks; no cached admission deadline is reset or reused.
type KeyedAssertionOptionsResult ¶
type KeyedAssertionOptionsResult = passkey.KeyedAssertionOptionsResult
KeyedAssertionOptionsResult is the adapter-neutral passkey data contract.
type KeyedDiscoverableOptionsRequest ¶
type KeyedDiscoverableOptionsRequest = passkey.KeyedDiscoverableOptionsRequest
KeyedDiscoverableOptionsRequest is the adapter-neutral passkey data contract.
type KeyedRegistrationOptionsRequest ¶
type KeyedRegistrationOptionsRequest = passkey.KeyedRegistrationOptionsRequest
KeyedRegistrationOptionsRequest is the adapter-neutral passkey data contract.
type KeyedRegistrationOptionsResult ¶
type KeyedRegistrationOptionsResult = passkey.KeyedRegistrationOptionsResult
KeyedRegistrationOptionsResult is the adapter-neutral passkey data contract.
type KeyedSigninOptionsRequest ¶
type KeyedSigninOptionsRequest = passkey.KeyedSigninOptionsRequest
KeyedSigninOptionsRequest is the adapter-neutral passkey data contract.
type MFAPasskeyPrimary ¶
type MFAPasskeyPrimary struct {
CommandID identity.CommandID
Primary session.SessionSpec
Directory kernel.DirectoryAuthorityAdmission
Credential kernel.CredentialAdmission
}
MFAPasskeyPrimary is unchanged committed assertion provenance for the native factor-completion owner. It is not a session or a completed factor proof. Completion must fence Directory, Credential, policy, factor and RP mapping in its sole Work, preserving Authentication's original primary time and expiry.
func (MFAPasskeyPrimary) MarshalJSON ¶
func (MFAPasskeyPrimary) MarshalJSON() ([]byte, error)
func (MFAPasskeyPrimary) MarshalText ¶
func (MFAPasskeyPrimary) MarshalText() ([]byte, error)
type ManagementConfig ¶
type ManagementConfig struct {
TenantID identity.TenantID
RPNamespace, RPID, ProofAudience string
Password sessionpg.SessionServiceConfig
Source *passwordpg.ActionPrimarySource
RequestKeys kernel.RequestKeyConfig
RequestTokenKey session.DigestKey
RequestCSRFKey session.CSRFKey
Coordinator kernel.CoordinatorConfig
Authorization authorization.Service
Risk *riskpg.Repository
PolicyID string
PolicyVersion uint64
MaximumDuration time.Duration
}
ManagementConfig selects existing-account label management under one trusted tenant/RP and a genuine password-session update proof source. Install the password owner's management proof suffix and this adapter's explicitly allocated MetadataVersionMigrationSource after its installed mapping/signin history before use. Dependencies are borrowed; no pool, goroutine or journal is owned. MaximumDuration is 1ms..5s. Request digest keys must remain unchanged for the lifetime of the kernel's retained original-request mappings.
func (ManagementConfig) MarshalJSON ¶
func (ManagementConfig) MarshalJSON() ([]byte, error)
func (ManagementConfig) MarshalText ¶
func (ManagementConfig) MarshalText() ([]byte, error)
type ManagementService ¶
type ManagementService struct {
// contains filtered or unexported fields
}
ManagementService renames only safe credential-reference metadata. Password proof consumption, current authority, risk and required effects share the existing coordinator Work. Protocol keys/counters and credential authority versions are never changed. Concurrent calls borrow immutable configuration.
func NewManagementService ¶
func NewManagementService(pool *database.Pool, c ManagementConfig) (*ManagementService, error)
NewManagementService freezes native readers and exact update-proof selection without IO. Matching historical retries still authenticate the original live browser/session; consumed proof metadata is not a renewable execution lease.
func (ManagementService) MarshalJSON ¶
func (ManagementService) MarshalJSON() ([]byte, error)
func (ManagementService) MarshalText ¶
func (ManagementService) MarshalText() ([]byte, error)
func (*ManagementService) Update ¶
func (s *ManagementService) Update(ctx context.Context, r passkey.UpdateRequest) (out passkey.UpdateResult, err error)
Update admits an exact typed key through the kernel's original-request owner. Incoming Primary.CommandID/RecordID must be empty: the server-allocated original command is bound before signed-proof preparation. Only an acknowledged fresh commit returns safe metadata; retries return historical receipts only.
type MetadataVersionMigrationSource ¶
type MetadataVersionMigrationSource struct{ Version migrations.Version }
MetadataVersionMigrationSource appends safe-label optimistic versioning to the actual installed mapping/signin history without reallocating its slots. Version is a permanent free slot greater than one; deployments with mapping1 and signin2 select three. Existing migration bytes, names and checksums must remain installed unchanged. Inventory and management require this suffix. It performs no IO and owns no runner, transaction or resource lifetime.
func (MetadataVersionMigrationSource) Load ¶
func (s MetadataVersionMigrationSource) Load(ctx context.Context) ([]migrations.Migration, error)
Load returns one forward-only transactional suffix for an explicitly allocated free version. Allocation is validated by the actual owner's combined runner; this source does not inspect or reinterpret an installed ledger.
type MigrationSource ¶
type MigrationSource struct{}
MigrationSource supplies this adapter's forward-only mapping history. Install the owned identity kernel and credential-reference histories first. WebAuthn has its own separately installed protocol history; no private key/counter or ceremony table is copied here. The zero value is usable concurrently. Load performs no IO and owns no runner, transaction, role or background process.
func (MigrationSource) Load ¶
func (MigrationSource) Load(ctx context.Context) ([]migrations.Migration, error)
Load returns fresh migration values, preserving cancellation and returning no partial history on failure. No destructive down migration is provided.
type OptionsRequestConfig ¶
type OptionsRequestConfig struct {
// contains filtered or unexported fields
}
OptionsRequestConfig explicitly enables original keyed-options admission. Zero keeps the released keyless APIs unchanged and disables keyed methods. It owns no journal, transaction, goroutine or resource lifetime. Install the kernel's RequestKeyMigrationSource before use; immutable mappings have the kernel's non-expiring retention and unknown-outcome reconciliation semantics.
func NewOptionsRequestConfig ¶
func NewOptionsRequestConfig(keys kernel.RequestKeyConfig, token session.DigestKey, csrf session.CSRFKey) (OptionsRequestConfig, error)
NewOptionsRequestConfig freezes existing request-key and digest owners without IO. token and csrf must be dedicated independent keys used only for this original-input correlation, not session/preauth lookup or CSRF validation. Keep these keys unchanged while mappings are retained: replacing them causes original requests to conflict, never silently allocates replacement commands. QueryPolicy and AdmissionPolicy must additionally be configured on the native service's Coordinator, and RequestKeys.Policy must authorize request admission. Full request-key policy validation is performed by the native constructor.
func (OptionsRequestConfig) MarshalJSON ¶
func (OptionsRequestConfig) MarshalJSON() ([]byte, error)
func (OptionsRequestConfig) MarshalText ¶
func (OptionsRequestConfig) MarshalText() ([]byte, error)
type RegistrationCompletion ¶
type RegistrationCompletion = passkey.RegistrationCompletion
RegistrationCompletion is the adapter-neutral passkey data contract.
type RegistrationRequest ¶
type RegistrationRequest = passkey.RegistrationRequest
RegistrationRequest is the adapter-neutral passkey data contract.
type SessionAuthority ¶
type SessionAuthority struct {
// contains filtered or unexported fields
}
SessionAuthority is the concrete passkey/MFA port for native session reads, issuance and revocation. It checks existing primary mappings; it cannot authenticate assertions, issue sessions, initialize factors or adopt newer epochs. Pool lifetime is borrowed; concurrent independent calls are supported. No resource, transaction, callback or goroutine is owned.
func NewSessionAuthority ¶
func NewSessionAuthority(pool *database.Pool, c SessionAuthorityConfig) (*SessionAuthority, error)
NewSessionAuthority freezes trusted configuration without IO. The same owned instance/profile must be selected by session issuance, read and revocation.
func (SessionAuthority) Format ¶
func (SessionAuthority) Format(s fmt.State, _ rune)
Format redacts borrowed infrastructure and configuration.
func (*SessionAuthority) ObserveMFAPasskeySession ¶
func (a *SessionAuthority) ObserveMFAPasskeySession(ctx context.Context, namespace string, record session.Session) (sessionpg.MFAPasskeySessionAuthorityObservation, error)
ObserveMFAPasskeySession compares only the original completed passkey/TOTP record's active native RP/handle/credential mapping on the primary. The MFA owner must independently check its original confirmed factor generation and enrollment; no known-empty FactorVersion is inferred or returned. The exclusive twenty-second mapping lease starts before all contributing IO. Missing/changed mapping denies rather than adopting a replacement version.
func (*SessionAuthority) ObservePasskeySession ¶
func (a *SessionAuthority) ObservePasskeySession(ctx context.Context, namespace string, record session.Session) (sessionpg.PasskeySessionAuthorityObservation, error)
ObservePasskeySession compares original passkey and known-empty MFA authority on the primary. ReadStartedAt precedes every contributing IO; its exclusive twenty-second ceiling cannot be restarted after a later read. No stale state or newer generation is returned as a replacement for the original record.
func (*SessionAuthority) RequireMFAPasskeySession ¶
func (a *SessionAuthority) RequireMFAPasskeySession(ctx context.Context, w kernel.Work, owner kernel.FeatureExecutionContributor, namespace string, record session.Session) error
RequireMFAPasskeySession locks only the original active native mapping in exact registered TOTP-completion, label-update, additional-key enrollment or self-session-revoke-one Work. The native caller must already fence its current directory/credential/policy and actual factor authority: factor locks MUST precede these RP/handle/credential locks, matching signin and enrollment. This mapping-only port cannot supply factor authentication or known-empty authority. Completion independently binds its frozen subject/record through the kernel and session owner, including final checks. Every error requires abort; no Work or transaction is retained here.
func (*SessionAuthority) RequirePasskeySession ¶
func (a *SessionAuthority) RequirePasskeySession(ctx context.Context, w kernel.Work, owner kernel.FeatureExecutionContributor, namespace string, record session.Session) error
RequirePasskeySession locks exact original known-empty MFA and active passkey mapping in the caller's original registered Work. Factor locks precede mapping locks, matching enrollment so opposing flows cannot reverse that lock order. The session owner must already fence its directory/credential/policy/session dimensions and call again before commit. Every error requires Work abortion.
func (*SessionAuthority) RequirePasskeySignupSession ¶
func (a *SessionAuthority) RequirePasskeySignupSession(ctx context.Context, w kernel.Work, owner kernel.PasskeyRegistrationContributor, command identity.Command, namespace string, record session.Session) error
RequirePasskeySignupSession checks only the exact newly created account and known-empty MFA authority from this original anonymous signup invocation, then locks its actual RP-wide credential/handle mapping. Existing-account assertion admission is unchanged. The session owner separately fences every directory/policy/session dimension before commit. No missing row, later epoch or reconstructed command can substitute; errors require complete Work abort. The borrowed Work remains serial-use and is never retained or closed here.
type SessionAuthorityConfig ¶
type SessionAuthorityConfig struct {
TenantID identity.TenantID
RPNamespace string
RPID string
MaximumDuration time.Duration
}
SessionAuthorityConfig fixes one trusted tenant/RP namespace and protocol RP ID. Requests cannot select these values. MaximumDuration is 1ms..5s, bounded by the caller's earlier deadline. Install kernel, MFA and passkey histories first; construction neither installs nor initializes missing authority.
type SessionDeletionConfig ¶
type SessionDeletionConfig = SessionManagementConfig
SessionDeletionConfig selects actual passkey-session, CSRF, protocol, policy and risk owners. This explicit profile permits removal only when another live resident passkey in the selected algorithm profile remains usable. Password/email/OTP recovery is not inferred or substituted. Installing it enables no HTTP route. Install the selected owner histories before use; the primary pool is borrowed.
type SessionDeletionService ¶
type SessionDeletionService struct {
// contains filtered or unexported fields
}
SessionDeletionService consumes genuine action-bound UV with exact credential removal, independently usable remaining-key admission and passkey-session invalidation in the sole native Work. No proof store, transaction owner, goroutine or automatic retry is introduced. Configuration is immutable; independent invocations may run concurrently.
func NewSessionDeletionService ¶
func NewSessionDeletionService(pool *database.Pool, c SessionDeletionConfig) (*SessionDeletionService, error)
NewSessionDeletionService validates and freezes concrete owners without IO. This selected resident-key recovery profile does not enable the independent password-proof deletion service. The pool must outlive all calls.
func (*SessionDeletionService) Delete ¶
func (s *SessionDeletionService) Delete(ctx context.Context, custody passkey.SessionDeleteCompletion) (passkey.SessionDeleteResult, error)
Delete verifies genuine action-bound UV and atomically removes exactly the intended own key only if an independent usable resident key remains. It advances passkey authority, invalidating affected passkey sessions without revoking independent password sessions. Acknowledgement belongs only to this original authenticated invocation: a new call with its invalidated session denies. Unknown is not rollback; preserve original command/key/input custody.
func (*SessionDeletionService) DeleteOptions ¶
func (s *SessionDeletionService) DeleteOptions(ctx context.Context, r passkey.SessionDeleteOptionsRequest) (out passkey.KeyedAssertionOptionsResult, err error)
DeleteOptions authenticates the actual current passkey session and creates original identified UV options bound to its intended target/version. The options and completion keys are distinct requests to the same protected action. An original retry returns metadata only, never another challenge or ceremony.
func (SessionDeletionService) Format ¶
func (SessionDeletionService) Format(f fmt.State, _ rune)
Format excludes borrowed owners and deployment correlation.
func (SessionDeletionService) MarshalJSON ¶
func (SessionDeletionService) MarshalJSON() ([]byte, error)
MarshalJSON rejects implicit owner export.
func (SessionDeletionService) MarshalText ¶
func (SessionDeletionService) MarshalText() ([]byte, error)
MarshalText rejects implicit owner export.
func (*SessionDeletionService) RecoverDelete ¶
func (s *SessionDeletionService) RecoverDelete(ctx context.Context, custody passkey.SessionDeleteRequest, query identity.RecoveryQuery) (passkey.SessionDeleteResult, error)
RecoverDelete returns only original durability metadata under an actual currently valid same-user passkey session and delete policy. After successful removal the original session is invalid: authenticate with a surviving key before using this recovery entry point. Query must retain the original command and target; recovery never repeats an assertion or removal, issues a session, adopts an old validity lease or treats an unknown outcome as rollback.
type SessionEnrollmentConfig ¶
type SessionEnrollmentConfig = SessionManagementConfig
SessionEnrollmentConfig selects the same concrete current-session transport, CSRF, protocol, policy and risk owners as session management. It enables only the explicit service constructed from it, never an HTTP route or password proof fallback. Install the selected histories, including WebAuthn migration5. TOTP explicitly selects completed passkey/TOTP sessions, never ordinary or other secondary-factor fallback. The original confirmed factor remains current through each protected phase and final precommit checks.
type SessionEnrollmentService ¶
type SessionEnrollmentService struct {
// contains filtered or unexported fields
}
SessionEnrollmentService adds resident UV credentials using a genuine fresh assertion from the current passkey session. Dependencies are borrowed and invocation participants are private; no goroutines, alternate proof store, resource lifetime or transaction owner is introduced.
func NewSessionEnrollmentService ¶
func NewSessionEnrollmentService(pool *database.Pool, c SessionEnrollmentConfig) (*SessionEnrollmentService, error)
NewSessionEnrollmentService freezes actual native owners without IO. The pool must outlive calls. Configuration cannot supply substitute domain stores or completed proofs; A and B use distinct keys and C retains its own command ID.
func (*SessionEnrollmentService) EnrollmentAssertionOptions ¶
func (s *SessionEnrollmentService) EnrollmentAssertionOptions(ctx context.Context, r passkey.SessionEnrollmentOptionsRequest) (out passkey.KeyedAssertionOptionsResult, err error)
EnrollmentAssertionOptions creates genuine identified UV options only under the current self-user session. A matching original key reveals metadata only.
func (SessionEnrollmentService) Format ¶
func (SessionEnrollmentService) Format(f fmt.State, _ rune)
Format excludes borrowed configuration and deployment correlation.
func (SessionEnrollmentService) MarshalJSON ¶
func (SessionEnrollmentService) MarshalJSON() ([]byte, error)
MarshalJSON rejects implicit owner export.
func (SessionEnrollmentService) MarshalText ¶
func (SessionEnrollmentService) MarshalText() ([]byte, error)
MarshalText rejects implicit owner export.
func (*SessionEnrollmentService) Register ¶
func (s *SessionEnrollmentService) Register(ctx context.Context, custody passkey.SessionEnrollmentCompletion) (out passkey.SessionEnrollmentResult, err error)
Register consumes the genuine authorized B registration atomically with its initial kernel reference, mapping/label and required lifecycle. It retains C's original command identity (no retry key), never issues a session and returns only metadata for a matching historical completion.
func (*SessionEnrollmentService) RegistrationOptions ¶
func (s *SessionEnrollmentService) RegistrationOptions(ctx context.Context, custody passkey.SessionEnrollmentAuthorization) (out passkey.KeyedRegistrationOptionsResult, err error)
RegistrationOptions verifies the genuine A assertion and creates original resident registration options in the same B transaction. No reusable proof or session is issued. Retries retain original durability and never reveal options.
func (*SessionEnrollmentService) RegistrationOptionsForDelivery ¶
func (s *SessionEnrollmentService) RegistrationOptionsForDelivery(ctx context.Context, custody passkey.SessionEnrollmentAuthorization) (out passkey.KeyedRegistrationOptionsResult, authorizationExpiry time.Time, err error)
RegistrationOptionsForDelivery performs the same B operation as RegistrationOptions and additionally returns A's genuine original absolute authorization expiry for a bounded consumer's final options-delivery check. This immutable ceiling is not proof, current-validity evidence or an extension of B's protocol TTL. Check it after synchronous hooks alongside actual session and request validity. Only fresh acknowledged options include a nonzero value; metadata-only retries and all errors return zero and reveal no options.
func (*SessionEnrollmentService) SessionRegistrationRateSource ¶
func (s *SessionEnrollmentService) SessionRegistrationRateSource(ctx context.Context, custody passkey.SessionEnrollmentRequest, ceremonyID string) (passkey.CeremonyRateSource, error)
SessionRegistrationRateSource authenticates current completion-action session and original enrollment intent before returning the B ceremony's user rate metadata. It reads genuine A/B records and retains A's absolute expiry; a later registration TTL cannot renew authorization. It issues no proof, options, command reservation or risk admission and consumes nothing. Historical consumed metadata may remain readable, but Register independently revalidates all authority and atomically consumes. Custody is borrowed for the call; the pool and owners must outlive concurrent calls. Earlier cancellation takes precedence over Protocol.MaximumDuration. Denial returns no metadata.
type SessionManagementConfig ¶
type SessionManagementConfig struct {
Protocol webauthn.Config
Profile sessionpg.PasskeyAdmissionConfig
Validation session.ServiceConfig
SessionRepository sessionpg.Config
OptionsRequests OptionsRequestConfig
Coordinator kernel.CoordinatorConfig
Authorization authorization.Service
Clock clock.Clock
Transport session.CredentialKind
CSRFKeys []session.CSRFKey
Risk *riskpg.Repository
PolicyID string
PolicyVersion uint64
// TOTP explicitly selects completed passkey/TOTP sessions instead of the
// ordinary known-empty profile. It enables label rename, additional-key
// enrollment and resident-key removal, not another secondary-factor fallback.
TOTP bool
}
SessionManagementConfig selects inline UV label management under one real current passkey session. It enables neither password-proof management nor a separately reusable reauthentication proof. The native owner composes its actual session/mapping/factor readers; applications supply no domain store. Both phases use the protected update risk policy. Install existing mapping, signin-context, metadata-version, request-key and selected owner histories. Dependencies are borrowed; MaximumDuration comes from Protocol (1ms..5s).
func (SessionManagementConfig) Format ¶
func (SessionManagementConfig) Format(s fmt.State, _ rune)
Format redacts configuration, keys and deployment correlation.
func (SessionManagementConfig) MarshalJSON ¶
func (SessionManagementConfig) MarshalJSON() ([]byte, error)
MarshalJSON prohibits implicit configuration/key export.
func (SessionManagementConfig) MarshalText ¶
func (SessionManagementConfig) MarshalText() ([]byte, error)
MarshalText prohibits implicit configuration/key export.
type SessionManagementService ¶
type SessionManagementService struct {
// contains filtered or unexported fields
}
SessionManagementService composes actual current-session and WebAuthn owners in the sole kernel transaction. Each invocation owns its participants; frozen configuration supports concurrent independent calls. No resource lifetime, private proof/session store, retry journal or goroutine is introduced.
func NewSessionManagementService ¶
func NewSessionManagementService(pool *database.Pool, c SessionManagementConfig) (*SessionManagementService, error)
NewSessionManagementService validates and freezes selected native owners without IO. Bearer and cookie are disjoint; cookies require retained original CSRF keys, and bearer selection accepts none. The pool must outlive calls.
func (SessionManagementService) Format ¶
func (SessionManagementService) Format(s fmt.State, _ rune)
Format redacts borrowed resources and deployment correlation.
func (SessionManagementService) MarshalJSON ¶
func (SessionManagementService) MarshalJSON() ([]byte, error)
MarshalJSON prohibits implicit borrowed-owner export.
func (SessionManagementService) MarshalText ¶
func (SessionManagementService) MarshalText() ([]byte, error)
MarshalText prohibits implicit borrowed-owner export.
func (*SessionManagementService) Update ¶
func (s *SessionManagementService) Update(ctx context.Context, r passkey.SessionUpdateCompletion) (out passkey.UpdateResult, err error)
Update verifies a fresh genuine UV assertion and atomically consumes its ceremony/counter transition with the original label CAS, risk and lifecycle. It issues no session or reusable proof. Same-key history returns metadata only.
func (*SessionManagementService) UpdateOptions ¶
func (s *SessionManagementService) UpdateOptions(ctx context.Context, r passkey.SessionUpdateOptionsRequest) (out passkey.KeyedAssertionOptionsResult, err error)
UpdateOptions authenticates the current passkey session and creates one original action-bound identified UV ceremony. The options key and completion key must be distinct: they are different requests to the same protected action. A matching retry returns only the original command receipt, never options.
type SigninCompletion ¶
type SigninCompletion = passkey.SigninCompletion
SigninCompletion is the adapter-neutral passkey data contract.
type SigninConfig ¶
type SigninConfig struct {
// OptionsRequests explicitly enables the additive keyed options APIs only.
OptionsRequests OptionsRequestConfig
Protocol webauthn.Config
Profile sessionpg.PasskeyAdmissionConfig
Coordinator kernel.CoordinatorConfig
Authorization authorization.Service
Clock clock.Clock
Flow session.PreAuthIssuerConfig
Session session.IssuerConfig
CSRF session.CSRFKey
Repository sessionpg.Config
Risk risk.AuthenticationAdmissionCustodyConfig
IdentifierKey []byte
}
SigninConfig selects one trusted identified resident UV passkey deployment. Flow.Action must be identity.passkey.signin-verify. Profile and protocol fix tenant/RP/policy before browser input; final Remember comes only from the original session-owned flow. Dependencies are borrowed and must outlive calls. Install existing owner histories plus SigninMigrationSource. Options use account-independent resident discovery, but the original verified email is mandatory at completion through the identified methods. The additive Discoverable methods explicitly select identifier-free signin with the risk owner's startup opt-in. No signup, completed-MFA or organization profile is enabled. NewMFASigninService explicitly adds the challenge-only TOTP profile; it does not complete MFA or change NewSigninService's enrolled-factor denial.
func (SigninConfig) MarshalJSON ¶
func (SigninConfig) MarshalJSON() ([]byte, error)
MarshalJSON prohibits implicit configuration or credential transport.
func (SigninConfig) MarshalText ¶
func (SigninConfig) MarshalText() ([]byte, error)
MarshalText prohibits implicit configuration or credential transport.
type SigninMFAConfig ¶
type SigninMFAConfig struct {
Lifetime time.Duration
MaxAttempts uint32
IssuerURL string
Issuer issuerpg.IssuerConfig
Custody issuerpg.IssuancePreparationConfig
Envelope *envelope.Service
EnvelopeKeyID string
}
SigninMFAConfig explicitly selects UV-passkey-primary followed by confirmed TOTP. It never treats UV as a second factor. Known-empty accounts retain the ordinary signin result; enrolled accounts receive only a committed challenge. Lifetime is 1..300 whole seconds, capped by original assertion/browser expiry. Signing, replay and envelope keys retain their native independent ownership. Envelope and its retained key are borrowed for the original journal lifetime. Install the MFA continuation, TOTP and capability owner histories separately.
func (SigninMFAConfig) MarshalJSON ¶
func (SigninMFAConfig) MarshalJSON() ([]byte, error)
func (SigninMFAConfig) MarshalText ¶
func (SigninMFAConfig) MarshalText() ([]byte, error)
type SigninMigrationSource ¶
type SigninMigrationSource struct{ Version migrations.Version }
SigninMigrationSource appends original identity admission context after the existing passkey mapping history. Version is a permanent free slot greater than one. The row binds existing WebAuthn ceremony to original browser flow and owner epochs; it stores no challenge, consumption state, proof, session or command journal. A NULL user is original suppressed identified admission or explicit account-independent discovery, never an authenticating placeholder. Their admission encodings are distinct. Owner histories remain separate. Forward-only, no IO; previously published SQL remains unchanged.
func (SigninMigrationSource) Load ¶
func (s SigninMigrationSource) Load(ctx context.Context) ([]migrations.Migration, error)
Load validates allocation and returns one owned transactional suffix. Apply through the sole existing runner after MigrationSource and before signin.
type SigninRequest ¶
type SigninRequest = passkey.SigninRequest
SigninRequest is the adapter-neutral passkey data contract.
type SigninResult ¶
type SigninResult = passkey.SigninResult
SigninResult is the adapter-neutral passkey data contract.
type SigninService ¶
type SigninService struct {
// contains filtered or unexported fields
}
SigninService composes existing preauth/risk/WebAuthn/identity/session owners. It owns no pool lifetime, goroutine, private journal, proof or session store. Concurrent calls use invocation-private participants; zero values deny.
func NewMFASigninService ¶
func NewMFASigninService(pool *database.Pool, c SigninConfig, m SigninMFAConfig) (*SigninService, error)
NewMFASigninService selects the additive native TOTP challenge profile. NewSigninService remains known-empty-only. No IO or randomness occurs here; pool, clock, authorization and envelope collaborators remain caller-owned.
func NewSigninService ¶
func NewSigninService(pool *database.Pool, c SigninConfig) (*SigninService, error)
NewSigninService validates native composition without IO or entropy. The exact profile is retained across preauth issue, options and final session.
func (*SigninService) AuthenticationOptions ¶
func (s *SigninService) AuthenticationOptions(ctx context.Context, r SigninRequest) (webauthn.AssertionOptions, error)
AuthenticationOptions checks original flow/cookie, counted/audited risk and directory authority before committing account-independent resident UV options. No credential descriptors or account eligibility are disclosed. The private original identifier admission must still match the genuinely verified target.
func (*SigninService) ConditionalAuthenticationOptions ¶
func (s *SigninService) ConditionalAuthenticationOptions(ctx context.Context, r DiscoverableSigninRequest) (passkey.ConditionalAssertionOptions, error)
ConditionalAuthenticationOptions explicitly selects conditional browser presentation over genuine anonymous discovery. The existing PasskeyDiscovery startup policy is required. It changes neither protocol options nor durable mode, flow, risk, remember or expiry. Complete through DiscoverableSignin; read rate metadata through DiscoverableSigninRateSource. This cannot prove which mediation a browser actually used and does not enable browser UI.
func (*SigninService) DiscoverableAuthenticationOptions ¶
func (s *SigninService) DiscoverableAuthenticationOptions(ctx context.Context, r DiscoverableSigninRequest) (webauthn.AssertionOptions, error)
DiscoverableAuthenticationOptions selects identifier-free resident signin. It requires the risk owner's explicit PasskeyDiscovery policy opt-in; no synthetic identifier or weaker lane substitutes when unavailable. Options bind original browser, expiry and deployment authority, not any account. The selected mode cannot change at completion. No signup/conditional UI is enabled.
func (*SigninService) DiscoverableSignin ¶
func (s *SigninService) DiscoverableSignin(ctx context.Context, r DiscoverableSigninCompletion) (SigninResult, error)
DiscoverableSignin cryptographically resolves credential and resident handle together, then admits the current identity, exact native mapping and known- empty secondary-factor policy, or the explicitly selected TOTP challenge. Known-empty flow/counter/session/CSRF effects finalize in the existing sole Work. Enrolled accounts commit assertion/child effects with no session or CSRF; the original browser stays active until the independent factor completes. No provisional, historical or ambiguous result reveals authentication. Use RecoverSignin for metadata-only reconciliation; it never reissues secrets.
func (*SigninService) DiscoverableSigninRateSource ¶
func (s *SigninService) DiscoverableSigninRateSource(ctx context.Context, r passkey.DiscoverableCeremonyRateRequest) (passkey.CeremonyRateSource, error)
DiscoverableSigninRateSource authenticates the original identifier-free browser/mode without selecting an account or manufacturing a UserID. Only original anonymous-flow rate metadata is returned. Discovery completion must still verify, revalidate and consume once; a read issues/renews nothing.
func (*SigninService) IssueFlow ¶
func (s *SigninService) IssueFlow(ctx context.Context, p session.PreparedPreAuthIssuance) (session.PreAuthIssueResult, error)
IssueFlow commits the original session-owned browser flow and reveal-once cookie. It authenticates nobody and returns no session credential.
func (*SigninService) KeyedAuthenticationOptions ¶
func (s *SigninService) KeyedAuthenticationOptions(ctx context.Context, r KeyedSigninOptionsRequest) (KeyedAssertionOptionsResult, error)
KeyedAuthenticationOptions retains identified native signin's exact original request key, browser, identifier and profile. Replay never reruns risk or creates a new challenge; completion and authentication remain one-use.
func (*SigninService) KeyedConditionalAuthenticationOptions ¶
func (s *SigninService) KeyedConditionalAuthenticationOptions(ctx context.Context, r KeyedDiscoverableOptionsRequest) (passkey.KeyedConditionalOptionsResult, error)
KeyedConditionalAuthenticationOptions explicitly projects the fresh winner of existing keyed discovery. Native OptionsRequests and PasskeyDiscovery opt-ins remain required. Conditional and ordinary discoverable presentations share the same original command and immutable discovery intent: switching presentation on retry returns metadata only, never a replacement challenge. Identified mode still conflicts. Unknown outcomes retain native recovery; no challenge, session or proof is reconstructed here.
func (*SigninService) KeyedDiscoverableAuthenticationOptions ¶
func (s *SigninService) KeyedDiscoverableAuthenticationOptions(ctx context.Context, r KeyedDiscoverableOptionsRequest) (KeyedAssertionOptionsResult, error)
KeyedDiscoverableAuthenticationOptions selects identifier-free resident options without changing the released identified or discoverable APIs.
func (*SigninService) PrepareFlow ¶
func (s *SigninService) PrepareFlow(i session.PreAuthPrepareInput) (session.PreparedPreAuthIssuance, error)
PrepareFlow delegates original entropy/time/remember custody to the session owner. Retain the unchanged preparation for IssueFlow, never prepare a retry.
func (*SigninService) ReadMFAPasskeyPrimary ¶
func (s *SigninService) ReadMFAPasskeyPrimary(ctx context.Context, proof capability.Proof, continuation mfa.PartialAuthContinuation, flow session.PreAuthTransaction, caller authorization.DecisionContext) (out MFAPasskeyPrimary, err error)
ReadMFAPasskeyPrimary authenticates the issued child, committed native parent and original encrypted preparation before returning original primary custody. It never signs, regenerates, renews or issues authentication. Flow must be the original browser record; possession and pending lifecycle are independently checked by MFA completion. Caller must be trusted self-user query attribution. Current authority and original expiry are preliminary fences, not a substitute for the completion owner's same-transaction rechecks. Earlier cancellation bounds every borrowed read; unavailable, foreign or retired keys fail closed.
func (*SigninService) RecoverSignin ¶
func (s *SigninService) RecoverSignin(ctx context.Context, q identity.RecoveryQuery, caller authorization.DecisionContext) (identity.CommandResult, error)
RecoverSignin authorizes exact historical metadata through the existing coordinator query policy. It discloses no challenge, assertion, session, bearer or continuation, and never reexecutes the operation. Options retain original service actor; verification retains verified self-user attribution.
func (*SigninService) Signin ¶
func (s *SigninService) Signin(ctx context.Context, r SigninCompletion) (SigninResult, error)
Signin verifies genuine original-service-attributed browser assertion before the self-human final command consumes flow, protocol transition and native session effects atomically for known-empty accounts. Explicit MFA composition instead consumes only the assertion and creates the original TOTP challenge; browser consumption and session issuance wait for independent factor proof.
func (*SigninService) SigninRateSource ¶
func (s *SigninService) SigninRateSource(ctx context.Context, r passkey.SigninCeremonyRateRequest) (passkey.CeremonyRateSource, error)
SigninRateSource authenticates original identified browser/ceremony custody, including the exact originally suppressed identifier. It performs no account lookup, assertion parsing, risk admission or consumption, and reveals no user or eligibility. Metadata is not a validity lease; Signin remains authoritative. Concurrent calls borrow the native pool and are bounded by MaximumDuration.
type SignupConfig ¶
type SignupConfig struct {
Protocol webauthn.Config
Profile sessionpg.PasskeyAdmissionConfig
Coordinator kernel.CoordinatorConfig
Authorization authorization.Service
Clock clock.Clock
Flow session.PreAuthIssuerConfig
Session session.IssuerConfig
CSRF session.CSRFKey
Repository sessionpg.Config
Risk risk.ProtectedProviderAdmissionCustodyConfig
Counters riskpg.Config
OptionsRequests OptionsRequestConfig
}
SignupConfig selects prospective passkey-only signup in one trusted tenant and RP. No email, password or caller-selected user is accepted. Flow.Action must be identity.passkey.register-verify. Risk and Counters must share the canonical protected registration policy; no signup-specific relaxation exists. Dependencies are borrowed/concurrency-safe and must outlive calls. Install SignupMigrationSource and all selected kernel/protocol/MFA/session histories. Construction performs no IO, entropy, migration or background work.
func (SignupConfig) Format ¶
func (SignupConfig) Format(s fmt.State, _ rune)
Format redacts trusted configuration and borrowed owner references.
func (SignupConfig) MarshalJSON ¶
func (SignupConfig) MarshalJSON() ([]byte, error)
MarshalJSON prohibits implicit configuration or credential transport.
func (SignupConfig) MarshalText ¶
func (SignupConfig) MarshalText() ([]byte, error)
MarshalText prohibits implicit configuration or credential transport.
type SignupMigrationSource ¶
type SignupMigrationSource struct{ Version migrations.Version }
SignupMigrationSource adds bounded original prospective registration context after the selected mapping history. Version is a permanent unused slot greater than one; mapping1/signin2/metadata3 deployments select four. Unselected signin and metadata suffixes are not bootstrap dependencies. This is not another ceremony, challenge, replay or proof store: WebAuthn owns those. The row commits only prospective identity/handle and original deployment/flow intent, without creating an account or stable handle mapping. The protocol history remains independent and mandatory. Load is pure and concurrent-safe, has no destructive down path or runner.
func (SignupMigrationSource) Load ¶
func (s SignupMigrationSource) Load(ctx context.Context) ([]migrations.Migration, error)
Load returns one forward-only suffix; the real migration runner owns slot allocation/history checks. Nil/cancelled context and invalid versions deny.
type SignupService ¶
type SignupService struct {
// contains filtered or unexported fields
}
SignupService composes genuine WebAuthn registration with original pre-auth, risk, account, credential, policy/factors, mapping and session owners in one Work. It starts no goroutine and owns no pool or independent journal. Zero denies; concurrent requests use distinct private invocations. Preparing options creates no identity, stable handle, credential or authenticated session.
func NewSignupService ¶
func NewSignupService(pool *database.Pool, c SignupConfig) (*SignupService, error)
NewSignupService explicitly selects signup without enabling enrollment, identified signin, HTTP routes or recovery methods. Original remember/expiry comes exclusively from the session-owned browser flow, not completion input.
func (SignupService) Format ¶
func (SignupService) Format(s fmt.State, _ rune)
Format redacts borrowed runtime owners and correlated configuration.
func (*SignupService) IssueFlow ¶
func (s *SignupService) IssueFlow(ctx context.Context, p session.PreparedPreAuthIssuance) (session.PreAuthIssueResult, error)
IssueFlow commits only the original unauthenticated browser flow/cookie.
func (*SignupService) KeyedRegistrationOptions ¶
func (s *SignupService) KeyedRegistrationOptions(ctx context.Context, r passkey.KeyedSignupOptionsRequest) (out KeyedRegistrationOptionsResult, err error)
KeyedRegistrationOptions admits one original signup options request through the existing kernel request-key owner. It requires explicit OptionsRequests configuration and empty CommandID. Matching retries authenticate the immutable original cookie/input digest before metadata disclosure, even after the flow is consumed or expires. Historical outcomes reveal no options and never rerun admission, allocate an identity or refresh original authority. Only a freshly acknowledged winner receives the protocol owner's reveal-once options.
func (*SignupService) PrepareFlow ¶
func (s *SignupService) PrepareFlow(i session.PreAuthPrepareInput) (session.PreparedPreAuthIssuance, error)
PrepareFlow delegates original entropy/time/remember custody to the session owner. Retain the preparation unchanged for IssueFlow; do not prepare retries.
func (*SignupService) RecoverRegistrationOptions ¶
func (s *SignupService) RecoverRegistrationOptions(ctx context.Context, r passkey.SignupRequest, caller authorization.DecisionContext) (identity.CommandResult, error)
RecoverRegistrationOptions returns only the original options command's historical metadata under original cookie possession and current query policy. It never returns a challenge or prepares another ceremony. Keyed callers can instead repeat KeyedRegistrationOptions with their exact retained request.
func (*SignupService) RecoverSignup ¶
func (s *SignupService) RecoverSignup(ctx context.Context, r passkey.SignupRequest, ceremonyID string, caller authorization.DecisionContext) (identity.CommandResult, error)
RecoverSignup authorizes and reconciles only the original completion's durability metadata. Retain CommandID, FlowID, original cookie/origin and CeremonyID. The caller is trusted service attribution on identity.anonymous-flow, not a browser-selected identity. The native context supplies the original credential reference; consumers need no private SQL or reconstructed command. Original cookie possession and current coordinator query policy are required. Consumed/expired flow state and later user epochs do not renew authentication or prevent historical metadata recovery. Results contain no bearer, CSRF, user/credential payload or permission to execute again. Retain original flow records and their configured lookup key while this recovery is supported.
func (*SignupService) RegistrationOptions ¶
func (s *SignupService) RegistrationOptions(ctx context.Context, r passkey.SignupRequest) (webauthn.RegistrationOptions, error)
RegistrationOptions commits original session/browser/risk admission and a genuine resident-required UV/none ceremony in the selected ES256/Ed25519 profile. The opaque prospective user and handle remain bounded intent only; no durable account or mapping exists.
func (*SignupService) Signup ¶
func (s *SignupService) Signup(ctx context.Context, r passkey.SignupCompletion) (passkey.SignupResult, error)
Signup verifies the real original authenticator before creating the account and all required effects atomically. Only a newly acknowledged commit reveals bearer/CSRF; ambiguity/replay/failure returns no historical credential.
func (*SignupService) SignupRateSource ¶
func (s *SignupService) SignupRateSource(ctx context.Context, r passkey.SignupCeremonyRateRequest) (passkey.CeremonyRateSource, error)
SignupRateSource authenticates original signup cookie/flow possession, current directory authority and canonical prospective registration context. It returns only anonymous-flow metadata: no user is authenticated or exposed. No risk, command, proof, challenge, account or session state is created or consumed. Metadata never renews the ceremony or authorizes Signup, which revalidates and consumes atomically. Calls borrow the native pool and are bounded/cancelable.
Source Files
¶
- algorithm_profile.go
- ceremony_rate.go
- conditional_options.go
- deletion.go
- deletion_phase.go
- discoverable_signin.go
- enrollment.go
- enrollment_phase.go
- enrollment_recovery.go
- inventory.go
- keyed_options.go
- management.go
- management_phase.go
- migrations.go
- session_authority.go
- session_deletion.go
- session_deletion_admission.go
- session_deletion_phase.go
- session_deletion_protocol.go
- session_enrollment.go
- session_enrollment_phase.go
- session_management.go
- session_management_admission.go
- session_management_phase.go
- signin.go
- signin_mfa.go
- signin_mfa_output.go
- signin_mfa_phase.go
- signin_mfa_primary.go
- signin_migration.go
- signin_phase.go
- signin_recovery.go
- signin_response.go
- signup.go
- signup_context.go
- signup_keyed.go
- signup_migration.go
- signup_phase.go
- signup_recovery.go
- signup_session_authority.go