iam

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePolicyID added in v0.3.1

func ResolvePolicyID(role string) (uint64, error)

ResolvePolicyID accepts a numeric string ("200001") or a friendly name ("AdministratorAccess") and returns the corresponding CAM policy ID. The friendly-name mapping is intentionally narrow — call sites that need a long-tail policy should pass the numeric ID directly.

Types

type Driver

type Driver struct {
	Credential auth.Credential
	UserName   string
	Password   string
	RoleName   string
	Uin        string
	// contains filtered or unexported fields
}

func (*Driver) AddRole

func (d *Driver) AddRole() (schema.IAMResult, error)

func (*Driver) AddUser

func (d *Driver) AddUser() (schema.IAMResult, error)

func (*Driver) AttachPolicy added in v0.3.1

func (d *Driver) AttachPolicy(ctx context.Context, userName string, policyID uint64) error

AttachPolicy binds policyID to the named CAM user.

func (*Driver) CreateAccessKey added in v0.3.1

func (d *Driver) CreateAccessKey(ctx context.Context, userName string) (schema.IAMCredential, string, error)

CreateAccessKey mints a fresh CAM access key pair. Tencent returns the secret only on creation; capture it from the second return value.

func (*Driver) DelRole

func (d *Driver) DelRole() (schema.IAMResult, error)

func (*Driver) DelUser

func (d *Driver) DelUser() (schema.IAMResult, error)

func (*Driver) DeleteAccessKey added in v0.3.1

func (d *Driver) DeleteAccessKey(ctx context.Context, userName, accessKeyID string) error

DeleteAccessKey revokes a CAM access key by ID for userName.

func (*Driver) DetachPolicy added in v0.3.1

func (d *Driver) DetachPolicy(ctx context.Context, userName string, policyID uint64) error

DetachPolicy removes policyID from the named CAM user.

func (*Driver) ListAccessKeys added in v0.3.1

func (d *Driver) ListAccessKeys(ctx context.Context, userName string) ([]schema.IAMCredential, error)

ListAccessKeys returns the CAM access keys belonging to userName. Tencent CAM keys are owned by a Uin, so when userName is non-empty the driver resolves it via GetUser; an empty userName lists keys for the calling principal.

func (*Driver) ListRoleBindings added in v0.3.1

func (d *Driver) ListRoleBindings(ctx context.Context, userName string) ([]schema.RoleBinding, error)

ListRoleBindings returns the policies currently attached to the named CAM sub-user. Tencent CAM identifies users by numeric Uin internally, so the driver resolves the supplied name via GetUser before paginating policies.

func (*Driver) ListUsers

func (d *Driver) ListUsers(ctx context.Context) ([]schema.User, error)

func (*Driver) SetClientOptions added in v0.2.1

func (d *Driver) SetClientOptions(opts ...api.Option)

Jump to

Keyboard shortcuts

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