Strict, bounded projection of OAuth token endpoint responses.
Unknown members and identity tokens are discarded immediately. Only a valid bearer access token, optional authorized refresh token, bounded expiry, and exact scope set can enter private grant state.
Summary
Types
@type grant_projection() :: %{ :access_token => binary(), :token_type => :bearer, :expires_in_ms => pos_integer() | nil, :granted_scopes => PtcRunner.Kernel.MCPOAuth.Scope.scope_set(), optional(:refresh_token) => binary() }
Functions
@spec error(non_neg_integer(), [{binary(), binary()}], binary()) :: {:ok, binary()} | {:error, :invalid_token_response}
@spec success(non_neg_integer(), [{binary(), binary()}], binary(), keyword()) :: {:ok, grant_projection()} | {:error, :invalid_token_response}