Documentation
¶
Index ¶
- Constants
- type AssumeRoleRequest
- type AssumeRoleResponse
- type AssumeRoleWithSAMLRequest
- type AssumeRoleWithSAMLResponse
- type Client
- func (c *Client) AssumeRole(request *AssumeRoleRequest) (response *AssumeRoleResponse, err error)
- func (c *Client) AssumeRoleWithSAML(request *AssumeRoleWithSAMLRequest) (response *AssumeRoleWithSAMLResponse, err error)
- func (c *Client) GetFederationToken(request *GetFederationTokenRequest) (response *GetFederationTokenResponse, err error)
- type Credentials
- type GetFederationTokenRequest
- type GetFederationTokenResponse
Constants ¶
View Source
const APIVersion = "2018-08-13"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssumeRoleRequest ¶
type AssumeRoleRequest struct {
*tchttp.BaseRequest
// 角色的资源描述。例如:qcs::cam::uin/12345678:role/4611686018427397919、qcs::cam::uin/12345678:roleName/testRoleName
RoleArn *string `json:"RoleArn,omitempty" name:"RoleArn"`
// 临时会话名称,由用户自定义名称
RoleSessionName *string `json:"RoleSessionName,omitempty" name:"RoleSessionName"`
// 指定临时证书的有效期,单位:秒,默认 7200 秒,最长可设定有效期为 43200 秒
DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"`
// 策略描述
// 注意:
// 1、policy 需要做 urlencode(如果通过 GET 方法请求云 API,发送请求前,所有参数都需要按照云 API 规范再 urlencode 一次)。
// 2、策略语法参照 CAM 策略语法。
// 3、策略中不能包含 principal 元素。
Policy *string `json:"Policy,omitempty" name:"Policy"`
}
func NewAssumeRoleRequest ¶
func NewAssumeRoleRequest() (request *AssumeRoleRequest)
func (*AssumeRoleRequest) FromJsonString ¶
func (r *AssumeRoleRequest) FromJsonString(s string) error
func (*AssumeRoleRequest) ToJsonString ¶
func (r *AssumeRoleRequest) ToJsonString() string
type AssumeRoleResponse ¶
type AssumeRoleResponse struct {
*tchttp.BaseResponse
Response *struct {
// 临时安全证书
Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"`
// 证书无效的时间,返回 Unix 时间戳,精确到秒
ExpiredTime *int64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"`
// 证书无效的时间,以 iso8601 格式的 UTC 时间表示
Expiration *string `json:"Expiration,omitempty" name:"Expiration"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewAssumeRoleResponse ¶
func NewAssumeRoleResponse() (response *AssumeRoleResponse)
func (*AssumeRoleResponse) FromJsonString ¶
func (r *AssumeRoleResponse) FromJsonString(s string) error
func (*AssumeRoleResponse) ToJsonString ¶
func (r *AssumeRoleResponse) ToJsonString() string
type AssumeRoleWithSAMLRequest ¶
type AssumeRoleWithSAMLRequest struct {
*tchttp.BaseRequest
// base64 编码的 SAML 断言信息
SAMLAssertion *string `json:"SAMLAssertion,omitempty" name:"SAMLAssertion"`
// 扮演者访问描述名
PrincipalArn *string `json:"PrincipalArn,omitempty" name:"PrincipalArn"`
// 角色访问描述名
RoleArn *string `json:"RoleArn,omitempty" name:"RoleArn"`
// 会话名称
RoleSessionName *string `json:"RoleSessionName,omitempty" name:"RoleSessionName"`
// 指定临时证书的有效期,单位:秒,默认 7200 秒,最长可设定有效期为 7200 秒
DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"`
}
func NewAssumeRoleWithSAMLRequest ¶
func NewAssumeRoleWithSAMLRequest() (request *AssumeRoleWithSAMLRequest)
func (*AssumeRoleWithSAMLRequest) FromJsonString ¶
func (r *AssumeRoleWithSAMLRequest) FromJsonString(s string) error
func (*AssumeRoleWithSAMLRequest) ToJsonString ¶
func (r *AssumeRoleWithSAMLRequest) ToJsonString() string
type AssumeRoleWithSAMLResponse ¶
type AssumeRoleWithSAMLResponse struct {
*tchttp.BaseResponse
Response *struct {
// 对象里面包含 Token,TmpSecretId,TmpSecretKey 三元组
Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"`
// 证书无效的时间,返回 Unix 时间戳,精确到秒
ExpiredTime *uint64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"`
// 证书无效的时间,以 ISO8601 格式的 UTC 时间表示
Expiration *string `json:"Expiration,omitempty" name:"Expiration"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewAssumeRoleWithSAMLResponse ¶
func NewAssumeRoleWithSAMLResponse() (response *AssumeRoleWithSAMLResponse)
func (*AssumeRoleWithSAMLResponse) FromJsonString ¶
func (r *AssumeRoleWithSAMLResponse) FromJsonString(s string) error
func (*AssumeRoleWithSAMLResponse) ToJsonString ¶
func (r *AssumeRoleWithSAMLResponse) ToJsonString() string
type Client ¶
func NewClient ¶
func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) AssumeRole ¶
func (c *Client) AssumeRole(request *AssumeRoleRequest) (response *AssumeRoleResponse, err error)
申请扮演角色
func (*Client) AssumeRoleWithSAML ¶
func (c *Client) AssumeRoleWithSAML(request *AssumeRoleWithSAMLRequest) (response *AssumeRoleWithSAMLResponse, err error)
本接口(AssumeRoleWithSAML)用于根据 SAML 断言申请角色临时凭证。
func (*Client) GetFederationToken ¶
func (c *Client) GetFederationToken(request *GetFederationTokenRequest) (response *GetFederationTokenResponse, err error)
获取联合身份临时访问凭证
type Credentials ¶
type GetFederationTokenRequest ¶
type GetFederationTokenRequest struct {
*tchttp.BaseRequest
// 联合身份用户昵称
Name *string `json:"Name,omitempty" name:"Name"`
// 策略描述
// 注意:
// 1、policy 需要做 urlencode(如果通过 GET 方法请求云 API,发送请求前,所有参数都需要按照云 API 规范再 urlencode 一次)。
// 2、策略语法参照 CAM 策略语法。
// 3、策略中不能包含 principal 元素。
Policy *string `json:"Policy,omitempty" name:"Policy"`
// 指定临时证书的有效期,单位:秒,默认1800秒,最长可设定有效期为7200秒
DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"`
}
func NewGetFederationTokenRequest ¶
func NewGetFederationTokenRequest() (request *GetFederationTokenRequest)
func (*GetFederationTokenRequest) FromJsonString ¶
func (r *GetFederationTokenRequest) FromJsonString(s string) error
func (*GetFederationTokenRequest) ToJsonString ¶
func (r *GetFederationTokenRequest) ToJsonString() string
type GetFederationTokenResponse ¶
type GetFederationTokenResponse struct {
*tchttp.BaseResponse
Response *struct {
// 临时证书
Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"`
// 临时证书有效的时间,返回 Unix 时间戳,精确到秒
ExpiredTime *uint64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewGetFederationTokenResponse ¶
func NewGetFederationTokenResponse() (response *GetFederationTokenResponse)
func (*GetFederationTokenResponse) FromJsonString ¶
func (r *GetFederationTokenResponse) FromJsonString(s string) error
func (*GetFederationTokenResponse) ToJsonString ¶
func (r *GetFederationTokenResponse) ToJsonString() string
Click to show internal directories.
Click to hide internal directories.