Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) Authorization(c context.Context, req *types.QueryAuthorizationRequest) (*types.QueryAuthorizationResponse, error)
- func (k Keeper) Authorizations(c context.Context, req *types.QueryAuthorizationsRequest) (*types.QueryAuthorizationsResponse, error)
- func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, serviceMsgs []sdk.ServiceMsg) (*sdk.Result, error)
- func (k Keeper) ExecAuthorized(goCtx context.Context, msg *types.MsgExecAuthorizedRequest) (*types.MsgExecAuthorizedResponse, error)
- func (k Keeper) GetAuthorizations(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress) (authorizations []exported.Authorization)
- func (k Keeper) GetOrRevokeAuthorization(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, ...) (cap exported.Authorization, expiration time.Time)
- func (k Keeper) Grant(ctx sdk.Context, grantee, granter sdk.AccAddress, ...) error
- func (k Keeper) GrantAuthorization(goCtx context.Context, msg *types.MsgGrantAuthorizationRequest) (*types.MsgGrantAuthorizationResponse, error)
- func (k Keeper) IterateGrants(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Revoke(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, ...) error
- func (k Keeper) RevokeAuthorization(goCtx context.Context, msg *types.MsgRevokeAuthorizationRequest) (*types.MsgRevokeAuthorizationResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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.BinaryMarshaler, router *baseapp.MsgServiceRouter) Keeper
NewKeeper constructs a message authorization Keeper
func (Keeper) Authorization ¶
func (k Keeper) Authorization(c context.Context, req *types.QueryAuthorizationRequest) (*types.QueryAuthorizationResponse, error)
Authorization implements the Query/Authorization gRPC method.
func (Keeper) Authorizations ¶
func (k Keeper) Authorizations(c context.Context, req *types.QueryAuthorizationsRequest) (*types.QueryAuthorizationsResponse, error)
Authorizations implements the Query/Authorizations gRPC method.
func (Keeper) DispatchActions ¶
func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, serviceMsgs []sdk.ServiceMsg) (*sdk.Result, error)
DispatchActions attempts to execute the provided messages via authorization grants from the message signer to the grantee.
func (Keeper) ExecAuthorized ¶
func (k Keeper) ExecAuthorized(goCtx context.Context, msg *types.MsgExecAuthorizedRequest) (*types.MsgExecAuthorizedResponse, error)
ExecAuthorized implements the MsgServer.ExecAuthorized method.
func (Keeper) GetAuthorizations ¶
func (k Keeper) GetAuthorizations(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress) (authorizations []exported.Authorization)
GetAuthorizations Returns list of `Authorizations` granted to the grantee by the granter.
func (Keeper) GetOrRevokeAuthorization ¶
func (k Keeper) GetOrRevokeAuthorization(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) (cap exported.Authorization, expiration time.Time)
GetOrRevokeAuthorization Returns any `Authorization` (or `nil`), with the expiration time, granted to the grantee by the granter for the provided msg type. If the Authorization is expired already, it will revoke the authorization and return nil
func (Keeper) Grant ¶
func (k Keeper) Grant(ctx sdk.Context, grantee, granter sdk.AccAddress, authorization exported.Authorization, expiration time.Time) error
Grant 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.
func (Keeper) GrantAuthorization ¶
func (k Keeper) GrantAuthorization(goCtx context.Context, msg *types.MsgGrantAuthorizationRequest) (*types.MsgGrantAuthorizationResponse, error)
GrantAuthorization implements the MsgServer.GrantAuthorization method.
func (Keeper) IterateGrants ¶
func (k Keeper) IterateGrants(ctx sdk.Context, handler func(granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress, grant types.AuthorizationGrant) bool)
IterateGrants iterates over all authorization grants
func (Keeper) Revoke ¶
func (k Keeper) Revoke(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) error
Revoke method revokes any authorization for the provided message type granted to the grantee by the granter.
func (Keeper) RevokeAuthorization ¶
func (k Keeper) RevokeAuthorization(goCtx context.Context, msg *types.MsgRevokeAuthorizationRequest) (*types.MsgRevokeAuthorizationResponse, error)
RevokeAuthorization implements the MsgServer.RevokeAuthorization method.