auth

package
v0.0.0-...-6ef7557 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package auth NOTES

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptAuthOptions

func AdaptAuthOptions(a *meta.ResourceAttribute) (client.ActionID, []client.Resource, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL