Documentation ¶
Index ¶
- Constants
- type AccessDecisionRepository
- func (r *AccessDecisionRepository) Delete(ctx context.Context, id string) error
- func (r *AccessDecisionRepository) Get(ctx context.Context, id string) (*types.AccessDecision, error)
- func (r *AccessDecisionRepository) List(ctx context.Context) ([]*types.AccessDecision, error)
- func (r *AccessDecisionRepository) ListIds(ctx context.Context) ([]string, error)
- func (r *AccessDecisionRepository) Set(ctx context.Context, decision *types.AccessDecision) error
- type EvaluateAccessRequestsCommand
- type GogoProtoMarshaler
- type ParamsRepository
- type Repository
- type StaticParamsRepository
- type VerifyAccessRequestCommand
Constants ¶
View Source
const DefaultExpirationDelta uint64 = 100
DefaultExpirationDelta sets the number of blocks a Decision is valid for
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessDecisionRepository ¶
type AccessDecisionRepository struct {
// contains filtered or unexported fields
}
func NewAccessDecisionRepository ¶
func NewAccessDecisionRepository(store storetypes.KVStore) *AccessDecisionRepository
func (*AccessDecisionRepository) Delete ¶
func (r *AccessDecisionRepository) Delete(ctx context.Context, id string) error
func (*AccessDecisionRepository) Get ¶
func (r *AccessDecisionRepository) Get(ctx context.Context, id string) (*types.AccessDecision, error)
func (*AccessDecisionRepository) List ¶
func (r *AccessDecisionRepository) List(ctx context.Context) ([]*types.AccessDecision, error)
func (*AccessDecisionRepository) ListIds ¶
func (r *AccessDecisionRepository) ListIds(ctx context.Context) ([]string, error)
func (*AccessDecisionRepository) Set ¶
func (r *AccessDecisionRepository) Set(ctx context.Context, decision *types.AccessDecision) error
type EvaluateAccessRequestsCommand ¶
type EvaluateAccessRequestsCommand struct { Policy *types.Policy Operations []*types.Operation Actor authtypes.AccountI CreationTime *prototypes.Timestamp // Creator is the same as the Tx signer Creator authtypes.AccountI // Current block height CurrentHeight uint64 // contains filtered or unexported fields }
func (*EvaluateAccessRequestsCommand) Execute ¶
func (c *EvaluateAccessRequestsCommand) Execute(ctx context.Context, engine auth_engine.AuthEngine, repository Repository, paramsRepo ParamsRepository, registry did.Registry) (*types.AccessDecision, error)
type GogoProtoMarshaler ¶
func NewGogoProtoMarshaler ¶
func NewGogoProtoMarshaler[T gogoproto.Message](factory func() T) *GogoProtoMarshaler[T]
func (*GogoProtoMarshaler[T]) Marshal ¶
func (m *GogoProtoMarshaler[T]) Marshal(t *T) ([]byte, error)
func (*GogoProtoMarshaler[T]) Unmarshal ¶
func (m *GogoProtoMarshaler[T]) Unmarshal(bytes []byte) (T, error)
type ParamsRepository ¶
type ParamsRepository interface {
GetDefaults(context.Context) (*types.DecisionParams, error)
}
type Repository ¶
type Repository interface { Set(ctx context.Context, decision *types.AccessDecision) error Get(ctx context.Context, id string) (*types.AccessDecision, error) Delete(ctx context.Context, id string) error // List of Ids of all Decisions ListIds(ctx context.Context) ([]string, error) List(ctx context.Context) ([]*types.AccessDecision, error) }
type StaticParamsRepository ¶
type StaticParamsRepository struct{}
func (*StaticParamsRepository) GetDefaults ¶
func (r *StaticParamsRepository) GetDefaults(ctx context.Context) (*types.DecisionParams, error)
type VerifyAccessRequestCommand ¶
type VerifyAccessRequestCommand struct { Policy *types.Policy AccessRequest *types.AccessRequest }
VerifyAccessRequest verifies whether the given AccessRequest is valid for Policy. An AccessRequest is valid if the Request's Actor is authorized to execute all the Operations within it.
func (*VerifyAccessRequestCommand) Execute ¶
func (c *VerifyAccessRequestCommand) Execute(ctx context.Context, engine auth_engine.AuthEngine) error
Execute runs the Comand for the given context and engine
Click to show internal directories.
Click to hide internal directories.