fix: service account impersonation with workforce credentials#770
Merged
lsirac merged 10 commits intogoogleapis:mainfrom Oct 21, 2021
lsirac:sa_wf
Merged
fix: service account impersonation with workforce credentials#770lsirac merged 10 commits intogoogleapis:mainfrom lsirac:sa_wf
lsirac merged 10 commits intogoogleapis:mainfrom
lsirac:sa_wf
Conversation
TimurSadykov
left a comment
There was a problem hiding this comment.
Some general comments for now. Can you please highlight the bugfix itself? Otherwise refactoring hides it
oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentials.java
Outdated
Show resolved
Hide resolved
oauth2_http/javatests/com/google/auth/oauth2/ExternalAccountCredentialsTest.java
Show resolved
Hide resolved
TimurSadykov
suggested changes
Oct 19, 2021
TimurSadykov
left a comment
There was a problem hiding this comment.
Looks good, couple small comments
oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentials.java
Outdated
Show resolved
Hide resolved
Neenu1995
approved these changes
Oct 20, 2021
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Nov 10, 2021
🤖 I have created a release \*beep\* \*boop\* --- ## [1.3.0](https://www.github.com/googleapis/google-auth-library-java/compare/v1.2.2...v1.3.0) (2021-11-10) ### Features * next release from main branch is 1.3.0 ([#780](https://www.github.com/googleapis/google-auth-library-java/issues/780)) ([1149581](https://www.github.com/googleapis/google-auth-library-java/commit/1149581e63267e3553c74ba2114d849c5b24f27b)) ### Bug Fixes * **java:** java 17 dependency arguments ([#1266](https://www.github.com/googleapis/google-auth-library-java/issues/1266)) ([#779](https://www.github.com/googleapis/google-auth-library-java/issues/779)) ([9160a53](https://www.github.com/googleapis/google-auth-library-java/commit/9160a53e6507c1c938795e181c65ad80db1bcf11)) * service account impersonation with workforce credentials ([#770](https://www.github.com/googleapis/google-auth-library-java/issues/770)) ([6449ef0](https://www.github.com/googleapis/google-auth-library-java/commit/6449ef0922053121a6732933ab9e246965fde3b7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While service account impersonation is not commonly used with workforce
pool configurations, there is a bug where the workforcePoolUserProject is not being set on the source credential.
This also lets us align with other languages who added the workforcePoolUserProject to the base class, instead of IdentityPoolCredentials (though it is the only one that currently supports it).
The bug itself is fixed by the refactor. By moving workforcePoolUserProject to be set in the base constructor, it is set before initializeImpersonatedCredentials() is called. A copy of the source credential is then made that has the workforcePoolUserProject set. Prior to this it was not set and the impersonation call resulted in a 403.