iam

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityType

type EntityType string

EntityType represents entity's type.

func NewEntityTypeGroup

func NewEntityTypeGroup() EntityType

NewEntityTypeGroup returns group's EntityType.

func NewEntityTypeRole

func NewEntityTypeRole() EntityType

NewEntityTypeRole returns role's EntityType.

func NewEntityTypeUser

func NewEntityTypeUser() EntityType

NewEntityTypeUser returns user's EntityType.

type IAM

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

IAM has IAM client.

func New

func New(conf config.Config) (*IAM, error)

New returns initialized *IAM.

func (*IAM) Errorf

func (svc *IAM) Errorf(format string, v ...interface{})

Errorf logging error information.

func (*IAM) GetGroup

func (svc *IAM) GetGroup(groupName string) (*SDK.GetGroupOutput, error)

GetGroup executes GetGroup operation.

func (*IAM) GetPolicyVersion

func (svc *IAM) GetPolicyVersion(arn, versionID string) (*SDK.PolicyVersion, error)

GetPolicyVersion executes GetPolicyVersion operation.

func (*IAM) Infof

func (svc *IAM) Infof(format string, v ...interface{})

Infof logging information.

func (*IAM) ListAllPolicies

func (svc *IAM) ListAllPolicies() ([]Policy, error)

ListAllPolicies fetches all of the policies list.

func (*IAM) ListAttachedPolicies

func (svc *IAM) ListAttachedPolicies() ([]Policy, error)

ListAttachedPolicies fetches attached policy list.

func (*IAM) ListEntitiesForPolicy

func (svc *IAM) ListEntitiesForPolicy(arn string) ([]PolicyEntity, error)

ListEntitiesForPolicy executes ListEntitiesForPolicy operation.

func (*IAM) SetLogger

func (svc *IAM) SetLogger(logger log.Logger)

SetLogger sets logger.

type Policy

type Policy struct {
	ARN             string
	PolicyID        string
	PolicyName      string
	VersionID       string
	Description     string
	AttachmentCount int64
	CreateDate      time.Time
	UpdateDate      time.Time
}

Policy contains IAM policy data.

func NewPoilicy

func NewPoilicy(p *SDK.Policy) Policy

NewPoilicy returns initialized Policy from *SDK.Policy.

func NewPolicies

func NewPolicies(list []*SDK.Policy) []Policy

NewPolicies converts from []*SDK.Policy to []Policy.

type PolicyDocument

type PolicyDocument struct {
	Version   string      `json:"Version"`
	Statement []Statement `json:"Statement"`
}

PolicyDocument contains permission data of a policy.

func NewPolicyDocumentFromDocument

func NewPolicyDocumentFromDocument(document string) (PolicyDocument, error)

NewPolicyDocumentFromDocument returns initialized PolicyDocument from response data.

func NewPolicyDocumentFromJSONString

func NewPolicyDocumentFromJSONString(data string) (PolicyDocument, error)

NewPolicyDocumentFromJSONString returns initialized PolicyDocument from JSON data.

func (*PolicyDocument) UnmarshalJSON

func (p *PolicyDocument) UnmarshalJSON(data []byte) error

UnmarshalJSON converts from json to *PolicyDocument.

type PolicyEntity

type PolicyEntity struct {
	Type EntityType
	ID   string
	Name string
}

PolicyEntity contains Entity's id and name. Entity is User, Group or Role.

func NewPolicyEntityList

func NewPolicyEntityList(o *SDK.ListEntitiesForPolicyOutput) []PolicyEntity

NewPolicyEntityList creates []PolicyEntity from *SDK.ListEntitiesForPolicyOutput.

func (PolicyEntity) IsGroup

func (e PolicyEntity) IsGroup() bool

IsGroup checks this entity is group or not.

func (PolicyEntity) IsRole

func (e PolicyEntity) IsRole() bool

IsRole checks this entity is role or not.

func (PolicyEntity) IsUser

func (e PolicyEntity) IsUser() bool

IsUser checks this entity is user or not.

type Statement

type Statement struct {
	Sid      string   `json:"Sid"`
	Effect   string   `json:"Effect"`
	Action   []string `json:"Action"`
	Resource []string `json:"Resource"`
}

Statement represents statement of iam policy.

func (*Statement) IsAllow

func (s *Statement) IsAllow() bool

IsAllow checks that effect is allow.

func (*Statement) IsDeny

func (s *Statement) IsDeny() bool

IsDeny checks that effect is deny.

func (*Statement) UnmarshalJSON

func (s *Statement) UnmarshalJSON(data []byte) error

UnmarshalJSON converts from json to *Statement.

Jump to

Keyboard shortcuts

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