sts

package
v0.0.0-...-98d3903 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2017 License: MIT Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// StsSignVersion sts sign version
	StsSignVersion = "1.0"
	// StsAPIVersion sts api version
	StsAPIVersion = "2015-04-01"
	// StsHost sts host
	StsHost = "https://sts.aliyuncs.com/"
	// TimeFormat time fomrat
	TimeFormat = "2006-01-02T15:04:05Z"
	// RespBodyFormat  respone body format
	RespBodyFormat = "JSON"
	// PercentEncode '/'
	PercentEncode = "%2F"
	// HTTPGet http get method
	HTTPGet = "GET"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssumedRoleUser

type AssumedRoleUser struct {
	Arn           string
	AssumedRoleId string
}

AssumedRoleUser the user to AssumedRole

type Client

type Client struct {
	AccessKeyId     string
	AccessKeySecret string
	RoleArn         string
	SessionName     string
}

Client sts client

func NewClient

func NewClient(accessKeyId, accessKeySecret, roleArn, sessionName string) *Client

NewClient New STS Client

func (*Client) AssumeRole

func (c *Client) AssumeRole(expiredTime uint) (*Response, error)

AssumeRole assume role

type Credentials

type Credentials struct {
	AccessKeyId     string
	AccessKeySecret string
	Expiration      time.Time
	SecurityToken   string
}

Credentials the credentials obtained by AssumedRole, used for the peration of Alibaba Cloud service.

type Response

type Response struct {
	Credentials     Credentials
	AssumedRoleUser AssumedRoleUser
	RequestId       string
}

Response the response of AssumeRole

type ServiceError

type ServiceError struct {
	Code       string
	Message    string
	RequestId  string
	HostId     string
	RawMessage string
	StatusCode int
}

ServiceError sts service error

func (*ServiceError) Error

func (e *ServiceError) Error() string

Error implement interface error

Jump to

Keyboard shortcuts

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