View Source MyApp.CharonOauth2.Authorization (CharonOauth2 v0.0.5)

An authorization represents the permission granted by a resource owner (usually a user) to an application to act on their behalf within certain limits (determined by scopes).

Field :scope is guaranteed to be an ordset (:ordsets).

Link to this section Summary

Types

Bindings / preloads that can be used with resolve_binding/2 and preload/2

t()

Functions

Insert-only changeset - some things (should) never change.

Returns a new query with the current module as named binding :charon_oauth2_authorization.

Preload named bindings. Automatically joins using resolve_binding/2.

Resolve named bindings that are not present in the query by (left-)joining to the appropriate tables.

Link to this section Types

@type resolvable() ::
  :resource_owner
  | :resource_owner_grants
  | :client
  | :client_owner
  | :grants
  | :grants_resource_owner

Bindings / preloads that can be used with resolve_binding/2 and preload/2

@type t() :: %MyApp.CharonOauth2.Authorization{
  __meta__: term(),
  client: term(),
  client_id: term(),
  grants: term(),
  id: term(),
  inserted_at: term(),
  resource_owner: term(),
  resource_owner_id: term(),
  scope: term(),
  updated_at: term()
}

Link to this section Functions

Link to this function

changeset(struct_or_cs \\ %__MODULE__{}, params)

View Source
@spec changeset(t() | Ecto.Changeset.t(), map()) :: Ecto.Changeset.t()

Basic changeset.

Link to this function

insert_only_changeset(struct_or_cs \\ %__MODULE__{}, params)

View Source
@spec insert_only_changeset(t() | Ecto.Changeset.t(), map()) :: Ecto.Changeset.t()

Insert-only changeset - some things (should) never change.

@spec named_binding() :: Ecto.Query.t()

Returns a new query with the current module as named binding :charon_oauth2_authorization.

Link to this function

preload(query \\ named_binding(), named_binding_or_bindings)

View Source
@spec preload(Ecto.Query.t(), resolvable() | [resolvable()]) :: Ecto.Query.t()

Preload named bindings. Automatically joins using resolve_binding/2.

Link to this function

resolve_binding(query, named_binding)

View Source
@spec resolve_binding(Ecto.Query.t(), resolvable()) :: Ecto.Query.t()

Resolve named bindings that are not present in the query by (left-)joining to the appropriate tables.