Israeli Bank Importer - v1.44.5
    Preparing search index...

    Class AppAuthCodes

    In-process registry of pending authorization codes. Deliberately not persisted: a code outlives neither a restart nor its 60-second window, and writing one to disk would put a bearer-equivalent secret at rest.

    Index
    • get size(): number

      How many codes are currently tracked. Exposed for tests and diagnostics; the codes themselves are never enumerated.

      Returns number

      Count of pending and recently redeemed codes.

    • Mints a code bound to the PKCE challenge, redirect URI and factors in force at authorize time.

      Parameters

      • input: AuthCodeInput

        Everything known about the authorization at mint time.

      • now: number = ...

        Current epoch milliseconds, injectable for tests.

      Returns IAuthCodeRecord

      The stored record, including its freshly generated code.

    • Redeems a code exactly once.

      A code that was already redeemed stays in the map so this call can report the reuse; the caller reacts by revoking the token family that the first redemption created.

      Parameters

      • code: string

        The code presented at the token endpoint.

      • now: number = ...

        Current epoch milliseconds, injectable for tests.

      Returns Procedure<IAuthCodeRecord>

      Procedure with the record, or a failure naming the reason.

    • Drops every code that can no longer be redeemed. Used codes are kept until their expiry so reuse remains detectable for the rest of the window.

      Parameters

      • now: number = ...

        Current epoch milliseconds, injectable for tests.

      Returns void

      Nothing.

    • Remembers the token family a redemption created so a later reuse of the same code can revoke everything that redemption handed out.

      Parameters

      • code: string

        The code that was just redeemed.

      • familyId: string

        Family id of the refresh token issued for it.

      Returns void

      Nothing.

    • Looks up the token family a code created.

      Parameters

      • code: string

        The code presented at the token endpoint.

      Returns Procedure<string>

      Procedure with the family id, or a failure when none was bound.