postgres

package module
v0.0.0-...-935ddaf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 46 Imported by: 0

README

Passkey PostgreSQL adapter

Experimental, incomplete and unreleased. The selected existing-account flow does not substitute for a complete passkey authentication platform.

Explicit passkey-primary and TOTP challenge

NewSigninService still denies enrolled factors. Select NewMFASigninService(pool, signinConfig, mfaConfig) explicitly to use a genuine UV assertion as the non-final primary for an already confirmed TOTP account. Known-empty accounts retain the ordinary session result. Identified and discoverable options bind that exact selection before a browser assertion; completion cannot switch from the default profile or change the selected issuer, key ID, lifetime or attempt limit.

The enrolled branch returns SigninResult.Receipt and Challenge, never a session, bearer or CSRF credential. The genuine WebAuthn transition, original continuation, child issuance, audit and lifecycle effect commit atomically. Original browser pre-authentication stays active for the independent factor owner to consume later. Parse the incoming cookie into a fresh session.Token per request: this selected branch uses its one-time input reveal to bind the existing command's browser custody, not to issue another cookie.

Install existing kernel (including PreparationMigrationSource), passkey, WebAuthn, MFA TOTP/continuation and capability histories, then append the MFA owner's PasskeyContinuationMigrationSource with flags describing the already installed predecessor profiles. The passkey owner does not migrate or duplicate another owner's tables. SigninMFAConfig borrows an envelope service and retains its configured key ID for the original journal's recovery lifetime; signing, replay, child-checkpoint and primary-envelope keys must be independently managed under their existing owner contracts.

ReadMFAPasskeyPrimary authenticates the actual issued child and committed parent before restoring the unchanged encrypted primary. Original issue time, expiry, remember choice, subject, credential and authority epochs are never renewed. It is provenance for the MFA completion owner, not permission to issue a session: that owner must verify actual TOTP and repeat current authority and original-browser checks atomically. RecoverSignin remains metadata-only and never reveals a historical child proof. Lost, unavailable or retired custody denies; it does not authorize regenerating a challenge or assuming rollback.

Selected algorithms

Protocol.Algorithms selects ES256 (-7), EdDSA (-8, Ed25519 only), or an ordered unique combination of both. Nil preserves the released ES256 default; explicit empty, duplicate, unknown and RS256 profiles deny construction. The exact order and nil representation remain bound to original requests and ceremonies. Do not change the selected profile while continuing a ceremony.

The same selection applies to password-proof enrollment, prospective passkey- only signup, identified/discoverable signin and current-session enrollment, rename and removal. Cryptographic verification, COSE/UV/backup/counters remain owned by WebAuthn. Removal can count only another usable resident key in the current selected signin profile. A stored key with an unselected algorithm does not make removing the last selected key safe; an earlier unselected mapping does not hide a later selected recovery key. Existing protocol and mapping histories are unchanged. Native signed-authenticator integration does not establish browser/platform interoperability for Ed25519.

Current-session removal with another resident key

Explicitly construct NewSessionDeletionService(pool, SessionDeletionConfig) with the actual current passkey-session, CSRF, policy, risk and protocol owners used by session management. This selected algorithm profile requires another usable resident key; it never invents password, email or OTP recovery. The existing password-proof DeletionService remains separate and unchanged.

Install the selected kernel/MFA/passkey histories and WebAuthn migration 6 before selecting it. The native module supplies no HTTP routes by itself.

  1. Build passkey.NewSessionDeleteRequest with the current session credential, original cookie CSRF when selected, self-user delete caller, safe inventory reference/metadata version and trusted ingress. Call DeleteOptions with an original IdempotencyKey.
  2. Obtain genuine UV for those identified options. Call Delete with passkey.NewSessionDeleteCompletion, unchanged intent, the original ceremony and a different completion key. Do not substitute a reusable proof or a signin assertion. Kernel reference and protocol versions are independent of the inventory metadata version.
  3. The sole Work consumes the assertion and erases the target protocol key, disables its reserved kernel reference, revokes its mapping and advances this RP/user's passkey generation with required audit/lifecycle effects. A genuine current protocol key, original resident registration provenance and active native/kernel mapping must remain independently usable.

Removal may target the authenticating key or a sibling. Last-key removal, changed intent/current authority, missing provenance and expiry deny atomically. Existing passkey sessions bound to this generation deny on their next current read; earlier positive evidence retains its original twenty-second ceiling. Independent password-session authority is unchanged. No authenticator-local erasure is claimed, and reserved RP-wide credential IDs cannot be re-enrolled.

