-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add constructor overload to STSProfileCredentialsProvider
where the client factory returns a shared pointer.
#2830
Open
teo-tsirpanis
wants to merge
4
commits into
aws:main
Choose a base branch
from
teo-tsirpanis:spcp-shared-ptr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ Release | |
*# | ||
*.iml | ||
tags | ||
.vs | ||
.vscode | ||
|
||
# CI Artifacts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,7 +313,7 @@ TEST_F(STSProfileCredentialsProviderTest, AssumeRoleWithoutRoleARN) | |
|
||
STSProfileCredentialsProvider credsProvider("default", roleSessionDuration, [](const AWSCredentials&) { | ||
ADD_FAILURE() << "STS Service client should not be used in this scenario."; | ||
return nullptr; | ||
return (STSClient*)nullptr; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new constructor overload caused |
||
}); | ||
|
||
auto actualCredentials = credsProvider.GetAWSCredentials(); | ||
|
@@ -383,7 +383,7 @@ TEST_F(STSProfileCredentialsProviderTest, AssumeRoleWithoutSourceProfile) | |
|
||
STSProfileCredentialsProvider credsProvider("default", roleSessionDuration, [](const AWSCredentials&) { | ||
ADD_FAILURE() << "STS Service client should not be used in this scenario."; | ||
return nullptr; | ||
return (STSClient*)nullptr; | ||
}); | ||
|
||
auto actualCredentials = credsProvider.GetAWSCredentials(); | ||
|
@@ -409,7 +409,7 @@ TEST_F(STSProfileCredentialsProviderTest, AssumeRoleWithNonExistentSourceProfile | |
|
||
STSProfileCredentialsProvider credsProvider("default", roleSessionDuration, [](const AWSCredentials&) { | ||
ADD_FAILURE() << "STS Service client should not be used in this scenario."; | ||
return nullptr; | ||
return (STSClient*)nullptr; | ||
}); | ||
|
||
auto actualCredentials = credsProvider.GetAWSCredentials(); | ||
|
@@ -556,7 +556,7 @@ TEST_F(STSProfileCredentialsProviderTest, AssumeRoleSelfReferencingSourceProfile | |
|
||
Model::AssumeRoleResult mockResult; | ||
mockResult.SetCredentials(stsCredentials); | ||
Aws::UniquePtr<MockSTSClient> stsClient; | ||
std::shared_ptr<MockSTSClient> stsClient; | ||
|
||
int stsCallCounter = 0; | ||
|
||
|
@@ -572,9 +572,9 @@ TEST_F(STSProfileCredentialsProviderTest, AssumeRoleSelfReferencingSourceProfile | |
EXPECT_STREQ(ACCESS_KEY_ID_2, creds.GetAWSAccessKeyId().c_str()); | ||
EXPECT_STREQ(SECRET_ACCESS_KEY_ID_2, creds.GetAWSSecretKey().c_str()); | ||
} | ||
stsClient = Aws::MakeUnique<MockSTSClient>(CLASS_TAG, creds); | ||
stsClient = Aws::MakeShared<MockSTSClient>(CLASS_TAG, creds); | ||
stsClient->MockAssumeRole(mockResult); | ||
return stsClient.get(); | ||
return stsClient; | ||
}); | ||
|
||
auto actualCredentials = credsProvider.GetAWSCredentials(); | ||
|
@@ -614,7 +614,7 @@ TEST_F(STSProfileCredentialsProviderTest, AssumeRoleRecursivelyCircularReference | |
|
||
STSProfileCredentialsProvider credsProvider("default", roleSessionDuration, [](const AWSCredentials&) { | ||
ADD_FAILURE() << "STS Service client should not be used in this scenario."; | ||
return nullptr; | ||
return (STSClient*)nullptr; | ||
}); | ||
|
||
auto actualCredentials = credsProvider.GetAWSCredentials(); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuing discussion from #2839 (comment)
@sbera87 because we cannot safely
delete
an arbitrary pointer we have to create the shared pointer with a special deleter that does nothing.