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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Client    *api.Client
	AccessKey string
	UserName  string
	Password  string
}

func (*Driver) AddUser added in v0.2.6

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

func (*Driver) AttachPolicy added in v0.3.1

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

AttachPolicy binds policyName to userName. Reuses the same payload shape that the existing iam-user-check `add` flow already exercises.

func (*Driver) CreateAccessKey added in v0.3.1

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

CreateAccessKey provisions a new access key pair for the sub user via `:createAccessKey`. Returns the public AccessKey and the one-shot Secret.

func (*Driver) DelUser added in v0.2.6

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 an access key for the sub user via `:deleteAccessKey`. The accessKey is passed via query parameter to match the `:detachSubUserPolicy` DELETE convention.

func (*Driver) DetachPolicy added in v0.3.1

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

DetachPolicy removes policyName from userName. Mirrors `userdel`: JDCloud's detach action expects HTTP DELETE with policyName in the query string.

func (*Driver) ListAccessKeys added in v0.3.1

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

ListAccessKeys enumerates the access keys attached to a JDCloud sub user via the pattern-inferred `:describeAccessKeys` action under /subUser. The path mirrors the existing `:attachSubUserPolicy` / `:detachSubUserPolicy` shape; verify against upstream SDK if behaviour deviates.

func (*Driver) ListRoleBindings added in v0.3.1

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

ListRoleBindings returns the managed policies attached to the named sub user. JDCloud IAM is global; the region argument is left empty so the signer falls back to the `jdcloud-api` scope used by the other sub-user actions.

The action path follows the existing :attachSubUserPolicy / :detachSubUserPolicy pattern. If JDCloud renames the describe action upstream, both this driver and the demo replay handler in pkg/providers/jdcloud/replay need updating in lockstep.

func (*Driver) ListUsers

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

func (*Driver) Validator

func (d *Driver) Validator() (string, bool)

Jump to

Keyboard shortcuts

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