Fresh success acknowledges only the original authenticated invocation; it does not make its now-invalid session usable again. Preserve command, keys and input on unknown outcomes. After authenticating with the surviving key, use RecoverDelete and the original command/target query for metadata-only recovery. It never repeats removal, reveals a session or renews old authority. Options retries under a still-valid source are metadata-only and disclose no new options. Metadata delivery rechecks that invocation's original positive-read deadline; history lookup cannot renew it. Canceled or deadline-exceeded preparation reads retain their context error classification instead of becoming eligibility denials.

Registration provenance must remain available while a key is eligible for this profile. Missing history fails closed. This selected native behavior does not claim HTTP composition, browser interoperability or full passkey qualification.

Additional resident key under a passkey session

Select NewSessionEnrollmentService(pool, SessionEnrollmentConfig{...}) with the actual session, protocol, mapping, authorization, clock, keyed-request and protected risk owners. Configuration uses the same explicit fields as SessionManagementConfig; constructing either service enables no HTTP route. The native owner supplies domain repositories and orchestration, not application callbacks pretending that verification succeeded. This profile selects resident UV/none with selected ES256/Ed25519 algorithms, known-empty MFA and one self-human session. Enrolled-MFA and organization variants remain separate, unsupported profiles.

Install the existing mapping/signin-context/metadata, session/MFA, kernel request- key, risk, audit and outbox histories, plus WebAuthn migration 5 before use. Existing history bytes and password-proof APIs remain unchanged. The borrowed pool/collaborators outlive calls; each invocation is bounded to the configured protocol duration (1ms–5s), with earlier caller cancellation taking precedence.

  1. Construct passkey.NewSessionEnrollmentRequest from its explicit SessionEnrollmentRequestSpec: actual cookie or bearer credential, original CSRF for cookies, self-user caller for identity.passkey.register-options, optional display label and trusted origin/network. Specs are unredacted deliberate projections, not safe logs. Opaque request values reject implicit serialization and hide custody even through nested formatting.
  2. Call EnrollmentAssertionOptions with SessionEnrollmentOptionsRequest and the original A idempotency key. Transfer committed genuine assertion options once, and have the session's existing authenticator perform UV.
  3. Call RegistrationOptions with passkey.NewSessionEnrollmentAuthorization(SessionEnrollmentAuthorizationSpec): unchanged original request, a distinct B key, original A ceremony ID and its genuine assertion bytes. The native coordinator consumes that assertion/ counter and creates registration together. Transfer the fresh resident-key options once; no reusable reauthentication proof is created. A consumer buffering output through synchronous hooks instead calls RegistrationOptionsForDelivery for the same B operation and its immutable original A expiry. Check that nonzero expiry after hooks alongside actual session/request validity and B's protocol expiry. The timestamp grants no authority and is zero on replay/error; do not infer it from B's later TTL.
  4. Preserve intent and session, change the caller action to identity.passkey.register-verify, and call Register with passkey.NewSessionEnrollmentCompletion(SessionEnrollmentCompletionSpec). Supply one stable original CommandID, original B ceremony ID and genuine registration response. C has no IdempotencyKey. Protocol consumption, initial kernel reference, mapping/label, protected risk and required audit/ creation lifecycle share the existing transaction. Use the result's explicit Bindings projection to inspect durability and safe fresh metadata.

Each phase authenticates actual current session/CSRF and self-user policy before work, and fences the original directory/credential/factor/passkey/session and authorization generations again through final commit. Original A authorization expiry remains the ceiling for B and C; the later registration protocol TTL cannot extend it. No session, device cookie, password fallback or renewed proof is issued. The original session and both valid authenticators remain usable.

Before a transport admits C to its canonical challenge-verification budget, call SessionRegistrationRateSource(ctx, originalRequest, bCeremonyID). The request uses the exact original intent, actual session/CSRF and register-verify caller. This authenticates native retained intent and genuine A/B records, returning only the original user/ceremony dimensions and fixed five-minute policy duration (not remaining TTL or a validity lease). Repeated reads create no command/risk/ protocol effects and consume nothing. Original A expiry remains the ceiling; Register still independently verifies, revalidates and consumes atomically. Historical consumed metadata may remain readable only under current custody.

After uncertainty preserve the exact A/B keys or C command, ceremony and input; never allocate a replacement to escape an unknown result. Reserved/committed history returns metadata only. If the reservation never committed, an unchanged retry may perform that command's first work; challenge generation occurs only after acknowledged reservation, never before. Once options or completion have committed, retries cannot reconstruct them. A current session is still required for disclosure, so logout/withdrawal denies old-session retries. This native profile is not HTTP/reference integration or browser interoperability proof.

