awsiam

package
v0.0.0-...-fe161b3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserDoesNotExist = errors.New("iam user does not exist")
)

Functions

This section is empty.

Types

type IAMUser

type IAMUser struct {
	// contains filtered or unexported fields
}

func NewIAMUser

func NewIAMUser(
	iamsvc *iam.IAM,
	logger lager.Logger,
) *IAMUser

func (*IAMUser) AttachUserPolicy

func (i *IAMUser) AttachUserPolicy(userName string, policyARN string) error

func (*IAMUser) Create

func (i *IAMUser) Create(userName string) (string, error)

func (*IAMUser) CreateAccessKey

func (i *IAMUser) CreateAccessKey(userName string) (string, string, error)

func (*IAMUser) CreatePolicy

func (i *IAMUser) CreatePolicy(policyName string, effect string, action string, resource string) (string, error)

func (*IAMUser) Delete

func (i *IAMUser) Delete(userName string) error

func (*IAMUser) DeleteAccessKey

func (i *IAMUser) DeleteAccessKey(userName string, accessKeyID string) error

func (*IAMUser) DeletePolicy

func (i *IAMUser) DeletePolicy(policyARN string) error

func (*IAMUser) Describe

func (i *IAMUser) Describe(userName string) (UserDetails, error)

func (*IAMUser) DetachUserPolicy

func (i *IAMUser) DetachUserPolicy(userName string, policyARN string) error

func (*IAMUser) ListAccessKeys

func (i *IAMUser) ListAccessKeys(userName string) ([]string, error)

func (*IAMUser) ListAttachedUserPolicies

func (i *IAMUser) ListAttachedUserPolicies(userName string) ([]string, error)

type User

type User interface {
	Describe(userName string) (UserDetails, error)
	Create(userName string) (string, error)
	Delete(userName string) error
	ListAccessKeys(userName string) ([]string, error)
	CreateAccessKey(userName string) (string, string, error)
	DeleteAccessKey(userName string, accessKeyID string) error
	CreatePolicy(policyName string, effect string, action string, resource string) (string, error)
	DeletePolicy(policyARN string) error
	ListAttachedUserPolicies(userName string) ([]string, error)
	AttachUserPolicy(userName string, policyARN string) error
	DetachUserPolicy(userName string, policyARN string) error
}

type UserDetails

type UserDetails struct {
	UserName string
	UserARN  string
	UserID   string
}

type UserPolicy

type UserPolicy struct {
	Version    string                `json:"Version"`
	ID         string                `json:"Id"`
	Statements []UserPolicyStatement `json:"Statement"`
}

type UserPolicyStatement

type UserPolicyStatement struct {
	SID      string `json:"Sid"`
	Effect   string `json:"Effect"`
	Action   string `json:"Action"`
	Resource string `json:"Resource"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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