iam

package
v0.0.0-...-f473aae Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2014 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

The iam package provides types and functions for interaction with the AWS Identity and Access Management (IAM) service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	UserName string
	Id       string `xml:"AccessKeyId"`
	Secret   string `xml:"SecretAccessKey,omitempty"`
	Status   string
}

AccessKey encapsulates an access key generated for a user.

See http://goo.gl/LHgZR for more details.

type AccessKeysResp

type AccessKeysResp struct {
	RequestId  string      `xml:"ResponseMetadata>RequestId"`
	AccessKeys []AccessKey `xml:"ListAccessKeysResult>AccessKeyMetadata>member"`
}

Response to AccessKeys request.

See http://goo.gl/Vjozx for more details.

type AddUserToGroupResp

type AddUserToGroupResp struct {
	RequestId string `xml:"ResponseMetadata>RequestId"`
}

Response for AddUserToGroup requests.

See http://goo.gl/ZnzRN for more details.

type CreateAccessKeyResp

type CreateAccessKeyResp struct {
	RequestId string    `xml:"ResponseMetadata>RequestId"`
	AccessKey AccessKey `xml:"CreateAccessKeyResult>AccessKey"`
}

Response to a CreateAccessKey request.

See http://goo.gl/L46Py for more details.

type CreateGroupResp

type CreateGroupResp struct {
	Group     Group  `xml:"CreateGroupResult>Group"`
	RequestId string `xml:"ResponseMetadata>RequestId"`
}

Response to a CreateGroup request.

See http://goo.gl/n7NNQ for more details.

type CreateUserResp

type CreateUserResp struct {
	RequestId string `xml:"ResponseMetadata>RequestId"`
	User      User   `xml:"CreateUserResult>User"`
}

Response to a CreateUser request.

See http://goo.gl/JS9Gz for more details.

type Error

type Error struct {
	// HTTP status code of the error.
	StatusCode int

	// AWS code of the error.
	Code string

	// Message explaining the error.
	Message string
}

Error encapsulates an IAM error.

func (*Error) Error

func (e *Error) Error() string

type GetUserPolicyResp

type GetUserPolicyResp struct {
	Policy    UserPolicy `xml:"GetUserPolicyResult"`
	RequestId string     `xml:"ResponseMetadata>RequestId"`
}

Response to a GetUserPolicy request.

See http://goo.gl/BH04O for more details.

type GetUserResp

type GetUserResp struct {
	RequestId string `xml:"ResponseMetadata>RequestId"`
	User      User   `xml:"GetUserResult>User"`
}

Response for GetUser requests.

See http://goo.gl/ZnzRN for more details.

type Group

type Group struct {
	Arn  string
	Id   string `xml:"GroupId"`
	Name string `xml:"GroupName"`
	Path string
}

Group encapsulates a group managed by IAM.

See http://goo.gl/ae7Vs for more details.

type GroupsResp

type GroupsResp struct {
	Groups    []Group `xml:"ListGroupsResult>Groups>member"`
	RequestId string  `xml:"ResponseMetadata>RequestId"`
}

Response to a ListGroups request.

See http://goo.gl/W2TRj for more details.

type IAM

type IAM struct {
	aws.Auth
	aws.Region
	// contains filtered or unexported fields
}

The IAM type encapsulates operations operations with the IAM endpoint.

func New

func New(auth aws.Auth, region aws.Region) *IAM

New creates a new IAM instance.

func NewWithClient

func NewWithClient(auth aws.Auth, region aws.Region, httpClient *http.Client) *IAM

func (*IAM) AccessKeys

func (iam *IAM) AccessKeys(userName string) (*AccessKeysResp, error)

AccessKeys lists all acccess keys associated with a user.

The userName parameter is optional. If set to "", the userName is determined implicitly based on the AWS Access Key ID used to sign the request.

See http://goo.gl/Vjozx for more details.

func (*IAM) AddUserToGroup

