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

ServiceAccountCredentials tokens are not renewed automatically #325

Open
leandrogoe opened this issue Jul 26, 2021 · 0 comments
Open

ServiceAccountCredentials tokens are not renewed automatically #325

leandrogoe opened this issue Jul 26, 2021 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@leandrogoe
Copy link

leandrogoe commented Jul 26, 2021

Environment details

  • OS: macOS 10.15.7
  • Ruby version: 2.6.1
  • Gem name and version: 0.14.0

Steps to reproduce

  1. Create a service account and a cloud run service
  2. Grant roles/run.invoker to your service account
  3. Generate a key-file for your service account
  4. Create your credentials object, using your key-file and you service url:
    credentials = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: File.open(keyfile), target_audience: service_url)
  5. Invoke your service using the headers generated by credentials.apply!({})
  6. This works! Now wait for an hour+.
  7. Generate new headers by calling credentials.apply!({}) again and call your service.
  8. It fails with an authorization error.

Background

Normally I would not expect the gem to handle the automatic renewal of the token, but since I found that there's already code to renew it automatically I presume this is a bug from the gem.

Thanks in advance!

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jul 27, 2021
@dazuma dazuma added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 18, 2021
@yoshi-automation yoshi-automation removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Nov 3, 2021
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants