Documentation
¶
Overview ¶
Package awsiam provides an in-memory mock implementation of AWS IAM.
Index ¶
- type Mock
- func (m *Mock) AddRoleToInstanceProfile(_ context.Context, profileName, roleName string) error
- func (m *Mock) AddUserToGroup(_ context.Context, userName, groupName string) error
- func (m *Mock) AttachRolePolicy(_ context.Context, roleName, policyARN string) error
- func (m *Mock) AttachUserPolicy(_ context.Context, userName, policyARN string) error
- func (m *Mock) CheckPermission(_ context.Context, principal, action, resource string) (bool, error)
- func (m *Mock) CreateAccessKey(_ context.Context, cfg driver.AccessKeyConfig) (*driver.AccessKeyInfo, error)
- func (m *Mock) CreateGroup(_ context.Context, cfg driver.GroupConfig) (*driver.GroupInfo, error)
- func (m *Mock) CreateInstanceProfile(_ context.Context, cfg driver.InstanceProfileConfig) (*driver.InstanceProfileInfo, error)
- func (m *Mock) CreatePolicy(_ context.Context, cfg driver.PolicyConfig) (*driver.PolicyInfo, error)
- func (m *Mock) CreateRole(_ context.Context, cfg driver.RoleConfig) (*driver.RoleInfo, error)
- func (m *Mock) CreateUser(_ context.Context, cfg driver.UserConfig) (*driver.UserInfo, error)
- func (m *Mock) DeleteAccessKey(_ context.Context, userName, accessKeyID string) error
- func (m *Mock) DeleteGroup(_ context.Context, name string) error
- func (m *Mock) DeleteInstanceProfile(_ context.Context, name string) error
- func (m *Mock) DeletePolicy(_ context.Context, arn string) error
- func (m *Mock) DeleteRole(_ context.Context, name string) error
- func (m *Mock) DeleteUser(_ context.Context, name string) error
- func (m *Mock) DetachRolePolicy(_ context.Context, roleName, policyARN string) error
- func (m *Mock) DetachUserPolicy(_ context.Context, userName, policyARN string) error
- func (m *Mock) GetGroup(_ context.Context, name string) (*driver.GroupInfo, error)
- func (m *Mock) GetInstanceProfile(_ context.Context, name string) (*driver.InstanceProfileInfo, error)
- func (m *Mock) GetPolicy(_ context.Context, arn string) (*driver.PolicyInfo, error)
- func (m *Mock) GetRole(_ context.Context, name string) (*driver.RoleInfo, error)
- func (m *Mock) GetUser(_ context.Context, name string) (*driver.UserInfo, error)
- func (m *Mock) ListAccessKeys(_ context.Context, userName string) ([]driver.AccessKeyInfo, error)
- func (m *Mock) ListAttachedRolePolicies(_ context.Context, roleName string) ([]string, error)
- func (m *Mock) ListAttachedUserPolicies(_ context.Context, userName string) ([]string, error)
- func (m *Mock) ListGroups(_ context.Context) ([]driver.GroupInfo, error)
- func (m *Mock) ListGroupsForUser(_ context.Context, userName string) ([]driver.GroupInfo, error)
- func (m *Mock) ListInstanceProfiles(_ context.Context) ([]driver.InstanceProfileInfo, error)
- func (m *Mock) ListPolicies(_ context.Context) ([]driver.PolicyInfo, error)
- func (m *Mock) ListRoles(_ context.Context) ([]driver.RoleInfo, error)
- func (m *Mock) ListUsers(_ context.Context) ([]driver.UserInfo, error)
- func (m *Mock) RemoveRoleFromInstanceProfile(_ context.Context, profileName, roleName string) error
- func (m *Mock) RemoveUserFromGroup(_ context.Context, userName, groupName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of the AWS IAM service.
func (*Mock) AddRoleToInstanceProfile ¶ added in v1.4.0
AddRoleToInstanceProfile associates a role with an instance profile.
func (*Mock) AddUserToGroup ¶ added in v1.3.2
AddUserToGroup adds a user to a group.
func (*Mock) AttachRolePolicy ¶
AttachRolePolicy attaches a policy to a role.
func (*Mock) AttachUserPolicy ¶
AttachUserPolicy attaches a policy to a user.
func (*Mock) CheckPermission ¶
CheckPermission evaluates attached policies to determine if a principal is allowed to perform the given action on the given resource. Explicit Deny wins over Allow.
func (*Mock) CreateAccessKey ¶ added in v1.3.2
func (m *Mock) CreateAccessKey( _ context.Context, cfg driver.AccessKeyConfig, ) (*driver.AccessKeyInfo, error)
CreateAccessKey creates a new access key for the given user.
func (*Mock) CreateGroup ¶ added in v1.3.2
CreateGroup creates a new IAM group.
func (*Mock) CreateInstanceProfile ¶ added in v1.4.0
func (m *Mock) CreateInstanceProfile( _ context.Context, cfg driver.InstanceProfileConfig, ) (*driver.InstanceProfileInfo, error)
CreateInstanceProfile creates a new instance profile.
func (*Mock) CreatePolicy ¶
func (m *Mock) CreatePolicy(_ context.Context, cfg driver.PolicyConfig) (*driver.PolicyInfo, error)
CreatePolicy creates a new IAM policy.
func (*Mock) CreateRole ¶
CreateRole creates a new IAM role.
func (*Mock) CreateUser ¶
CreateUser creates a new IAM user.
func (*Mock) DeleteAccessKey ¶ added in v1.3.2
DeleteAccessKey deletes an access key.
func (*Mock) DeleteGroup ¶ added in v1.3.2
DeleteGroup deletes the IAM group with the given name.
func (*Mock) DeleteInstanceProfile ¶ added in v1.4.0
DeleteInstanceProfile deletes the instance profile with the given name.
func (*Mock) DeletePolicy ¶
DeletePolicy deletes the IAM policy with the given ARN.
func (*Mock) DeleteRole ¶
DeleteRole deletes the IAM role with the given name.
func (*Mock) DeleteUser ¶
DeleteUser deletes the IAM user with the given name.
func (*Mock) DetachRolePolicy ¶
DetachRolePolicy detaches a policy from a role.
func (*Mock) DetachUserPolicy ¶
DetachUserPolicy detaches a policy from a user.
func (*Mock) GetInstanceProfile ¶ added in v1.4.0
func (m *Mock) GetInstanceProfile( _ context.Context, name string, ) (*driver.InstanceProfileInfo, error)
GetInstanceProfile returns the instance profile with the given name.
func (*Mock) ListAccessKeys ¶ added in v1.3.2
func (m *Mock) ListAccessKeys( _ context.Context, userName string, ) ([]driver.AccessKeyInfo, error)
ListAccessKeys returns all access keys for the given user.
func (*Mock) ListAttachedRolePolicies ¶
ListAttachedRolePolicies returns the ARNs of policies attached to the given role.
func (*Mock) ListAttachedUserPolicies ¶
ListAttachedUserPolicies returns the ARNs of policies attached to the given user.
func (*Mock) ListGroups ¶ added in v1.3.2
ListGroups returns all IAM groups.
func (*Mock) ListGroupsForUser ¶ added in v1.3.2
ListGroupsForUser returns all groups a user belongs to.
func (*Mock) ListInstanceProfiles ¶ added in v1.4.0
ListInstanceProfiles returns all instance profiles.
func (*Mock) ListPolicies ¶
ListPolicies returns all IAM policies.