validateAndExtractNonceAndSession

suspend fun validateAndExtractNonceAndSession(assertion: AssertionRpcAuth, target: String, method: String, payload: Bstr, timeout: Duration = 10.minutes): RpcNonceAndSession

Validates an RPC authorization assertion and extracts the nonce and session.

Return

RpcNonceAndSession containing the next nonce and session ID.

Parameters

assertion

the authorization assertion to validate.

target

RPC target endpoint.

method

RPC method name.

payload

payload CBOR bstr.

timeout

authorization validity timeout.

Throws

if payload hash mismatch, target/method mismatch, or message expired.

if a fresh nonce must be issued.


suspend fun validateAndExtractNonceAndSession(assertion: AssertionRpcAuth, target: String, method: String, payload: Bstr, timeout: Duration, nonceChecker: suspend (clientId: String, nonce: ByteString, expiration: Instant) -> RpcNonceAndSession): RpcNonceAndSession

Validates an RPC authorization assertion and extracts the nonce and session using a custom nonce checker.

Return

RpcNonceAndSession containing the next nonce and session ID.

Parameters

assertion

the authorization assertion to validate.

target

RPC target endpoint.

method

RPC method name.

payload

payload CBOR bstr.

timeout

authorization validity timeout.

nonceChecker

lambda to check and advance the nonce.

Throws

if payload hash mismatch, target/method mismatch, or message expired.

if a fresh nonce must be issued.