Current-passkey-session label management

NewSessionManagementService explicitly enables label rename under a real current passkey session, without password configuration or a separately issued reauthentication proof. Supply SessionManagementConfig with the existing protocol, passkey admission profile, session validation/repository, request-key, coordinator, authorization, protected risk and clock owners. Configuration is frozen; the borrowed pool and collaborators must outlive calls. Each call has the protocol's bounded 1ms–5s budget. Install the existing mapping, signin-context and metadata histories plus the selected request-key/session/MFA/risk/audit/ outbox histories; this profile adds no migration or parallel proof store.

  1. Read safe credential references and positive metadata versions through InventoryService under the current session.
  2. Call UpdateOptions with passkey.SessionUpdateOptionsRequest: actual session custody, a self-user identity.passkey.update authorization context, target reference/version, intended label, trusted origin/network and one original idempotency key. Transfer the returned genuine assertion options once. They require fresh UV from the session's authenticating credential.
  3. Complete the authenticator response through Update with passkey.SessionUpdateCompletion, preserving that original request and ceremony ID but using a distinct completion idempotency key. Both phases occupy the same protected update namespace, so one key cannot represent both request bodies. The native owner verifies the actual assertion; session freshness timestamps or caller-supplied booleans grant no permission.
  4. The sole coordinator atomically consumes the ceremony/counter transition, current directory/session/factor/passkey/policy fences, label metadata CAS, protected mutation counters, audit and rename lifecycle. No new session or reusable proof is issued; inventory and subsequent signin keep working.

Select bearer or cookie transport in configuration. Cookie selection requires retained original CSRF keys and each request's actual synchronizer token; bearer selection accepts no CSRF material. An assertion cannot move to a sibling session, target/version/label, RP, origin or network. A matching retry requires current authenticated custody and returns the original receipt only, never another challenge, assertion, secret or mutation. After an uncertain COMMIT, retry the same original request/key: recovery classifies the original outcome without re-executing it. A different request needs a different key.

This native profile does not expose HTTP endpoints, implement browser UI or certify authenticator/browser interoperability. Existing password-proof rename remains supported. Additional enrollment is selected separately above; passkey-only deletion/recovery and MFA/organization variants remain required.

Conditional assertion option generation

ConditionalAuthenticationOptions and KeyedConditionalAuthenticationOptions explicitly select conditional browser presentation of the existing identifier-free assertion. Both require the existing risk owner's PasskeyDiscovery policy opt-in; keyed options also require OptionsRequests. They accept the existing discoverable requests and return root-owned conditional options. No synthetic identifier, separate ceremony/history, secondary verifier, new policy flag or fallback is introduced.

The protocol interpretation follows WebAuthn Level 3, CR 26 May 2026, §5.1.4: conditional mediation selects browser presentation on the outer request, not a different signed assertion or server verification protocol. TransferJSON reveals {mediation:"conditional",publicKey:...} once and preserves the entire native publicKey, including required UV and no account allowlist. A browser consumer checks conditional-mediation availability, deserializes publicKey with PublicKeyCredential.parseRequestOptionsFromJSON (or an equivalent supported decoder), and calls navigator.credentials.get with the explicit outer mediation. Browser capability checks, HTML autofill and actual UI remain the consumer's responsibility; no browser interoperability is certified here.

Complete the returned genuine assertion through DiscoverableSignin and read original rate metadata through DiscoverableSigninRateSource. Original flow/cookie, tenant/RP, current identity/risk, expiry and remember policy remain unchanged. An open browser conditional request does not extend server expiry. The backend cannot authenticate which browser mediation was used. Conditional and ordinary discoverable presentations intentionally share one keyed command: matching retries, including switches between those presentations, recover only original metadata, never a replacement challenge. Identified signin remains a distinct immutable admission and cannot reuse that key or ceremony. Ambiguous options/completion retain existing metadata-only recovery without new secrets.

Focused native PostgreSQL tests exercise conditional options through actual signed assertion verification, session read and logout for browser-only and persistent choices, plus policy/UV/expiry denial and replay. HTTP/Reference composition and real browser/platform/roaming-authenticator proof remain separate qualification boundaries.

Explicit passkey-first signup

