View as Markdown

SDK reference · Rails

@provenanceauth/rails/mandates

@provenanceauth/rails/mandates in the Rails: 4 methods. @provenanceauth/rails/mandates, checking another agent's authority.

Methods

grantHolderJkt

grantHolderJkt(payload: Record<string, unknown>): string | null | "malformed"

The grant's cnf.jkt: null for a bearer grant, "malformed" for a cnf we can't use (fails closed).

holderReason

holderReason(token: string, jkt: string, holder: MandateHolder | undefined, nowMs: number): Promise<MandateReason | null>

The holder check on a bound grant: null when it holds, else the reason.

needFits

needFits(authority: MandateAuthority, need: MandateNeed | undefined): MandateReason | null

Does need fit authority?

verifyMandate

verifyMandate(token: string, opts: { jwks: Jwks; need?: MandateNeed; online?: boolean; apiBase?: string; fetch?: typeof fetch; now?: number; holder?: MandateHolder }): Promise<MandateVerifyResult>

Check another agent's mandate token: signature (our JWKS), expiry, need against its limits, and, with online: true, the keyless status (apiBase is our API, e.g.

Was this page helpful? Send us feedback

LLM? Read llms.txt.