Documentation ¶
Index ¶
- type Authorize
- func (a *Authorize) Authorize(ctx context.Context, opts *types.AuthOptions) (*types.Decision, error)
- func (a *Authorize) AuthorizeAnyBatch(ctx context.Context, opts *types.AuthBatchOptions) ([]*types.Decision, error)
- func (a *Authorize) AuthorizeBatch(ctx context.Context, opts *types.AuthBatchOptions) ([]*types.Decision, error)
- func (a *Authorize) ListAuthorizedInstances(ctx context.Context, opts *types.AuthOptions, resourceType types.ResourceType) ([]string, error)
- type Authorizer
- type ResourceFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorize ¶
type Authorize struct {
// contains filtered or unexported fields
}
func (*Authorize) AuthorizeAnyBatch ¶
func (*Authorize) AuthorizeBatch ¶
func (*Authorize) ListAuthorizedInstances ¶
func (a *Authorize) ListAuthorizedInstances(ctx context.Context, opts *types.AuthOptions, resourceType types.ResourceType) ([]string, error)
type Authorizer ¶
type Authorizer interface { // check if a user's operate resource is already authorized or not. Authorize(ctx context.Context, opts *types.AuthOptions) (*types.Decision, error) // check if a user's operate resources is authorized or not batch. // Note: being authorized resources must be the same resource. AuthorizeBatch(ctx context.Context, opts *types.AuthBatchOptions) ([]*types.Decision, error) // check if a user have any authority of the operate actions batch. AuthorizeAnyBatch(ctx context.Context, opts *types.AuthBatchOptions) ([]*types.Decision, error) // list a user's all the authorized resource instance list with an action. // Note: opts.Resources is not required. // the returned list may be huge, we do not do result paging ListAuthorizedInstances(ctx context.Context, opts *types.AuthOptions, resourceType types.ResourceType) ([]string, error) }
func NewAuth ¶
func NewAuth(conf types.Config, fetcher ResourceFetcher) (Authorizer, error)
type ResourceFetcher ¶
Click to show internal directories.
Click to hide internal directories.