Boruta core v1.0.0-rc.2 Boruta.Oauth.ResourceOwners behaviour View Source

Resource owner context

Link to this section Summary

Callbacks

Returns a list of authorized scopes for a given resource owner. These scopes will be granted is requested for the user.

Returns a resource owner by (username, password) or (id). Returns nil for non matching results.

Returns true whenever the given resource owner is persisted.

Link to this section Callbacks

Link to this callback

authorized_scopes(resource_owner)

View Source

Specs

authorized_scopes(resource_owner :: struct()) :: [Boruta.Oauth.Scope.t()]

Returns a list of authorized scopes for a given resource owner. These scopes will be granted is requested for the user.

Specs

get_by([username: String.t(), password: String.t()] | [{:id, String.t()}]) ::
  resource_owner :: struct() | nil

Returns a resource owner by (username, password) or (id). Returns nil for non matching results.

Link to this callback

persisted?(resource_owner)

View Source

Specs

persisted?(resource_owner :: struct()) :: boolean()

Returns true whenever the given resource owner is persisted.