NewSignupService selects a fixed tenant/RP's resident-required, UV-required, none-attestation registration in the selected ES256/Ed25519 profile without an email or password. It exposes no HTTP routes. Supply the real protocol, kernel coordinator, authorization, session, protected risk and counter configuration; use the public dependency baselines pinned in this module. Flow.Action is identity.passkey.register-verify. The registration counter policy remains CredentialMutation: five attempts per fifteen minutes with transaction-owned denial, projected onto the actual tenant/browser flow/network/device.

  1. PrepareFlow -> IssueFlow uses the session owner's original cookie, origin, expiry and remember choice. Neither step authenticates a user.
  2. RegistrationOptions commits genuine protocol options and prospective intent only. It creates no account, stable handle, credential or auth session.
  3. Signup verifies the original authenticator and atomically creates the user, initial passkey reference, protocol credential, RP-wide mapping, known-empty MFA generation, authorization authority and session/family/issuance. Required credential, user.created.v1 and session.created.v1 events share that Work.
  4. Only the new acknowledged winner receives bearer/CSRF custody. The common passkey session reader and cookie logout work for that new account, and its passkey can sign in again through the selected identifier-free signin API. Consumer authorization must admit that actual new account, not only seed users.

Install the common kernel/credential/directory histories and selected kernel registration/acceptance/passkey-registration suffixes, protocol registration history (including protocol migration4), MFA's passkey-signup suffix, session issuance/pre-auth/CSRF and selected passkey-signup purpose suffix, and the risk owner's passkey-signup counter suffix. Each owner retains its own migration history. Append SignupMigrationSource at the next unused native slot after mapping history; mapping1/signin2/metadata3 installations select4. Unselected signin/metadata histories are not signup bootstrap dependencies. Do not rewrite old SQL or run optional purpose suffixes out of their selected order. Real three-event-capable audit/outbox owners are required, not application stubs.

OptionsRequests is separately opt-in. Configure NewOptionsRequestConfig and the existing kernel request-key history, then call KeyedRegistrationOptions with root passkey.KeyedSignupOptionsRequest. Leave CommandID empty and retain the exact key/browser/input. Its trusted service caller addresses the original identity.anonymous-flow. The existing request-key owner allocates one command; matching retries return only its metadata, including after flow expiry or consumption. Another key cannot bypass original expiry. No second request journal or challenge reconstruction is introduced.

Retain original commands and browser custody across ambiguous outcomes. RecoverRegistrationOptions(request, caller) and RecoverSignup(request, ceremonyID, caller) require the original cookie/origin and current coordinator query policy. The native owner reads the original credential reference; consumers need no private SQL. Recovery does not require live flow or current account epochs, renew freshness, repeat registration or redeliver authentication. Retain original flow records and their lookup key while supporting this metadata recovery. Account/session administration remains separate from historical outcome disclosure.

For a disposable PostgreSQL test cluster with the documented test-role privileges, the executable native journey and failure/recovery checks are:

go test -tags=integration -race -count=1 \
  -run '^(TestPasskeySignup|TestKeyedPasskeySignup)' .

Set IDENTITY_POSTGRES_TEST_DSN to that isolated cluster, never an existing application database. Tests create/drop their own databases and audit roles. Reference/HTTP composition, conditional option presentation and passkey-session management are distinct profiles; signup alone does not claim them or full M16.

NewDeletionService selects native self-user removal under the existing single-factor password-session profile. DeletionConfig.ManagementConfig supplies the fixed tenant/RP, password reader, original-key, policy and risk owners, but its concrete action source must select exactly identity.passkey.delete. Recovery must be the password owner's concrete NewPasskeyRemovalRecoverySource backed by a full configured native emailed password-reset request/completion service on the same primary, session schema, account realm and policy. Another passkey, a boolean or directory metadata without matching usable password material and verified recovery email is not a replacement. Unknown or missing current factor/recovery authority denies.

Use the dependency baselines pinned in this module's go.mod. Append the password-owned PasskeyDeletionReauthenticationMigrationSource after every installed selected proof suffix; do not replace or reorder that history. For mapping1/signin2/metadata3 and enrollment-proof11/management-proof12, deletion proof13 is the next selected fixture suffix. Allocate the next unused version for other installed histories. The existing kernel request-key and mapping/metadata histories remain required; this adapter adds no new journal, protocol store or removal migration.

Delete accepts root passkey.DeleteRequest: a safe List reference and observed management metadata version, genuine original session/action/CSRF custody and exact IdempotencyKey. Leave incoming command, record and target overrides empty. Unlike the historical repeat/raw-credential catalog shape, this selected native profile admits one server-allocated original key before preparation. Reference, protocol and management versions are independent: deletion fences all three, while the canonical identity.passkey.remove_credential receipt and lifecycle advance the reference version, not ExpectedVersion.

