Pleroma v1.1.9-10-g42f76306+dev Pleroma.Web.OAuth.Scopes View Source

Functions for dealing with scopes.

Link to this section Summary

Functions

Fetch scopes from requiest params.

Convert scopes string to list

Convert scopes list to string

Validates scopes.

Link to this section Functions

Link to this function

fetch_scopes(params, default)

View Source
fetch_scopes(map(), list()) :: list()

Fetch scopes from requiest params.

Note: scopes is used by Mastodon — supporting it but sticking to OAuth's standard scope wherever we control it

Link to this function

parse_scopes(scopes, default)

View Source
Link to this function

to_list(str)

View Source
to_list(binary()) :: [binary()]

Convert scopes string to list

Link to this function

to_string(scopes)

View Source
to_string(list()) :: binary()

Convert scopes list to string

Link to this function

validates(scopes, app_scopes)

View Source
validates(list() | nil, list()) ::
  {:ok, list()} | {:error, :missing_scopes | :unsupported_scopes}

Validates scopes.