Boruta.Oauth.Scope (Boruta core v1.2.0) View Source

Schema defining an independent OAuth scope

Link to this section Summary

Functions

Determines if artifact is authorized to access given scope.

Splits an OAuth scope string into individual scopes as string

Link to this section Types

Specs

t() :: %Boruta.Oauth.Scope{
  id: any(),
  label: String.t(),
  name: String.t(),
  public: boolean()
}

Link to this section Functions

Link to this function

authorized?(against, scope, public_scopes \\ [])

View Source

Specs

authorized?(
  against :: List | Boruta.Oauth.Token.t() | Boruta.Oauth.Client.t(),
  scope :: String.t(),
  public_scopes :: list()
) :: boolean()

Determines if artifact is authorized to access given scope.

Specs

split(oauth_scope :: String.t() | nil) :: [String.t()]

Splits an OAuth scope string into individual scopes as string

Examples

iex> scope("a:scope another:scope")
["a:scope", "another:scope"]