Fresh commitment atomically consumes the proof, checks usable recovery and removes protocol verification material. It disables the reserved reference, advances its version and mapping metadata, increments the RP/user passkey generation and persists required audit/outbox effects. Removed mappings disappear from inventory before pagination; IDs and handles remain reserved to prevent resurrection. The shared passkey generation denies previously issued RP/user passkey sessions on their next authoritative comparison. User-wide credential epochs and the independent password session remain unchanged. No authenticator-local credential erasure is claimed.

DeleteResult contains only command durability metadata. Preserve identical key/input and original password-session custody on retry, including after proof expiry or consumption. Matching retries recover the original receipt without rechecking recovery, consuming another proof, repeating removal or projecting credentials. Revoked/expired original sessions cannot disclose it. Unknown COMMIT acknowledgement is not rollback; retain the original key and command. This API does not enable passkey-session management, passkey-first signup, conditional option presentation, HTTP composition or complete platform qualification.

MigrationSource installs only identity-facing RP bindings, stable opaque handles, credential references, labels and original enrollment admission context. The latter retains the options phase's session and authority generations; it does not copy a challenge, protocol ceremony, consumption state or command journal. Install the public identity kernel and credential-reference histories first. WebAuthn owns its separate protocol history; MFA owns factor authority. Never copy their tables into this adapter.

NewSessionAuthority borrows the primary pool and a trusted fixed tenant, RP namespace, RP ID and bounded duration. Select the same authority in native session issuance, reads and revocation. It checks the original active mapping and known-empty MFA generation, not merely absence of a second-factor record. Missing, revoked, compromised, mismatched and newer authority denies.

The same SessionAuthority separately implements the session owner's MFAPasskeySessionAuthority for completed UV-passkey plus TOTP records. ObserveMFAPasskeySession checks only the original native RP, handle generation and active credential reference/version. Its bounded mapping observation has no factor version: the native MFA owner independently checks the exact confirmed enrollment and factor generation. Projecting completed-session metadata does not authenticate an assertion or TOTP, issue a session or grant mapping authority. Kernel credential eligibility (including disabled references) remains the session/MFA consumer's independent responsibility.

RequireMFAPasskeySession accepts only the original live registered native TOTP-completion or self-session-revoke-one invocation. The completion owner independently binds the exact frozen subject and stored session, including its final check; the mapping adapter preserves the original anonymous command rather than substituting a user-scoped Work. The caller must hold its actual factor fence before the RP/handle/credential mapping locks, as in native signin and enrollment. It must repeat the check before commit and abort on every error. Neither MFA method initializes authority, verifies a factor, retains Work or widens the legacy known-empty-factor methods.

Reads begin their immutable twenty-second window before contributing IO. Protected checks use the original registered coordinator Work, with factor locks before mapping locks. Every error must abort that Work; this adapter does not claim to poison a transaction when its caller ignores a returned error.

NewEnrollmentService selects existing-account enrollment with known-empty MFA, resident-required UV/none with the selected ES256/Ed25519 policy and separate genuine signed fresh action proofs for options and completion. Configure the actual native password action sources and protected risk owner; no boolean freshness, private store or fake verifier is accepted. The browser receives options only after commit. Completion atomically consumes the original proof/ceremony and persists the protocol credential, kernel reference, mapping, identity.passkey.create_credential audit and lifecycle. Newer account/factor/mapping authority or another original session cannot rebase an existing ceremony. Errors must abort the sole Work. The total duration is at most five seconds. Policy callbacks run before Work, not while holding mapping/proof locks; the original authorization generation remains fenced through commit. Policy versions must match coordinator admission. Enrollment accepts up to 100 existing exclusion descriptors in this selected protocol profile. That options bound does not cap usable signin credentials: adding the 101st passkey cannot disable the existing or newly enrolled keys.

Transport-facing data types are owned by root go-passkey; existing names in this adapter remain exact aliases, not wrappers. Native method signatures and existing field/diagnostic/serialization behavior are unchanged. Reflection now reports their root defining package. No pool, SQL or native configuration has moved into the neutral module.

