Documentation ¶
Overview ¶
Package api defines all APIs supported by the STS service of BCE.
Index ¶
Constants ¶
View Source
const ( DEFAULT_DURATION_SECONDS = 43200 // default duration is 12 hours URI_PREFIX = bce.URI_PREFIX + "v1" // sts service not support uri without prefix "v1" REQUEST_URI = "/sessionToken" DEFAULT_ASSUMEROLE_DURATION_SECONDS = 7200 // default duration is 2 hours REQUEST_ASSUMEROLE_URI = "/credential" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssumeRoleArgs ¶ added in v0.9.22
type Credential ¶ added in v0.9.22
type Credential struct { AccessKeyId string SecretAccessKey string SessionToken string CreateTime time.Time Expiration time.Time UserId string RoleId string }
func AssumeRole ¶ added in v0.9.22
func AssumeRole(cli bce.Client, args *AssumeRoleArgs) (*Credential, error)
AssumeRole - get the credential for the assume role from the STS service
PARAMS:
- cli: the client object which can perform sending request
- args: the args for assumeRole
RETURNS:
- *Credential: result of this api
- error: nil if ok otherwise the specific error
type GetSessionTokenResult ¶
type GetSessionTokenResult struct { AccessKeyId string SecretAccessKey string SessionToken string CreateTime string Expiration string UserId string }
func GetSessionToken ¶
GetSessionToken - get the session token from the STS service
PARAMS:
- cli: the client object which can perform sending request
- durationSec: the duration seconds of the token
- acl: the acl string
RETURNS:
- *GetSessionTokenResult: result of this api
- error: nil if ok otherwise the specific error
Click to show internal directories.
Click to hide internal directories.