Public AssumeRole AssumeRoleWithSAML AssumeRoleWithOIDC for supporting sourceIdentity.
This commit is contained in:
@@ -32,6 +32,8 @@ public:
|
||||
~AssumeRoleRequest();
|
||||
std::string getExternalId() const;
|
||||
void setExternalId(const std::string &externalId);
|
||||
std::string getSourceIdentity() const;
|
||||
void setSourceIdentity(const std::string &sourceIdentity);
|
||||
std::string getRoleSessionName() const;
|
||||
void setRoleSessionName(const std::string &roleSessionName);
|
||||
std::string getPolicy() const;
|
||||
@@ -43,6 +45,7 @@ public:
|
||||
|
||||
private:
|
||||
std::string externalId_;
|
||||
std::string sourceIdentity_;
|
||||
std::string roleSessionName_;
|
||||
std::string policy_;
|
||||
std::string roleArn_;
|
||||
|
||||
@@ -49,12 +49,14 @@ namespace AlibabaCloud
|
||||
AssumeRoleResult();
|
||||
explicit AssumeRoleResult(const std::string &payload);
|
||||
~AssumeRoleResult();
|
||||
std::string getSourceIdentity()const;
|
||||
AssumedRoleUser getAssumedRoleUser()const;
|
||||
Credentials getCredentials()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string sourceIdentity_;
|
||||
AssumedRoleUser assumedRoleUser_;
|
||||
Credentials credentials_;
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace AlibabaCloud
|
||||
AssumeRoleWithOIDCResult();
|
||||
explicit AssumeRoleWithOIDCResult(const std::string &payload);
|
||||
~AssumeRoleWithOIDCResult();
|
||||
std::string getSourceIdentity()const;
|
||||
OIDCTokenInfo getOIDCTokenInfo()const;
|
||||
AssumedRoleUser getAssumedRoleUser()const;
|
||||
Credentials getCredentials()const;
|
||||
@@ -65,6 +66,7 @@ namespace AlibabaCloud
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string sourceIdentity_;
|
||||
OIDCTokenInfo oIDCTokenInfo_;
|
||||
AssumedRoleUser assumedRoleUser_;
|
||||
Credentials credentials_;
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace AlibabaCloud
|
||||
AssumeRoleWithSAMLResult();
|
||||
explicit AssumeRoleWithSAMLResult(const std::string &payload);
|
||||
~AssumeRoleWithSAMLResult();
|
||||
std::string getSourceIdentity()const;
|
||||
SAMLAssertionInfo getSAMLAssertionInfo()const;
|
||||
AssumedRoleUser getAssumedRoleUser()const;
|
||||
Credentials getCredentials()const;
|
||||
@@ -63,6 +64,7 @@ namespace AlibabaCloud
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string sourceIdentity_;
|
||||
SAMLAssertionInfo sAMLAssertionInfo_;
|
||||
AssumedRoleUser assumedRoleUser_;
|
||||
Credentials credentials_;
|
||||
|
||||
@@ -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