Public AssumeRole AssumeRoleWithSAML AssumeRoleWithOIDC for supporting sourceIdentity.
This commit is contained in:
@@ -31,21 +31,21 @@ StsClient::StsClient(const Credentials &credentials, const ClientConfiguration &
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "sts");
|
||||
}
|
||||
|
||||
StsClient::StsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "sts");
|
||||
}
|
||||
|
||||
StsClient::StsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "sts");
|
||||
}
|
||||
|
||||
StsClient::~StsClient()
|
||||
|
||||
@@ -34,6 +34,15 @@ void AssumeRoleRequest::setExternalId(const std::string &externalId) {
|
||||
setParameter(std::string("ExternalId"), externalId);
|
||||
}
|
||||
|
||||
std::string AssumeRoleRequest::getSourceIdentity() const {
|
||||
return sourceIdentity_;
|
||||
}
|
||||
|
||||
void AssumeRoleRequest::setSourceIdentity(const std::string &sourceIdentity) {
|
||||
sourceIdentity_ = sourceIdentity;
|
||||
setParameter(std::string("SourceIdentity"), sourceIdentity);
|
||||
}
|
||||
|
||||
std::string AssumeRoleRequest::getRoleSessionName() const {
|
||||
return roleSessionName_;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,16 @@ void AssumeRoleResult::parse(const std::string &payload)
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
if(!value["SourceIdentity"].isNull())
|
||||
sourceIdentity_ = value["SourceIdentity"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string AssumeRoleResult::getSourceIdentity()const
|
||||
{
|
||||
return sourceIdentity_;
|
||||
}
|
||||
|
||||
AssumeRoleResult::AssumedRoleUser AssumeRoleResult::getAssumedRoleUser()const
|
||||
{
|
||||
return assumedRoleUser_;
|
||||
|
||||
@@ -66,9 +66,16 @@ void AssumeRoleWithOIDCResult::parse(const std::string &payload)
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
if(!value["SourceIdentity"].isNull())
|
||||
sourceIdentity_ = value["SourceIdentity"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithOIDCResult::getSourceIdentity()const
|
||||
{
|
||||
return sourceIdentity_;
|
||||
}
|
||||
|
||||
AssumeRoleWithOIDCResult::OIDCTokenInfo AssumeRoleWithOIDCResult::getOIDCTokenInfo()const
|
||||
{
|
||||
return oIDCTokenInfo_;
|
||||
|
||||
@@ -62,9 +62,16 @@ void AssumeRoleWithSAMLResult::parse(const std::string &payload)
|
||||
credentials_.accessKeySecret = credentialsNode["AccessKeySecret"].asString();
|
||||
if(!credentialsNode["AccessKeyId"].isNull())
|
||||
credentials_.accessKeyId = credentialsNode["AccessKeyId"].asString();
|
||||
if(!value["SourceIdentity"].isNull())
|
||||
sourceIdentity_ = value["SourceIdentity"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithSAMLResult::getSourceIdentity()const
|
||||
{
|
||||
return sourceIdentity_;
|
||||
}
|
||||
|
||||
AssumeRoleWithSAMLResult::SAMLAssertionInfo AssumeRoleWithSAMLResult::getSAMLAssertionInfo()const
|
||||
{
|
||||
return sAMLAssertionInfo_;
|
||||
|
||||
Reference in New Issue
Block a user