func (iam *IAM) AddUserToGroup(name, group string) (*AddUserToGroupResp, error)

AddUserToGroup adds a user to a specific group

See http://goo.gl/ZnzRN for more details.

func (*IAM) CreateAccessKey

func (iam *IAM) CreateAccessKey(userName string) (*CreateAccessKeyResp, error)

CreateAccessKey creates a new access key in IAM.

See http://goo.gl/L46Py for more details.

func (*IAM) CreateGroup

func (iam *IAM) CreateGroup(name string, path string) (*CreateGroupResp, error)

CreateGroup creates a new group in IAM.

The path parameter can be used to identify which division or part of the organization the user belongs to.

If path is unset ("") it defaults to "/".

See http://goo.gl/n7NNQ for more details.

func (*IAM) CreateUser

func (iam *IAM) CreateUser(name, path string) (*CreateUserResp, error)

CreateUser creates a new user in IAM.

See http://goo.gl/JS9Gz for more details.

func (*IAM) DeleteAccessKey

func (iam *IAM) DeleteAccessKey(id, userName string) (*SimpleResp, error)

DeleteAccessKey deletes an access key from IAM.

The userName parameter is optional. If set to "", the userName is determined implicitly based on the AWS Access Key ID used to sign the request.

See http://goo.gl/hPGhw for more details.

func (*IAM) DeleteGroup

func (iam *IAM) DeleteGroup(name string) (*SimpleResp, error)

DeleteGroup deletes a group from IAM.

See http://goo.gl/d5i2i for more details.

func (*IAM) DeleteUser

func (iam *IAM) DeleteUser(name string) (*SimpleResp, error)

DeleteUser deletes a user from IAM.

See http://goo.gl/jBuCG for more details.

func (*IAM) DeleteUserPolicy

func (iam *IAM) DeleteUserPolicy(userName, policyName string) (*SimpleResp, error)

DeleteUserPolicy deletes a user policy from IAM.

See http://goo.gl/7Jncn for more details.

func (*IAM) GetUser

func (iam *IAM) GetUser(name string) (*GetUserResp, error)

GetUser gets a user from IAM.

See http://goo.gl/ZnzRN for more details.

func (*IAM) GetUserPolicy

func (iam *IAM) GetUserPolicy(userName, policyName string) (*GetUserPolicyResp, error)

GetUserPolicy gets a user policy in IAM.

See http://goo.gl/BH04O for more details.

func (*IAM) Groups

func (iam *IAM) Groups(pathPrefix string) (*GroupsResp, error)

Groups list the groups that have the specified path prefix.

The parameter pathPrefix is optional. If pathPrefix is "", all groups are returned.

See http://goo.gl/W2TRj for more details.

func (*IAM) PutUserPolicy

func (iam *IAM) PutUserPolicy(userName, policyName, policyDocument string) (*SimpleResp, error)

PutUserPolicy creates a user policy in IAM.

See http://goo.gl/ldCO8 for more details.

type SimpleResp

type SimpleResp struct {
	RequestId string `xml:"ResponseMetadata>RequestId"`
}

type User

type User struct {
	Arn  string
	Path string
	Id   string `xml:"UserId"`
	Name string `xml:"UserName"`
}

User encapsulates a user managed by IAM.

See http://goo.gl/BwIQ3 for more details.

type UserPolicy

type UserPolicy struct {
	Name     string `xml:"PolicyName"`
	UserName string `xml:"UserName"`
	Document string `xml:"PolicyDocument"`
}

UserPolicy encapsulates an IAM group policy.

See http://goo.gl/C7hgS for more details.

Directories

Path Synopsis
Package iamtest implements a fake IAM provider with the capability of inducing errors on any given operation, and retrospectively determining what operations have been carried out.
Package iamtest implements a fake IAM provider with the capability of inducing errors on any given operation, and retrospectively determining what operations have been carried out.

Jump to

Keyboard shortcuts

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