Documentation
¶
Index ¶
- Constants
- type ApiKey
- 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)
- func (c *Client) QueryApiKey(request *QueryApiKeyRequest) (response *QueryApiKeyResponse, err error)
- type Credentials
- type GetFederationTokenRequest
- type GetFederationTokenResponse
- type QueryApiKeyRequest
- type QueryApiKeyResponse
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 规范](https://cloud.tencent.com/document/api/598/33159#1.-.E6.8B.BC.E6.8E.A5.E8.A7.84.E8.8C.83.E8.AF.B7.E6.B1.82.E4.B8.B2)再 urlencode 一次)。
// 2、策略语法参照[ CAM 策略语法](https://cloud.tencent.com/document/product/598/10603)。
// 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)
获取联合身份临时访问凭证
func (*Client) QueryApiKey ¶
func (c *Client) QueryApiKey(request *QueryApiKeyRequest) (response *QueryApiKeyResponse, err error)
拉取API密钥列表
type Credentials ¶
type GetFederationTokenRequest ¶
type GetFederationTokenRequest struct {
*tchttp.BaseRequest
// 您可以自定义调用方英文名称,由字母组成。
Name *string `json:"Name,omitempty" name:"Name"`
// 策略描述
// 注意:
// 1、policy 需要做 urlencode(如果通过 GET 方法请求云 API,发送请求前,所有参数都需要按照[云 API 规范](https://cloud.tencent.com/document/api/598/33159#1.-.E6.8B.BC.E6.8E.A5.E8.A7.84.E8.8C.83.E8.AF.B7.E6.B1.82.E4.B8.B2)再 urlencode 一次)。
// 2、策略语法参照[ CAM 策略语法](https://cloud.tencent.com/document/product/598/10603)。
// 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"`
// 证书有效的时间,以 iso8601 格式的 UTC 时间表示
// 注意:此字段可能返回 null,表示取不到有效值。
Expiration *string `json:"Expiration,omitempty" name:"Expiration"`
// 唯一请求 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
type QueryApiKeyRequest ¶
type QueryApiKeyRequest struct {
*tchttp.BaseRequest
// 待查询的账号(不填默认查当前账号)
TargetUin *uint64 `json:"TargetUin,omitempty" name:"TargetUin"`
}
func NewQueryApiKeyRequest ¶
func NewQueryApiKeyRequest() (request *QueryApiKeyRequest)
func (*QueryApiKeyRequest) FromJsonString ¶
func (r *QueryApiKeyRequest) FromJsonString(s string) error
func (*QueryApiKeyRequest) ToJsonString ¶
func (r *QueryApiKeyRequest) ToJsonString() string
type QueryApiKeyResponse ¶
type QueryApiKeyResponse struct {
*tchttp.BaseResponse
Response *struct {
// 密钥ID列表
IdKeys []*ApiKey `json:"IdKeys,omitempty" name:"IdKeys" list`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewQueryApiKeyResponse ¶
func NewQueryApiKeyResponse() (response *QueryApiKeyResponse)
func (*QueryApiKeyResponse) FromJsonString ¶
func (r *QueryApiKeyResponse) FromJsonString(s string) error
func (*QueryApiKeyResponse) ToJsonString ¶
func (r *QueryApiKeyResponse) ToJsonString() string
Click to show internal directories.
Click to hide internal directories.