class TencentCloud::Common::OIDCCredential
def refresh
def refresh if @expire_t - Time.now.to_i > SES_DUR / 10 return end initialize_args client = AbstractClient.new(nil, @region, API_VERSION, API_ENDPOINT, SDK_VERSION, nil) req = { 'ProviderId': @provider_id, 'WebIdentityToken': @token, 'RoleArn': @role_arn, 'RoleSessionName': @ses_name, 'DurationSeconds': @ses_dur, } response = JSON.parse(client.send_request(API_ACTION, req)) if response['Response'].key?('Error') code = response['Response']['Error']['Code'] message = response['Response']['Error']['Message'] reqid = response['Response']['RequestId'] raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) end @secret_id = response['Response']['Credentials']['TmpSecretId'] @secret_key = response['Response']['Credentials']['TmpSecretKey'] @token = response['Response']['Credentials']['Token'] @expire_t = response['Response']['ExpiredTime'] end