View Source Electric.Client.Authenticator behaviour (Electric Client v0.2.1)
Behaviour to authenticate a Electric.Client.Fetch.Request
.
The assumption here is that authentication is per
ShapeDefinition
not per request.
Summary
Callbacks
Update the given Request
struct with authentication headers.
Get authentication headers for the given ShapeDefinition
Types
@type headers() :: Electric.Client.Fetch.Request.headers()
Callbacks
@callback authenticate_request(Electric.Client.Fetch.Request.t(), config :: term()) :: Electric.Client.Fetch.Request.authenticated()
Update the given Request
struct with authentication headers.
Independent of the actual authentication mechanism, implementations of this
Behaviour MUST set the authenticated
field in the Request
to true
.
@callback authenticate_shape(Electric.Client.ShapeDefinition.t(), config :: term()) :: headers()
Get authentication headers for the given ShapeDefinition