Documentation ¶
Overview ¶
Package auth NOTES
Index ¶
- func AdaptAuthOptions(a *meta.ResourceAttribute) (client.ActionID, []client.Resource, error)
- func AdaptIAMApplicationOptions(as []*meta.ResourceAttribute) (*bkiam.Application, error)
- func AdaptIAMResourceOptions(a *meta.ResourceAttribute) (*bkiam.Request, error)
- type Auth
- func (a *Auth) AuthorizeBatch(ctx context.Context, req *pbas.AuthorizeBatchReq) (*pbas.AuthorizeBatchResp, error)
- func (a *Auth) GetPermissionToApply(ctx context.Context, req *pbas.GetPermissionToApplyReq) (*pbas.GetPermissionToApplyResp, error)
- func (a *Auth) GrantResourceCreatorAction(ctx context.Context, opts *client.GrantResourceCreatorActionOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptAuthOptions ¶
AdaptAuthOptions convert bscp auth resource to iam action id and resources
func AdaptIAMApplicationOptions ¶
func AdaptIAMApplicationOptions(as []*meta.ResourceAttribute) (*bkiam.Application, error)
AdaptIAMApplicationOptions 申请链接, applyURL 接口使用
func AdaptIAMResourceOptions ¶
func AdaptIAMResourceOptions(a *meta.ResourceAttribute) (*bkiam.Request, error)
AdaptIAMResourceOptions 鉴权, 查看 isAllow 接口使用
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth related operate.
func NewAuth ¶
func NewAuth(auth auth.Authorizer, ds pbds.DataClient, disableAuth bool, iamClient *bkiam.IAM, disableWriteOpt *options.DisableWriteOption, spaceMgr *space.Manager) (*Auth, error)
NewAuth new auth.
func (*Auth) AuthorizeBatch ¶
func (a *Auth) AuthorizeBatch(ctx context.Context, req *pbas.AuthorizeBatchReq) (*pbas.AuthorizeBatchResp, error)
AuthorizeBatch authorize resource batch.
func (*Auth) GetPermissionToApply ¶
func (a *Auth) GetPermissionToApply(ctx context.Context, req *pbas.GetPermissionToApplyReq) ( *pbas.GetPermissionToApplyResp, error)
GetPermissionToApply get iam permission to apply when user has no permission to some resources.
func (*Auth) GrantResourceCreatorAction ¶
func (a *Auth) GrantResourceCreatorAction(ctx context.Context, opts *client.GrantResourceCreatorActionOption) error
GrantResourceCreatorAction grant resource creator action.
Click to show internal directories.
Click to hide internal directories.