View Source Electric.Client.Authenticator behaviour (Electric Client v0.2.5)

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

Callbacks

Link to this callback

authenticate_request(t, config)

View Source
@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.

Link to this callback

authenticate_shape(t, config)

View Source
@callback authenticate_shape(Electric.Client.ShapeDefinition.t(), config :: term()) ::
  headers()

Get authentication headers for the given ShapeDefinition