Small, auditable OAuth authorization-code primitives owned by PtcRunner.
State and PKCE verifiers are generated independently from 32 random bytes and encoded as 43-byte unpadded Base64URL values. Endpoint construction retains unrelated query bytes exactly and rejects malformed or colliding pre-existing parameters before appending PtcRunner-owned form values.
Summary
Functions
Validates an authorization endpoint without appending parameters.
Appends authorization parameters while retaining unrelated endpoint query bytes and order.
Constructs RFC 6749 client_secret_basic from independently form-encoded values.
Encodes ordered OAuth form parameters deterministically.
Generates independent state and S256 PKCE material.
Builds the exact unpadded S256 challenge for a validated verifier.
Compares two bounded state values without content-dependent early exit.
Validates a token endpoint's retained query against token form names.
Returns whether a verifier has the RFC 7636 unreserved grammar.
Types
Functions
@spec authorization_endpoint( binary(), keyword() ) :: {:ok, binary()} | {:error, :invalid_endpoint}
Validates an authorization endpoint without appending parameters.
@spec authorization_url(binary(), [{binary(), binary()}], keyword()) :: {:ok, binary()} | {:error, :invalid_endpoint | :invalid_parameters}
Appends authorization parameters while retaining unrelated endpoint query bytes and order.
@spec client_secret_basic(binary(), binary()) :: {:ok, binary()} | {:error, :invalid_client_credentials}
Constructs RFC 6749 client_secret_basic from independently form-encoded values.
Encodes ordered OAuth form parameters deterministically.
@spec new_flow() :: flow()
Generates independent state and S256 PKCE material.
Builds the exact unpadded S256 challenge for a validated verifier.
Compares two bounded state values without content-dependent early exit.
Validates a token endpoint's retained query against token form names.
The returned endpoint is byte-identical because token parameters belong in the POST form body.
Returns whether a verifier has the RFC 7636 unreserved grammar.