Documentation
¶
Index ¶
- func ResolvePolicyARN(role string) string
- type Driver
- func (d *Driver) AddUser() (schema.IAMResult, error)
- func (d *Driver) AttachPolicy(ctx context.Context, userName, policyARN string) error
- func (d *Driver) CreateAccessKey(ctx context.Context, userName string) (schema.IAMCredential, string, error)
- func (d *Driver) DelUser() (schema.IAMResult, error)
- func (d *Driver) DeleteAccessKey(ctx context.Context, userName, accessKeyID string) error
- func (d *Driver) DetachPolicy(ctx context.Context, userName, policyARN string) error
- func (d *Driver) ListAccessKeys(ctx context.Context, userName string) ([]schema.IAMCredential, error)
- func (d *Driver) ListRoleBindings(ctx context.Context, userName string) ([]schema.RoleBinding, error)
- func (d *Driver) ListUsers(ctx context.Context) ([]schema.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolvePolicyARN ¶ added in v0.3.1
ResolvePolicyARN expands a bare policy name (e.g. "AdministratorAccess") into its AWS-managed ARN. ARNs are returned untouched. Used so callers can pass either form to the role-binding-check payload.
Types ¶
type Driver ¶ added in v0.0.9
type Driver struct {
Client *api.Client
Region string
DefaultRegion string
Username string
Password string
}
func (*Driver) AttachPolicy ¶ added in v0.3.1
AttachPolicy binds policyARN to userName.
func (*Driver) CreateAccessKey ¶ added in v0.3.1
func (d *Driver) CreateAccessKey(ctx context.Context, userName string) (schema.IAMCredential, string, error)
CreateAccessKey mints a new IAM access key for userName. The secret is returned once and only once on creation; callers must capture it.
func (*Driver) DeleteAccessKey ¶ added in v0.3.1
DeleteAccessKey revokes an IAM access key by ID.
func (*Driver) DetachPolicy ¶ added in v0.3.1
DetachPolicy removes policyARN from userName.
func (*Driver) ListAccessKeys ¶ added in v0.3.1
func (d *Driver) ListAccessKeys(ctx context.Context, userName string) ([]schema.IAMCredential, error)
ListAccessKeys enumerates IAM access keys for userName. AWS requires the user name when the caller is not the same principal; an empty userName lets AWS fall back to the current user.
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 userName. AWS IAM has no account-wide enumeration of attachments; userName is required.