sig_auth v0.1.0 SigAuth.CredentialServer behaviour

This module represents the contract that every Credential Server must adhere to. These methods are used by the SigAuth.Plug module to streamline request authentication and nonce maintenince.

During each request, the plug will first request the public key from the credential server, calling get_public_key(username). The plug will then ask the credential server to validate the submitted nonce, calling nonce_valid(username, nonce). If the signature is valid, then the plug will notify the credential server by calling update_nonce(username, integer).

At each of these steps, a failure will abort the rest of the chain and deny the authorization request.

Summary

Callbacks

get_public_key(binary)
get_public_key(binary) :: {:error, atom} | {:ok, any}
nonce_valid?(binary, integer)
nonce_valid?(binary, integer) :: true | false
update_nonce(binary, integer)
update_nonce(binary, integer) :: {:error, atom} | :ok