RegistrationRateSource, SigninRateSource, DiscoverableSigninRateSource and SignupRateSource authenticate original source custody and return sensitive original rate metadata only. Supply genuine completion phase's session/action proof for registration, or the original browser cookie, flow and exact identified/identifier-free mode for signin. The retained native admission must match the original committed ceremony and trusted deployment. Signup reads require the original live signup cookie/flow, configured origin, current directory generations, canonical prospective registration context and matching native create ceremony. They return only the original anonymous flow, ceremony ID and immutable five-minute policy lifetime, never the prospective user or handle. Device/network remain bounded trusted ingress, not additional original-flow authentication factors. No risk admission, command, challenge, proof, account or session is created or consumed. Signup still revalidates all current authority and consumes the original flow/ceremony atomically. Identified metadata returns the exact original canonical identifier even when its original account lookup was suppressed; it never projects account eligibility or a resolved user. Identifier-free metadata returns only its original anonymous flow dimension. These reads do no account lookup, risk admission, proof consumption, challenge transfer or session issuance. Identified options created by NewMFASigninService retain that exact selected MFA profile and custody binding for rate reads as well as completion. Reading them through the default or a differently configured MFA service denies; an enrolled and a suppressed account expose the same identifier-only dimensions.

The original ceremony policy lifetime is fixed; a read never renews its expiry. Malformed, foreign, expired or wrong-mode custody returns no dimensions. Historical consumed metadata may remain readable while original custody and time remain valid. It is not a validity lease or permission to execute: completion independently repeats current authority checks and atomically consumes proof/flow/ceremony in the existing coordinator Work. A metadata read cannot permit a repeated mutation, challenge or authentication reveal.

RecoverEnrollment uses the existing coordinator and current disclosure policy to read or reconcile the original command. It returns historical metadata only, never another challenge, verified credential, token or permission to replay. An unavailable COMMIT acknowledgment is not rollback. Retain original command and caller scope; do not mint a new operation to retry an ambiguous mutation.

For keyed HTTP or native options admission, construct OptionsRequestConfig with NewOptionsRequestConfig, the kernel's RequestKeyConfig, and dedicated independent session.DigestKey/session.CSRFKey values used only for original input correlation. Configure it as EnrollmentConfig.OptionsRequests and/or SigninConfig.OptionsRequests. Install the kernel's public RequestKeyMigrationSource after the installed kernel history; this adapter does not add another journal or correlation table. Keep namespace and digest keys fixed while original mappings are retained. The kernel retains immutable mappings without expiry; changing keys fails closed instead of silently issuing a replacement challenge.

