Authorisation (authz) on IXO follows the Cosmos SDK's authz module (ADR 30). It lets one account, the granter, give specific privileges to another account, the grantee. IXO adds its own authorisation types for the messages of the Claims module.
Read this page before you grant an agent the right to submit claims, evaluate claims or withdraw payments. It explains how a grant is stored, which authorisation types exist, and the rules to remember when you grant, query and revoke.
This page explains the model and has no code to run. For the messages that grant, execute and revoke, see Manage authz grants and fee allowances.
How a grant is stored
Each authorisation is stored on chain with three key components:
{
"granter": "address",
"grantee": "address",
"msg_type_url": "message_type"
}So there can be only one authorisation for a specific message type between any two accounts. A new authorisation for the same message type between the same accounts overrides the previous one.
Authorisations are implemented with the Authorization interface, which allows the parameters and
limits of a grant to be customised. The most basic implementation is GenericAuthorization, which
gives unlimited rights to execute a specific message type.
Built-in authorisation types
The Cosmos SDK provides three built-in implementations.
| Type | What it allows |
|---|---|
GenericAuthorization | Unlimited rights to execute a specific message type, with no restrictions |
SendAuthorization | Sending tokens within specific limits (amount restrictions), for the /cosmos.bank.v1beta1.MsgSend message type |
StakeAuthorization | Staking-related operations, with specific parameters |
IXO authorisation types for claims
IXO implements custom authorisation types for specific message types.
| Type | Message type | Authorises |
|---|---|---|
SubmitClaimAuthorization | /ixo.claims.v1beta1.MsgSubmitClaim | Submitting claims |
EvaluateClaimAuthorization | /ixo.claims.v1beta1.MsgEvaluateClaim | Evaluating claims |
WithdrawPaymentAuthorization | /ixo.claims.v1beta1.MsgWithdrawPayment | Withdrawing payments |
CreateClaimAuthorization | /ixo.claims.v1beta1.MsgCreateClaimAuthorization | Creating claims |
Constraints are lists
The IXO types hold their constraints as lists, because there can be only one grant between two accounts for a specific message type. For example, if an admin (the granter) wants to give a user (the grantee) the right to submit claims for several collections, all of the constraints must go in a single authorisation.
Rules to remember
- A new grant overrides the old one. A new authorisation for the same message type between the same accounts overrides any existing authorisation, including its constraints.
- Query by message type. To query an authorisation you need the actual message type, for
example
/ixo.claims.v1beta1.MsgSubmitClaim, not the authorisation type. - Revoke by message type. To revoke an authorisation you specify the correct message type URL, not the authorisation type.
Related
The messages that grant, execute and revoke an authorisation.
Claims managementCollections, claims and evaluations.
Emerging Household Energy digital vouchersA solution workflow for voucher issuance, redemption and claim-linked benefit transfer.
Cosmos SDK authz moduleThe upstream reference for the authz module.
(opens in a new tab)