bothy-sdk
    Preparing search index...

    Class InvocationVerifier

    The check of 09 4.5 for one agent; safe for concurrent use (checks run one at a time).

    const verifier = new InvocationVerifier({
    instanceId, agentId,
    jwks: jwksFetcher(api),
    replay: inbox,
    allowlist: triggererLoader(api),
    });
    await verifier.refresh();
    const { verdict, claims } = await verifier.check(token, expectationFor(env.type, env), actual);
    Index

    Constructors

    Accessors

    • get fetches(): number

      How often the JWKS was fetched, forced reloads included.

      Returns number

    • get forcedReloads(): number

      How many fetches an unknown kid caused.

      Returns number

    Methods

    • Reloads the allow list before the next check (on access.changed).

      Returns void

    • Checks a token against the event's payload and the runtime's actual state.

      Parameters

      • token: Secret

        The delivered invocation_token.

      • expect: Expectation

        What the event's payload says (expectationFor).

      • actual: ActualSource

        The actual billing mode and tool class, or a function that returns them for the claims once signature, iss, aud, the payload and the allow list passed (the adapter asks its handler with the verified claims there, so the precedence of the points stays that of the reference).

      Returns Promise<TokenCheck>

      The verdict and, unless the token form, the signature or the payload was refused or the key is unknown, the claims.

      A failure of the JWKS fetcher, of the allow list loader or of actual; the event is then neither accepted nor refused.

    • Fetches the JWKS now, as at adapter start; it counts as a fetch, not a forced reload.

      Returns Promise<void>

      A promise that resolves when the key set is replaced.

      Whatever the fetcher throws, or TypeError for a body that is not a key set.

    • Returns a summary without keys, so the verifier never renders more than its counters.

      Returns Record<string, number>