Call KeyedRegistrationOptions, KeyedAuthenticationOptions or KeyedDiscoverableAuthenticationOptions with the matching typed request and the exact identity.IdempotencyKey. Leave its native CommandID empty (and registration's RecordID empty); the request-key owner allocates one random original command. Preserve the original session/proof/CSRF or flow/cookie and all operation input on retries. A fresh acknowledged winner has committed Receipt metadata and reveal-once Options. Matching replays have that same CommandID, Replayed=true, and metadata only, including after proof/flow consumption. Pending metadata returns identity.InProgressError; an unresolved outcome returns identity.UnknownCommitError. No error or replay permits a challenge transfer or new authentication. A zero receipt establishes no command outcome; retry the same key/input rather than minting a replacement.

Current coordinator admission and query policies authorize metadata separately from native execution. Enrollment retains trusted authenticated self-user attribution; signin retains the configured service actor and exact browser possession. Signin metadata policy uses identity.anonymous-flow/FlowID, the kernel query owner's required resource, while native execution uses identity.preauth. The request-key owner independently requires identity.request-admission with the canonical options operation ID. The adapter selects only that resource for the admission decision, not a new actor or authorization service. Existing keyless methods and one-use completion methods retain their prior contracts.

NewInventoryService composes an explicitly selected native password or passkey session reader, self-user authorization and the existing risk safe-read counters. List returns at most 100 safe metadata rows, with an exclusive reference-ID cursor; an owner failure returns no partial page. AAGUID and backup flags come from the protocol owner, not another key/counter store. Raw credential IDs, handles, keys, counters and authentication custody are never exported.

NewManagementService selects self-user label rename with a genuine fresh signed identity.passkey.update action proof. Configure its concrete password session reader, exact proof source/audience, trusted tenant/RP, existing risk owner and coordinator admission/query policies. Install the password owner's PasskeyManagementReauthenticationMigrationSource after the complete installed passkey enrollment proof history, the kernel's request-key history and this adapter's explicitly allocated MetadataVersionMigrationSource before enabling it or using updated inventory. Preserve mapping MigrationSource version1 and any installed SigninMigrationSource version2 unchanged; append metadata at the actual next free slot (version3 for that history), never reuse signin's slot. The forward suffix adds metadata_version, backfilling existing records to one. Safe inventory Version is now this metadata CAS, not the kernel credential-reference fence. Protocol credential bytes, counters and authenticating reference versions do not change when a label changes; old signin consumers remain compatible. Old inventory readers can return stale versions after a rename and must be upgraded to obtain the current metadata version.

Call Update with root passkey.UpdateRequest, the safe inventory ReferenceID, positive ExpectedVersion, a 1..128-byte UTF-8 label, exact typed IdempotencyKey and trusted bounded Network dimension. Leave Primary.CommandID and RecordID empty: the existing request-key owner allocates and binds the original command before proof preparation. This native keyed profile does not accept a second caller-selected command or a raw WebAuthn credential ID. Keep request namespace, dedicated token/CSRF digest keys and all original input fixed across retries. Matching retries authenticate the original current self session, retain the original command and return historical receipt metadata only, even after proof consumption or expiry. Another key cannot reuse a consumed/expired proof.

One sole Work consumes the signed proof, fences current session/account/factor, authorization and exact RP credential ownership, charges owned mutation risk, CAS-updates label/metadata version and persists required identity.passkey.rename_credential audit/outbox effects. A concurrent stale version cannot overwrite the winner. Only a fresh acknowledged commit returns Credential; every replay/unknown returns no updated credential projection. An unavailable commit acknowledgment is not rollback: retry the exact original key/input to use the existing coordinator's retained receipt/recovery policy. Changed or contradictory recovery evidence stays unknown, never reconstructed as success from current label state. This API does not delete a credential or alter recovery eligibility and does not expose HTTP routes.

NewSigninService composes UV login in the selected ES256/Ed25519 profile. First use PrepareFlow and IssueFlow to retain the real session-owned browser cookie and remember choice; then pass that original flow to AuthenticationOptions and Signin. Trusted configuration fixes tenant, RP, origin, policy and ingress service actor. Options use the actual WebAuthn resident-discovery ceremony and expose no account-specific user handle or credential descriptors. Eligible, absent, unverified and no-passkey identifiers receive the same public options profile. The original optional account snapshot and keyed identifier binding remain private; a suppressed snapshot cannot later become authenticating. Completion still requires that original email and unchanged identity/factor/policy epochs to match the real root-verified credential. These identified methods retain their original admission contract and do not claim constant-time execution.

For explicit identifier-free resident login, enable risk.PolicyConfig's PasskeyDiscovery at trusted startup in the actual durable PostgreSQL risk composition, then call DiscoverableAuthenticationOptions and DiscoverableSignin with the identifier-free request/completion types. Reuse PrepareFlow/IssueFlow; the original cookie, remember choice and absolute expiry remain authoritative. Options neither select nor require an account, user handle, email or credential descriptor. Risk counts the real anonymous tenant/network/device dimensions without fabricating an identifier. Missing opt-in fails closed. After genuine cryptographic credential/handle verification, native mapping and public identity/MFA/policy owners admit the current target; its captured epochs are fenced through commit. Existing identified or suppressed ceremonies cannot be promoted into this mode, and discoverable ceremonies cannot switch into identified completion. Conditional presentation uses this same discovery admission and completion, not a new server mode. This profile adds no signup, browser UI or secondary-MFA fallback.

The genuine protocol verifier alone admits the assertion. Ceremony consumption, counter/backup transition, mapping last-use, original browser-flow consumption and new session/audit/lifecycle effects share the existing coordinator Work. Do not call options again to retry an ambiguous command. RecoverSignin returns historical outcome metadata only, never a replacement credential or challenge. Append SigninMigrationSource and the session owner's selected issuance, preauthentication, CSRF and passkey suffixes to actual installed histories. The original browser-flow expiry is checked again at primary precommit time after later effects. A genuine synced-counter warning is exposed as SigninResult.CounterRisk, not falsely turned into account compromise; non-backup positive-counter regressions are denied by WebAuthn itself.

Use NewSessionAuthority with the session owner's NewPasskeySessionService to read the issued credential. For browser logout, select that same authority in NewCookieRevokeOneExecutor, retain current caller admission with PrepareRevokeOneWithCSRF, and invoke ExecuteRevokeOneWithCSRF. Legacy direct dispatch intentionally denies cookie requests. Missing/wrong synchronizer custody cannot revoke or clear a session.

Native integration tests cover genuine action-proof/UV enrollment, real owner constraints, denial, contention, required-effect rollback and actual before/after-COMMIT connection loss. Existing active session rows are explicit fixture input, not evidence of signup/signin provenance. Full release qualification and complete platform composition remain separate obligations; this adapter is not a UI or a complete identity platform by itself.

Credential management after passkey/TOTP signin

InventoryConfig.MFAPasskey explicitly adds the native session owner's completed passkey/TOTP admission alongside Passkey. Supply its matching trusted profile and native mapping authority. Both selections share the Passkey repository and validation configuration, and stored provenance selects exactly one reader. There is no retry through another method after denial. Password inventory cannot also select this extension; omitted MFA admission retains prior behavior.

For fresh UV label rename, set SessionManagementConfig.TOTP to true. This selects completed passkey/TOTP sessions instead of known-empty sessions; it is not a secondary-factor fallback. Use the existing UpdateOptions and Update APIs with original request keys, exact CSRF where selected, and a genuine new WebAuthn assertion bound to the intended target/version/label and source session. The original confirmed factor ID, enrollment and account generation remain current alongside credential/directory/policy, RP mapping and session authority. Factor locks precede mapping locks. Neither inventory nor management consumes a TOTP, adopts a newer generation or resets positive authority evidence freshness.

Install the existing completed-passkey/MFA session, confirmed TOTP, mapping, metadata, request-key and protocol histories before selecting this profile. These additions create no new migration or private proof/session engine. Retries preserve the original outcome without another challenge or credential redisclosure. Set SessionEnrollmentConfig.TOTP to true independently to add another key through the existing three-phase enrollment API. The current key's fresh action-bound UV authorizes registration, not a signin assertion or reusable proof. Original confirmed TOTP, credential/session and assertion expiry remain fenced in each phase and final checks; the new key does not bypass account MFA. Set SessionDeletionConfig.TOTP separately to remove a key through the existing DeleteOptions, Delete and metadata-only RecoverDelete APIs. It requires fresh action-bound UV and another independently usable resident key, and fences the original confirmed factor/enrollment in Apply and final checks. Removal advances native passkey authority, invalidating prior sessions. Sign in with the surviving key and complete TOTP before recovering the original removal metadata; the removed generation cannot regain disclosure authority. This profile creates no additional mapping, session or replay store. OTP/recovery-code primary completion and organization-session profiles remain excluded.

Documentation

Overview

Package postgres composes durable identity-facing passkey mappings. It does not own WebAuthn ceremonies, cryptographic credentials, counters or sessions.

Index

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) Format

