MoneyHub.Scopes (MoneyHub v1.0.0)

Copy Markdown View Source

Known Moneyhub OAuth2 scopes, grouped by purpose.

Scopes are plain strings on the wire (space-delimited in the scope authorisation parameter) - this module exists so call sites can reference MoneyHub.Scopes.accounts_read() instead of repeating "accounts:read" everywhere, and to give a single place documenting what each scope unlocks.

Combine scopes with join/1:

MoneyHub.Scopes.join([
  MoneyHub.Scopes.openid(),
  MoneyHub.Scopes.accounts_read(),
  MoneyHub.Scopes.transactions_read()
])
#=> "openid accounts:read transactions:read"

Bank connection (AIS) scopes

Payment (PIS) scopes

Provider chooser scopes

  • id_api/0 - shows API-based (live) providers in the bank chooser.
  • id_test/0 - shows test/mock providers in the bank chooser.

Identity / widget scopes

Summary

Functions

The minimal scope set for a one-time or ongoing AIS (account aggregation) connection: openid accounts:read transactions:read.

ais/0 plus offline_access, for connections that should be refreshable without the user re-authenticating from scratch.

Joins a list of scopes into the space-delimited string expected by the scope authorisation parameter. Duplicates are removed; order of first appearance is preserved.

The minimal scope set to create and execute a single immediate payment: openid payment payee:create.

Types

t()

@type t() :: String.t()

Functions

accounts_details_read()

@spec accounts_details_read() :: t()

accounts_read()

@spec accounts_read() :: t()

ais()

@spec ais() :: String.t()

The minimal scope set for a one-time or ongoing AIS (account aggregation) connection: openid accounts:read transactions:read.

ais_offline()

@spec ais_offline() :: String.t()

ais/0 plus offline_access, for connections that should be refreshable without the user re-authenticating from scratch.

id_api()

@spec id_api() :: t()

id_test()

@spec id_test() :: t()

join(scopes)

@spec join([t()]) :: String.t()

Joins a list of scopes into the space-delimited string expected by the scope authorisation parameter. Duplicates are removed; order of first appearance is preserved.

offline_access()

@spec offline_access() :: t()

openid()

@spec openid() :: t()

payee_create()

@spec payee_create() :: t()

payment()

@spec payment() :: t()

payments()

@spec payments() :: String.t()

The minimal scope set to create and execute a single immediate payment: openid payment payee:create.

recurring_payment()

@spec recurring_payment() :: t()

standing_order()

@spec standing_order() :: t()

transactions_read()

@spec transactions_read() :: t()

widget_authentication()

@spec widget_authentication() :: t()