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

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).

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.

Types

resolvable()

@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

t()

@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()
}

Functions

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

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

Basic changeset.

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

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

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

named_binding()

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

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

preload(query \\ named_binding(), named_binding_or_bindings)

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

Preload named bindings. Automatically joins using resolve_binding/2.

resolve_binding(query, named_binding)

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