Skip to content
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

feat: adds service account impersonation to ExternalAccountClient #1041

Merged
merged 10 commits into from
Aug 18, 2020
Merged

feat: adds service account impersonation to ExternalAccountClient #1041

merged 10 commits into from
Aug 18, 2020

Conversation

bojeil-google
Copy link
Contributor

If the service_account_impersonation_url is provided, an additional step to exchange the external account GCP access token for a service account impersonated token is performed.

This is needed because many Google Cloud services do not yet support external account GCP access tokens.

grayside and others added 10 commits August 7, 2020 16:32
* chore: updated samples/package.json [ci skip]

* chore: updated CHANGELOG.md [ci skip]

* chore: updated package.json

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/5f7f9c6d-c75a-4c60-8bb8-0026a14cead7/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@94421c4
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@bd0deaa
This PR was generated using Autosynth. 🌈



- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@5747555
* chore: updated samples/package.json [ci skip]

* chore: updated CHANGELOG.md [ci skip]

* chore: updated package.json

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
If the service_account_impersonation_url is provided, an additional
step to exchange the external account GCP access token for a service
account impersonated token is performed.

This is needed because many Google Cloud services do not yet support
external account GCP access tokens.
@bojeil-google bojeil-google requested a review from a team as a code owner August 15, 2020 02:17
@codecov
Copy link

codecov bot commented Aug 15, 2020

Codecov Report

❗ No coverage uploaded for pull request base (byoid@1174e4a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             byoid    #1041   +/-   ##
========================================
  Coverage         ?   92.95%           
========================================
  Files            ?       24           
  Lines            ?     4952           
  Branches         ?      572           
========================================
  Hits             ?     4603           
  Misses           ?      349           
  Partials         ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1174e4a...b0aa591. Read the comment docs.

@google-cla
Copy link

google-cla bot commented Aug 15, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 15, 2020
@bojeil-google
Copy link
Contributor Author

Note that the changes in test.externalclient.ts are half of what they actually appear in the GitHub diff. Visual code seems to catch the indentations and not treat them as changes whereas GitHub detects them as new changes.

Previous structure:

describe('getAccessToken()', () => {
  it('test1', () => {
  }),
  it('test2', () => {
  }),
  ...
});

New changes:

describe('getAccessToken()', () => {
  // Same existing tests.
  describe('without service account impersonation', () => {
    it('test1', () => {
    }),
    it('test2', () => {
    }),
    ...
  });
  
  // New tests with sa impersonation.
  describe('with service account impersonation', () => {
    it('test1 with sa impersonation', () => {
    }),
    it('test2 with sa impersonation', () => {
    }),
    ...
  });
});

@bcoe
Copy link
Contributor

bcoe commented Aug 18, 2020

Screen Shot 2020-08-17 at 6 41 08 PM

☝️ @JustinBeckwith pointed this setting out to me the other day, if you ever bump into a situation where whitespace is making review hard.

@bojeil-google
Copy link
Contributor Author

Screen Shot 2020-08-17 at 6 41 08 PM

☝️ @JustinBeckwith pointed this setting out to me the other day, if you ever bump into a situation where whitespace is making review hard.

👍 Wow, this is super helpful. I didn't know about this. Thanks for sharing. I don't know why this setting isn't on by default.

@bcoe bcoe merged commit 424755c into googleapis:byoid Aug 18, 2020
bcoe added a commit that referenced this pull request Feb 6, 2021
feat: implements the OAuth token exchange spec based on rfc8693 (#1026)
feat: defines ExternalAccountClient abstract class for external_account credentials (#1030)
feat: adds service account impersonation to `ExternalAccountClient` (#1041)
feat: defines `IdentityPoolClient` used for K8s and Azure workloads (#1042)
feat: implements AWS signature version 4 for signing requests (#1047)
feat: defines `ExternalAccountClient` used to instantiate external account clients (#1050)
feat!: integrates external_accounts with `GoogleAuth` and ADC (#1052)
feat: adds text/json credential_source support to IdentityPoolClients (#1059)
feat: get AWS region from environment variable (#1067)
Co-authored-by: Wilfred van der Deijl <wilfred@vanderdeijl.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no This human has *not* signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants