View Source Electric.Client.Authenticator behaviour (Electric Client v0.1.0-dev-6)
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 parameters.
Get authentication params for the given ShapeDefinition
Types
@type params() :: Electric.Client.Fetch.Request.params()
Callbacks
@callback authenticate_request(Electric.Client.Fetch.Request.t(), config :: term()) :: Electric.Client.Fetch.Request.authenticated()
Update the given Request
struct with authentication parameters.
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()) :: params()
Get authentication params for the given ShapeDefinition