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: support for getProjectId in external account credentials (workforce pools) #483

Open
bshaffer opened this issue Oct 5, 2023 · 0 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@bshaffer
Copy link
Contributor

bshaffer commented Oct 5, 2023

See #474
See Python's implementation for Workforce credentials

As part of Workforce Credentials, we will need support getting a ProjectID (e.g. implementing ProjectIdProviderInterface) in ExternalAccountCredentials. Here's examples of how this is done in other languages:

From the audience:

  1. Parse the project number from the audience string
  2. Exchange the project number for a project ID

From Workload Identity Pool

  1. Get workforce pool user project from the JSON file
  2. Exchange for a project ID (same as above)

IMPORTANT: Because the caching layer for the auth library is currently implemented in a FetchAuthTokenCache class (which is a pattern that has caused us a lot of headache), we will need to consider refactoring caching implementation to make this feature work. One way would be to implement the CacheTrait. Another would be to have it extend FetchAuthTokenCache. A third option would be create a new AuthTokenCacheTrait which contains logic from FetchAuthTokenCache to be shared between the two classes. A potentially larger refactor is also on the table (see https://github.com/googleapis/google-auth-library-php/pull/322/files)

@bshaffer bshaffer changed the title Add support for ProjectIdProviderInterface to external account credentials feat: support for ProjectIdProviderInterface to external account credentials (workforce pools) Oct 9, 2023
@bshaffer bshaffer changed the title feat: support for ProjectIdProviderInterface to external account credentials (workforce pools) feat: support for getProjectId in external account credentials (workforce pools) Oct 9, 2023
@saranshdhingra saranshdhingra added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants