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 ¶
const ( // Database error. INTERNALERROR_DBERROR = "InternalError.DbError" // Encryption failed. INTERNALERROR_ENCRYPTERROR = "InternalError.EncryptError" // Failed to get the `appid`. INTERNALERROR_GETAPPIDERROR = "InternalError.GetAppIdError" // Failed to get the role. INTERNALERROR_GETROLEERROR = "InternalError.GetRoleError" // Failed to obtain the seed token. INTERNALERROR_GETSEEDTOKENERROR = "InternalError.GetSeedTokenError" // Invalid role. INTERNALERROR_ILLEGALROLE = "InternalError.IllegalRole" // pb packaging failed. INTERNALERROR_PBSERIALIZEERROR = "InternalError.PbSerializeError" // Internal error. INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" // Unknown error. INTERNALERROR_UNKNOWNERROR = "InternalError.UnknownError" // The account does not exist or is unavailable. INVALIDPARAMETER_ACCOUNTNOTAVALIABLE = "InvalidParameter.AccountNotAvaliable" // The extension policy is too large. INVALIDPARAMETER_EXTENDSTRATEGYOVERSIZE = "InvalidParameter.ExtendStrategyOverSize" // Unauthorized access to the resource. INVALIDPARAMETER_GRANTOTHERRESOURCE = "InvalidParameter.GrantOtherResource" // Frequency limit exceeded. INVALIDPARAMETER_OVERLIMIT = "InvalidParameter.OverLimit" // The expiration time exceeds the threshold. INVALIDPARAMETER_OVERTIMEERROR = "InvalidParameter.OverTimeError" // Invalid parameter. INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" // The policy is too long. INVALIDPARAMETER_POLICYTOOLONG = "InvalidParameter.PolicyTooLong" // Resource error. INVALIDPARAMETER_RESOUCEERROR = "InvalidParameter.ResouceError" // Policy syntax error. INVALIDPARAMETER_STRATEGYFORMATERROR = "InvalidParameter.StrategyFormatError" // Invalid policy. INVALIDPARAMETER_STRATEGYINVALID = "InvalidParameter.StrategyInvalid" // Invalid `TCB temp code`. INVALIDPARAMETER_TEMPCODENOTAVALIABLE = "InvalidParameter.TempCodeNotAvaliable" // The role corresponding to the account does not exist. RESOURCENOTFOUND_ROLENOTFOUND = "ResourceNotFound.RoleNotFound" // Unauthorized operation. UNAUTHORIZEDOPERATION = "UnauthorizedOperation" )
const APIVersion = "2018-08-13"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssumeRoleRequest ¶
type AssumeRoleRequest struct { *tchttp.BaseRequest // Role resource description, such as qcs::cam::uin/12345678:role/4611686018427397919, qcs::cam::uin/12345678:roleName/testRoleName RoleArn *string `json:"RoleArn,omitempty" name:"RoleArn"` // User-defined temporary session name RoleSessionName *string `json:"RoleSessionName,omitempty" name:"RoleSessionName"` // Specifies the validity period of credentials in seconds. Default value: 7200. Maximum value: 43200 DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"` // Policy description // Note: // 1. The policy needs to be URL-encoded (if you request a TencentCloud API through the GET method, all parameters must be URL-encoded again in accordance with [Signature v3](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) before the request is sent). // 2. For the policy syntax, please see CAM’s [Syntax Logic](https://cloud.tencent.com/document/product/598/10603). // 3. The policy cannot contain the `principal` element. Policy *string `json:"Policy,omitempty" name:"Policy"` }
func NewAssumeRoleRequest ¶
func NewAssumeRoleRequest() (request *AssumeRoleRequest)
func (*AssumeRoleRequest) FromJsonString ¶
func (r *AssumeRoleRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*AssumeRoleRequest) ToJsonString ¶
func (r *AssumeRoleRequest) ToJsonString() string
type AssumeRoleResponse ¶
type AssumeRoleResponse struct { *tchttp.BaseResponse Response *struct { // Temporary security credentials Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"` // Credentials expiration time. A Unix timestamp will be returned which is accurate to the second ExpiredTime *int64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // Credentials expiration time in UTC time in ISO 8601 format. Expiration *string `json:"Expiration,omitempty" name:"Expiration"` // The unique request ID, which is returned for each request. RequestId is required for locating a problem. 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
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*AssumeRoleResponse) ToJsonString ¶
func (r *AssumeRoleResponse) ToJsonString() string
type AssumeRoleWithSAMLRequest ¶
type AssumeRoleWithSAMLRequest struct { *tchttp.BaseRequest // Base64-encoded SAML assertion SAMLAssertion *string `json:"SAMLAssertion,omitempty" name:"SAMLAssertion"` // Principal access description name PrincipalArn *string `json:"PrincipalArn,omitempty" name:"PrincipalArn"` // Role access description name RoleArn *string `json:"RoleArn,omitempty" name:"RoleArn"` // Session name RoleSessionName *string `json:"RoleSessionName,omitempty" name:"RoleSessionName"` // Specifies the validity period of credentials in seconds. Default value: 7200. Maximum value: 7200 DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"` }
func NewAssumeRoleWithSAMLRequest ¶
func NewAssumeRoleWithSAMLRequest() (request *AssumeRoleWithSAMLRequest)
func (*AssumeRoleWithSAMLRequest) FromJsonString ¶
func (r *AssumeRoleWithSAMLRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*AssumeRoleWithSAMLRequest) ToJsonString ¶
func (r *AssumeRoleWithSAMLRequest) ToJsonString() string
type AssumeRoleWithSAMLResponse ¶
type AssumeRoleWithSAMLResponse struct { *tchttp.BaseResponse Response *struct { // An object consists of the `Token`, `TmpSecretId`, and `TmpSecretId` Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"` // Credentials expiration time. A Unix timestamp will be returned which is accurate to the second ExpiredTime *uint64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // Credentials expiration time in UTC time in ISO 8601 format. Expiration *string `json:"Expiration,omitempty" name:"Expiration"` // The unique request ID, which is returned for each request. RequestId is required for locating a problem. 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
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*AssumeRoleWithSAMLResponse) ToJsonString ¶
func (r *AssumeRoleWithSAMLResponse) ToJsonString() string
type Client ¶
func NewClient ¶
func NewClient(credential common.CredentialIface, 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)
AssumeRole This API is used to request for the temporary security credentials of a role.
error code that may be returned:
INTERNALERROR_DBERROR = "InternalError.DbError" INTERNALERROR_ENCRYPTERROR = "InternalError.EncryptError" INTERNALERROR_GETAPPIDERROR = "InternalError.GetAppIdError" INTERNALERROR_GETROLEERROR = "InternalError.GetRoleError" INTERNALERROR_GETSEEDTOKENERROR = "InternalError.GetSeedTokenError" INTERNALERROR_ILLEGALROLE = "InternalError.IllegalRole" INTERNALERROR_PBSERIALIZEERROR = "InternalError.PbSerializeError" INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" INTERNALERROR_UNKNOWNERROR = "InternalError.UnknownError" INVALIDPARAMETER_ACCOUNTNOTAVALIABLE = "InvalidParameter.AccountNotAvaliable" INVALIDPARAMETER_EXTENDSTRATEGYOVERSIZE = "InvalidParameter.ExtendStrategyOverSize" INVALIDPARAMETER_GRANTOTHERRESOURCE = "InvalidParameter.GrantOtherResource" INVALIDPARAMETER_OVERLIMIT = "InvalidParameter.OverLimit" INVALIDPARAMETER_OVERTIMEERROR = "InvalidParameter.OverTimeError" INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" INVALIDPARAMETER_POLICYTOOLONG = "InvalidParameter.PolicyTooLong" INVALIDPARAMETER_RESOUCEERROR = "InvalidParameter.ResouceError" INVALIDPARAMETER_STRATEGYFORMATERROR = "InvalidParameter.StrategyFormatError" INVALIDPARAMETER_STRATEGYINVALID = "InvalidParameter.StrategyInvalid" INVALIDPARAMETER_TEMPCODENOTAVALIABLE = "InvalidParameter.TempCodeNotAvaliable" RESOURCENOTFOUND_ROLENOTFOUND = "ResourceNotFound.RoleNotFound" UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
func (*Client) AssumeRoleWithSAML ¶
func (c *Client) AssumeRoleWithSAML(request *AssumeRoleWithSAMLRequest) (response *AssumeRoleWithSAMLResponse, err error)
AssumeRoleWithSAML This API is used to request for the temporary credentials for a role that has been authenticated via a SAML assertion.
error code that may be returned:
INTERNALERROR_DBERROR = "InternalError.DbError" INTERNALERROR_ENCRYPTERROR = "InternalError.EncryptError" INTERNALERROR_GETAPPIDERROR = "InternalError.GetAppIdError" INTERNALERROR_GETROLEERROR = "InternalError.GetRoleError" INTERNALERROR_GETSEEDTOKENERROR = "InternalError.GetSeedTokenError" INTERNALERROR_ILLEGALROLE = "InternalError.IllegalRole" INTERNALERROR_PBSERIALIZEERROR = "InternalError.PbSerializeError" INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" INTERNALERROR_UNKNOWNERROR = "InternalError.UnknownError" INVALIDPARAMETER_ACCOUNTNOTAVALIABLE = "InvalidParameter.AccountNotAvaliable" INVALIDPARAMETER_EXTENDSTRATEGYOVERSIZE = "InvalidParameter.ExtendStrategyOverSize" INVALIDPARAMETER_GRANTOTHERRESOURCE = "InvalidParameter.GrantOtherResource" INVALIDPARAMETER_OVERTIMEERROR = "InvalidParameter.OverTimeError" INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" INVALIDPARAMETER_POLICYTOOLONG = "InvalidParameter.PolicyTooLong" INVALIDPARAMETER_RESOUCEERROR = "InvalidParameter.ResouceError" INVALIDPARAMETER_STRATEGYFORMATERROR = "InvalidParameter.StrategyFormatError" INVALIDPARAMETER_STRATEGYINVALID = "InvalidParameter.StrategyInvalid" INVALIDPARAMETER_TEMPCODENOTAVALIABLE = "InvalidParameter.TempCodeNotAvaliable" RESOURCENOTFOUND_ROLENOTFOUND = "ResourceNotFound.RoleNotFound" UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
func (*Client) GetFederationToken ¶
func (c *Client) GetFederationToken(request *GetFederationTokenRequest) (response *GetFederationTokenResponse, err error)
GetFederationToken This API is used to get temporary credentials for a federated user.
error code that may be returned:
INTERNALERROR_DBERROR = "InternalError.DbError" INTERNALERROR_ENCRYPTERROR = "InternalError.EncryptError" INTERNALERROR_GETAPPIDERROR = "InternalError.GetAppIdError" INTERNALERROR_GETSEEDTOKENERROR = "InternalError.GetSeedTokenError" INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" INVALIDPARAMETER_ACCOUNTNOTAVALIABLE = "InvalidParameter.AccountNotAvaliable" INVALIDPARAMETER_EXTENDSTRATEGYOVERSIZE = "InvalidParameter.ExtendStrategyOverSize" INVALIDPARAMETER_GRANTOTHERRESOURCE = "InvalidParameter.GrantOtherResource" INVALIDPARAMETER_OVERTIMEERROR = "InvalidParameter.OverTimeError" INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" INVALIDPARAMETER_POLICYTOOLONG = "InvalidParameter.PolicyTooLong" INVALIDPARAMETER_RESOUCEERROR = "InvalidParameter.ResouceError" INVALIDPARAMETER_STRATEGYFORMATERROR = "InvalidParameter.StrategyFormatError" INVALIDPARAMETER_STRATEGYINVALID = "InvalidParameter.StrategyInvalid" INVALIDPARAMETER_TEMPCODENOTAVALIABLE = "InvalidParameter.TempCodeNotAvaliable" RESOURCENOTFOUND_ROLENOTFOUND = "ResourceNotFound.RoleNotFound" UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
type Credentials ¶
type Credentials struct { // token Token *string `json:"Token,omitempty" name:"Token"` // Temporary credentials secret ID TmpSecretId *string `json:"TmpSecretId,omitempty" name:"TmpSecretId"` // Temporary credentials secret key TmpSecretKey *string `json:"TmpSecretKey,omitempty" name:"TmpSecretKey"` }
type GetFederationTokenRequest ¶
type GetFederationTokenRequest struct { *tchttp.BaseRequest // The customizable name of the caller, consisting of letters Name *string `json:"Name,omitempty" name:"Name"` // Policy description // Note: // 1. The policy needs to be URL-encoded (if you request a TencentCloud API through the GET method, all parameters must be URL-encoded again in accordance with [Signature v3](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) before the request is sent). // 2. For the policy syntax, please see CAM’s [Syntax Logic](https://cloud.tencent.com/document/product/598/10603). // 3. The policy cannot contain the `principal` element. Policy *string `json:"Policy,omitempty" name:"Policy"` // Specifies the validity period of credentials in seconds. Default value: 1800. Maximum value: 7200 DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"` }
func NewGetFederationTokenRequest ¶
func NewGetFederationTokenRequest() (request *GetFederationTokenRequest)
func (*GetFederationTokenRequest) FromJsonString ¶
func (r *GetFederationTokenRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*GetFederationTokenRequest) ToJsonString ¶
func (r *GetFederationTokenRequest) ToJsonString() string
type GetFederationTokenResponse ¶
type GetFederationTokenResponse struct { *tchttp.BaseResponse Response *struct { // Temporary credentials Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"` // Temporary credentials expiration time. A Unix timestamp will be returned which is accurate to the second ExpiredTime *uint64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // Credentials expiration time in UTC time in ISO 8601 format. // Note: this field may return null, indicating that no valid values can be obtained. Expiration *string `json:"Expiration,omitempty" name:"Expiration"` // The unique request ID, which is returned for each request. RequestId is required for locating a problem. 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
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*GetFederationTokenResponse) ToJsonString ¶
func (r *GetFederationTokenResponse) ToJsonString() string