Supported AssumeRoleWithOIDC.
This commit is contained in:
@@ -39,20 +39,20 @@ void AssumeRoleResult::parse(const std::string &payload)
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto assumedRoleUserNode = value["AssumedRoleUser"];
|
||||
if(!assumedRoleUserNode["AssumedRoleId"].isNull())
|
||||
assumedRoleUser_.assumedRoleId = assumedRoleUserNode["AssumedRoleId"].asString();
|
||||
if(!assumedRoleUserNode["Arn"].isNull())
|
||||
assumedRoleUser_.arn = assumedRoleUserNode["Arn"].asString();
|
||||
auto credentialsNode = value["Credentials"];
|
||||
if(!credentialsNode["SecurityToken"].isNull())
|
||||
credentials_.securityToken = credentialsNode["SecurityToken"].asString();
|
||||
if(!credentialsNode["Expiration"].isNull())
|
||||
credentials_.expiration = credentialsNode["Expiration"].asString();
|
||||
if(!credentialsNode["AccessKeySecret"].isNull())
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
if(!credentialsNode["Expiration"].isNull())
|
||||
credentials_.expiration = credentialsNode["Expiration"].asString();
|
||||
auto assumedRoleUserNode = value["AssumedRoleUser"];
|
||||
if(!assumedRoleUserNode["Arn"].isNull())
|
||||
assumedRoleUser_.arn = assumedRoleUserNode["Arn"].asString();
|
||||
if(!assumedRoleUserNode["AssumedRoleId"].isNull())
|
||||
assumedRoleUser_.assumedRoleId = assumedRoleUserNode["AssumedRoleId"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
95
sts/src/model/AssumeRoleWithOIDCRequest.cc
Normal file
95
sts/src/model/AssumeRoleWithOIDCRequest.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/sts/model/AssumeRoleWithOIDCRequest.h>
|
||||
|
||||
using AlibabaCloud::Sts::Model::AssumeRoleWithOIDCRequest;
|
||||
|
||||
AssumeRoleWithOIDCRequest::AssumeRoleWithOIDCRequest() :
|
||||
RpcServiceRequest("sts", "2015-04-01", "AssumeRoleWithOIDC")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
AssumeRoleWithOIDCRequest::~AssumeRoleWithOIDCRequest()
|
||||
{}
|
||||
|
||||
std::string AssumeRoleWithOIDCRequest::getRoleArn()const
|
||||
{
|
||||
return roleArn_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithOIDCRequest::setRoleArn(const std::string& roleArn)
|
||||
{
|
||||
roleArn_ = roleArn;
|
||||
setParameter("RoleArn", roleArn);
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithOIDCRequest::getRoleSessionName()const
|
||||
{
|
||||
return roleSessionName_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithOIDCRequest::setRoleSessionName(const std::string& roleSessionName)
|
||||
{
|
||||
roleSessionName_ = roleSessionName;
|
||||
setParameter("RoleSessionName", roleSessionName);
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithOIDCRequest::getOIDCToken()const
|
||||
{
|
||||
return oIDCToken_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithOIDCRequest::setOIDCToken(const std::string& oIDCToken)
|
||||
{
|
||||
oIDCToken_ = oIDCToken;
|
||||
setParameter("OIDCToken", oIDCToken);
|
||||
}
|
||||
|
||||
long AssumeRoleWithOIDCRequest::getDurationSeconds()const
|
||||
{
|
||||
return durationSeconds_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithOIDCRequest::setDurationSeconds(long durationSeconds)
|
||||
{
|
||||
durationSeconds_ = durationSeconds;
|
||||
setParameter("DurationSeconds", std::to_string(durationSeconds));
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithOIDCRequest::getOIDCProviderArn()const
|
||||
{
|
||||
return oIDCProviderArn_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithOIDCRequest::setOIDCProviderArn(const std::string& oIDCProviderArn)
|
||||
{
|
||||
oIDCProviderArn_ = oIDCProviderArn;
|
||||
setParameter("OIDCProviderArn", oIDCProviderArn);
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithOIDCRequest::getPolicy()const
|
||||
{
|
||||
return policy_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithOIDCRequest::setPolicy(const std::string& policy)
|
||||
{
|
||||
policy_ = policy;
|
||||
setParameter("Policy", policy);
|
||||
}
|
||||
|
||||
80
sts/src/model/AssumeRoleWithOIDCResult.cc
Normal file
80
sts/src/model/AssumeRoleWithOIDCResult.cc
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/sts/model/AssumeRoleWithOIDCResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Sts;
|
||||
using namespace AlibabaCloud::Sts::Model;
|
||||
|
||||
AssumeRoleWithOIDCResult::AssumeRoleWithOIDCResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
AssumeRoleWithOIDCResult::AssumeRoleWithOIDCResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
AssumeRoleWithOIDCResult::~AssumeRoleWithOIDCResult()
|
||||
{}
|
||||
|
||||
void AssumeRoleWithOIDCResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto oIDCTokenInfoNode = value["OIDCTokenInfo"];
|
||||
if(!oIDCTokenInfoNode["Subject"].isNull())
|
||||
oIDCTokenInfo_.subject = oIDCTokenInfoNode["Subject"].asString();
|
||||
if(!oIDCTokenInfoNode["Issuer"].isNull())
|
||||
oIDCTokenInfo_.issuer = oIDCTokenInfoNode["Issuer"].asString();
|
||||
if(!oIDCTokenInfoNode["ClientIds"].isNull())
|
||||
oIDCTokenInfo_.clientIds = oIDCTokenInfoNode["ClientIds"].asString();
|
||||
auto assumedRoleUserNode = value["AssumedRoleUser"];
|
||||
if(!assumedRoleUserNode["AssumedRoleId"].isNull())
|
||||
assumedRoleUser_.assumedRoleId = assumedRoleUserNode["AssumedRoleId"].asString();
|
||||
if(!assumedRoleUserNode["Arn"].isNull())
|
||||
assumedRoleUser_.arn = assumedRoleUserNode["Arn"].asString();
|
||||
auto credentialsNode = value["Credentials"];
|
||||
if(!credentialsNode["SecurityToken"].isNull())
|
||||
credentials_.securityToken = credentialsNode["SecurityToken"].asString();
|
||||
if(!credentialsNode["Expiration"].isNull())
|
||||
credentials_.expiration = credentialsNode["Expiration"].asString();
|
||||
if(!credentialsNode["AccessKeySecret"].isNull())
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
|
||||
}
|
||||
|
||||
AssumeRoleWithOIDCResult::OIDCTokenInfo AssumeRoleWithOIDCResult::getOIDCTokenInfo()const
|
||||
{
|
||||
return oIDCTokenInfo_;
|
||||
}
|
||||
|
||||
AssumeRoleWithOIDCResult::AssumedRoleUser AssumeRoleWithOIDCResult::getAssumedRoleUser()const
|
||||
{
|
||||
return assumedRoleUser_;
|
||||
}
|
||||
|
||||
AssumeRoleWithOIDCResult::Credentials AssumeRoleWithOIDCResult::getCredentials()const
|
||||
{
|
||||
return credentials_;
|
||||
}
|
||||
|
||||
@@ -39,29 +39,29 @@ void AssumeRoleWithSAMLResult::parse(const std::string &payload)
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto credentialsNode = value["Credentials"];
|
||||
if(!credentialsNode["SecurityToken"].isNull())
|
||||
credentials_.securityToken = credentialsNode["SecurityToken"].asString();
|
||||
if(!credentialsNode["AccessKeySecret"].isNull())
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
if(!credentialsNode["Expiration"].isNull())
|
||||
credentials_.expiration = credentialsNode["Expiration"].asString();
|
||||
auto sAMLAssertionInfoNode = value["SAMLAssertionInfo"];
|
||||
if(!sAMLAssertionInfoNode["SubjectType"].isNull())
|
||||
sAMLAssertionInfo_.subjectType = sAMLAssertionInfoNode["SubjectType"].asString();
|
||||
if(!sAMLAssertionInfoNode["Issuer"].isNull())
|
||||
sAMLAssertionInfo_.issuer = sAMLAssertionInfoNode["Issuer"].asString();
|
||||
if(!sAMLAssertionInfoNode["Recipient"].isNull())
|
||||
sAMLAssertionInfo_.recipient = sAMLAssertionInfoNode["Recipient"].asString();
|
||||
if(!sAMLAssertionInfoNode["Subject"].isNull())
|
||||
sAMLAssertionInfo_.subject = sAMLAssertionInfoNode["Subject"].asString();
|
||||
auto assumedRoleUserNode = value["AssumedRoleUser"];
|
||||
if(!assumedRoleUserNode["Arn"].isNull())
|
||||
assumedRoleUser_.arn = assumedRoleUserNode["Arn"].asString();
|
||||
if(!assumedRoleUserNode["AssumedRoleId"].isNull())
|
||||
assumedRoleUser_.assumedRoleId = assumedRoleUserNode["AssumedRoleId"].asString();
|
||||
auto sAMLAssertionInfoNode = value["SAMLAssertionInfo"];
|
||||
if(!sAMLAssertionInfoNode["SubjectType"].isNull())
|
||||
sAMLAssertionInfo_.subjectType = sAMLAssertionInfoNode["SubjectType"].asString();
|
||||
if(!sAMLAssertionInfoNode["Subject"].isNull())
|
||||
sAMLAssertionInfo_.subject = sAMLAssertionInfoNode["Subject"].asString();
|
||||
if(!sAMLAssertionInfoNode["Recipient"].isNull())
|
||||
sAMLAssertionInfo_.recipient = sAMLAssertionInfoNode["Recipient"].asString();
|
||||
if(!sAMLAssertionInfoNode["Issuer"].isNull())
|
||||
sAMLAssertionInfo_.issuer = sAMLAssertionInfoNode["Issuer"].asString();
|
||||
auto credentialsNode = value["Credentials"];
|
||||
if(!credentialsNode["SecurityToken"].isNull())
|
||||
credentials_.securityToken = credentialsNode["SecurityToken"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
if(!credentialsNode["AccessKeySecret"].isNull())
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["Expiration"].isNull())
|
||||
credentials_.expiration = credentialsNode["Expiration"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/sts/model/GenerateSessionAccessKeyRequest.h>
|
||||
|
||||
using AlibabaCloud::Sts::Model::GenerateSessionAccessKeyRequest;
|
||||
|
||||
GenerateSessionAccessKeyRequest::GenerateSessionAccessKeyRequest() :
|
||||
RpcServiceRequest("sts", "2015-04-01", "GenerateSessionAccessKey")
|
||||
{}
|
||||
|
||||
GenerateSessionAccessKeyRequest::~GenerateSessionAccessKeyRequest()
|
||||
{}
|
||||
|
||||
long GenerateSessionAccessKeyRequest::getDurationSeconds()const
|
||||
{
|
||||
return durationSeconds_;
|
||||
}
|
||||
|
||||
void GenerateSessionAccessKeyRequest::setDurationSeconds(long durationSeconds)
|
||||
{
|
||||
durationSeconds_ = durationSeconds;
|
||||
setParameter("DurationSeconds", std::to_string(durationSeconds));
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/sts/model/GenerateSessionAccessKeyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Sts;
|
||||
using namespace AlibabaCloud::Sts::Model;
|
||||
|
||||
GenerateSessionAccessKeyResult::GenerateSessionAccessKeyResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GenerateSessionAccessKeyResult::GenerateSessionAccessKeyResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GenerateSessionAccessKeyResult::~GenerateSessionAccessKeyResult()
|
||||
{}
|
||||
|
||||
void GenerateSessionAccessKeyResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto sessionAccessKeyNode = value["SessionAccessKey"];
|
||||
if(!sessionAccessKeyNode["SessionAccessKeyId"].isNull())
|
||||
sessionAccessKey_.sessionAccessKeyId = sessionAccessKeyNode["SessionAccessKeyId"].asString();
|
||||
if(!sessionAccessKeyNode["SessionAccessKeySecret"].isNull())
|
||||
sessionAccessKey_.sessionAccessKeySecret = sessionAccessKeyNode["SessionAccessKeySecret"].asString();
|
||||
if(!sessionAccessKeyNode["Expiration"].isNull())
|
||||
sessionAccessKey_.expiration = sessionAccessKeyNode["Expiration"].asString();
|
||||
|
||||
}
|
||||
|
||||
GenerateSessionAccessKeyResult::SessionAccessKey GenerateSessionAccessKeyResult::getSessionAccessKey()const
|
||||
{
|
||||
return sessionAccessKey_;
|
||||
}
|
||||
|
||||
@@ -39,18 +39,18 @@ void GetCallerIdentityResult::parse(const std::string &payload)
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["AccountId"].isNull())
|
||||
accountId_ = value["AccountId"].asString();
|
||||
if(!value["UserId"].isNull())
|
||||
userId_ = value["UserId"].asString();
|
||||
if(!value["RoleId"].isNull())
|
||||
roleId_ = value["RoleId"].asString();
|
||||
if(!value["Arn"].isNull())
|
||||
arn_ = value["Arn"].asString();
|
||||
if(!value["IdentityType"].isNull())
|
||||
identityType_ = value["IdentityType"].asString();
|
||||
if(!value["AccountId"].isNull())
|
||||
accountId_ = value["AccountId"].asString();
|
||||
if(!value["PrincipalId"].isNull())
|
||||
principalId_ = value["PrincipalId"].asString();
|
||||
if(!value["UserId"].isNull())
|
||||
userId_ = value["UserId"].asString();
|
||||
if(!value["Arn"].isNull())
|
||||
arn_ = value["Arn"].asString();
|
||||
if(!value["RoleId"].isNull())
|
||||
roleId_ = value["RoleId"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user