adk_jwt_verifier behaviour (erlang_adk v0.7.0)

View Source

Adapter behaviour for cryptographic JWT verification.

Implementations must validate the signature before returning claims and must never return a token or unredacted provider response in an error.

Summary

Types

claims/0

-type claims() :: #{binary() => term()}.

config/0

-type config() ::
          #{provider := gen_server:server_ref(),
            client_id := binary(),
            signing_algs := [binary(), ...],
            trusted_audiences := [binary()],
            adapter_options => map()}.

error_reason/0

-type error_reason() :: provider_unavailable | invalid_token.

Callbacks

verify/2

-callback verify(Token :: binary(), Config :: config()) -> {ok, claims()} | {error, error_reason()}.