google-cloud-rust icon indicating copy to clipboard operation
google-cloud-rust copied to clipboard

Unable to use `google_cloud_default` with Workload Identity

Open AlexanderBrevig opened this issue 2 years ago • 4 comments

It seems maybe the hardcoded dependency on default SA email prevents us from using this in our production environment using Workload Identity for application SA.

Do you accept PRs?

AlexanderBrevig avatar Jun 27 '23 08:06 AlexanderBrevig

Please make a PR and we will merge it.

I am currently disassembling google-cloud-default in https://github.com/yoshidan/google-cloud-rust/pull/172, after the merge will be easier to modify with interface changes.

yoshidan avatar Jun 27 '23 09:06 yoshidan

I just tried the two quick-win ideas I had but it does not seem to have done the trick. Not sure if I'll have time to deep dive into this, but I'll let you know if that changes.

Thanks for the work on this BTW 👍🏻

AlexanderBrevig avatar Jun 27 '23 10:06 AlexanderBrevig

Hi I am encountering issues using the auth crate with workload identity as well!

A few issues with parsing the JSON generated from workload identity:

  1. The Format struct expects a field name tp in JSON, but the generated JSON contains a field named "type" instead
  2. If I manually edit my JSON's field, I then encounter: unsupported account: external_account

jaychia avatar Sep 22 '23 00:09 jaychia

@jaychia Thank you for your report.

1.The Format struct expects a field name tp in JSON, but the generated JSON contains a field named "type" instead

Now I added the rename option to deserialize type https://github.com/yoshidan/google-cloud-rust/pull/195/files

  1. If I manually edit my JSON's field, I then encounter: unsupported account: external_account

Is the external-account feature enabled? ex)

google-cloud-pubsub = { version="0.18.0", default-features=false, features=["trace", "auth", "external-account", "rustls-tls"]}

https://github.com/yoshidan/google-cloud-rust/pull/180

yoshidan avatar Sep 23 '23 08:09 yoshidan