func (DeletionConfig) Format(s fmt.State, _ rune)

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

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) Format

func (DeletionService) Format(s fmt.State, _ rune)

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.

func (EnrollmentConfig) Format

func (EnrollmentConfig) Format(s fmt.State, _ rune)

Format prevents borrowed scope, keys and proof-source diagnostics.

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

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

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

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

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

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.

func (InventoryConfig) Format

func (InventoryConfig) Format(s fmt.State, _ rune)

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) Format

func (InventoryService) Format(s fmt.State, _ rune)

func (*InventoryService) List

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) Format

func (MFAPasskeyPrimary) Format(s fmt.State, _ rune)

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) Format

func (ManagementConfig) Format(s fmt.State, _ rune)

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) Format

func (ManagementService) Format(s fmt.State, _ rune)

func (ManagementService) MarshalJSON

func (ManagementService) MarshalJSON() ([]byte, error)

func (ManagementService) MarshalText

func (ManagementService) MarshalText() ([]byte, error)

func (*ManagementService) Update

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

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

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) Format

func (OptionsRequestConfig) Format(s fmt.State, _ rune)

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.

func (SessionAuthorityConfig) Format

func (SessionAuthorityConfig) Format(s fmt.State, _ rune)

Format hides deployment/identity correlation in ordinary diagnostics.

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

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

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

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

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

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

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

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

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) Format

func (SigninConfig) Format(s fmt.State, _ rune)

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) Format

func (SigninMFAConfig) Format(s fmt.State, _ rune)

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

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

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

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) Format

func (SigninService) Format(s fmt.State, _ rune)

func (*SigninService) IssueFlow

IssueFlow commits the original session-owned browser flow and reveal-once cookie. It authenticates nobody and returns no session credential.

func (*SigninService) KeyedAuthenticationOptions

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

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

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

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

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

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

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

IssueFlow commits only the original unauthenticated browser flow/cookie.

func (*SignupService) KeyedRegistrationOptions

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

PrepareFlow delegates original entropy/time/remember custody to the session owner. Retain the preparation unchanged for IssueFlow; do not prepare retries.

func (*SignupService) RecoverRegistrationOptions

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

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

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL