Documentation ¶
Index ¶
- Constants
- Variables
- type Keeper
- func (k Keeper) DeleteGrant(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, ...) error
- func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs []sdk.Msg) ([][]byte, error)
- func (k Keeper) Exec(goCtx context.Context, msg *authz.MsgExec) (*authz.MsgExecResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *authz.GenesisState
- func (k Keeper) GetAuthorizations(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress) (authorizations []authz.Authorization)
- func (k Keeper) GetCleanAuthorization(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, ...) (cap authz.Authorization, expiration time.Time)
- func (k Keeper) Grant(goCtx context.Context, msg *authz.MsgGrant) (*authz.MsgGrantResponse, error)
- func (k Keeper) GranteeGrants(c context.Context, req *authz.QueryGranteeGrantsRequest) (*authz.QueryGranteeGrantsResponse, error)
- func (k Keeper) GranterGrants(c context.Context, req *authz.QueryGranterGrantsRequest) (*authz.QueryGranterGrantsResponse, error)
- func (k Keeper) Grants(c context.Context, req *authz.QueryGrantsRequest) (*authz.QueryGrantsResponse, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, data *authz.GenesisState)
- func (k Keeper) IterateGrants(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Revoke(goCtx context.Context, msg *authz.MsgRevoke) (*authz.MsgRevokeResponse, error)
- func (k Keeper) SaveGrant(ctx sdk.Context, grantee, granter sdk.AccAddress, ...) error
Constants ¶
const StoreKey = authz.ModuleName
StoreKey is the store key string for authz
Variables ¶
var (
GrantKey = []byte{0x01} // prefix for each key
)
Keys for store prefixes
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(storeKey sdk.StoreKey, cdc codec.BinaryCodec, router *baseapp.MsgServiceRouter) Keeper
NewKeeper constructs a message authorization Keeper
func (Keeper) DeleteGrant ¶
func (k Keeper) DeleteGrant(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) error
DeleteGrant revokes any authorization for the provided message type granted to the grantee by the granter.
func (Keeper) DispatchActions ¶
func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs []sdk.Msg) ([][]byte, error)
DispatchActions attempts to execute the provided messages via authorization grants from the message signer to the grantee.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *authz.GenesisState
ExportGenesis returns a GenesisState for a given context.
func (Keeper) GetAuthorizations ¶
func (k Keeper) GetAuthorizations(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress) (authorizations []authz.Authorization)
GetAuthorizations Returns list of `Authorizations` granted to the grantee by the granter.
func (Keeper) GetCleanAuthorization ¶
func (k Keeper) GetCleanAuthorization(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) (cap authz.Authorization, expiration time.Time)
GetCleanAuthorization returns an `Authorization` and it's expiration time for (grantee, granter, message name) grant. If there is no grant `nil` is returned. If the grant is expired, the grant is revoked, removed from the storage, and `nil` is returned.
func (Keeper) Grant ¶
GrantAuthorization implements the MsgServer.Grant method to create a new grant.
func (Keeper) GranteeGrants ¶
func (k Keeper) GranteeGrants(c context.Context, req *authz.QueryGranteeGrantsRequest) (*authz.QueryGranteeGrantsResponse, error)
GranteeGrants implements the Query/GranteeGrants gRPC method.
func (Keeper) GranterGrants ¶
func (k Keeper) GranterGrants(c context.Context, req *authz.QueryGranterGrantsRequest) (*authz.QueryGranterGrantsResponse, error)
GranterGrants implements the Query/GranterGrants gRPC method.
func (Keeper) Grants ¶
func (k Keeper) Grants(c context.Context, req *authz.QueryGrantsRequest) (*authz.QueryGrantsResponse, error)
Authorizations implements the Query/Grants gRPC method.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *authz.GenesisState)
InitGenesis new authz genesis
func (Keeper) IterateGrants ¶
func (k Keeper) IterateGrants(ctx sdk.Context, handler func(granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress, grant authz.Grant) bool)
IterateGrants iterates over all authorization grants This function should be used with caution because it can involve significant IO operations. It should not be used in query or msg services without charging additional gas.
func (Keeper) Revoke ¶
func (k Keeper) Revoke(goCtx context.Context, msg *authz.MsgRevoke) (*authz.MsgRevokeResponse, error)
RevokeAuthorization implements the MsgServer.Revoke method.
func (Keeper) SaveGrant ¶
func (k Keeper) SaveGrant(ctx sdk.Context, grantee, granter sdk.AccAddress, authorization authz.Authorization, expiration time.Time) error
SaveGrant method grants the provided authorization to the grantee on the granter's account with the provided expiration time. If there is an existing authorization grant for the same `sdk.Msg` type, this grant overwrites that.