Documentation
¶
Overview ¶
Package awsiam provides an in-memory mock implementation of AWS IAM.
Index ¶
- type Mock
- 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) 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) 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) 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) ListAttachedRolePolicies(_ context.Context, roleName string) ([]string, error)
- func (m *Mock) ListAttachedUserPolicies(_ context.Context, userName string) ([]string, 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)
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) 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) 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) 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) 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) ListPolicies ¶
ListPolicies returns all IAM policies.