talkiq / gcloud-aio

(Asyncio OR Threadsafe) Google Cloud Client Library for Python
https://talkiq.github.io/gcloud-aio
275 stars 90 forks source link

`external_account` is not a valid Token enum value #722

Open bjgbeelen opened 6 months ago

bjgbeelen commented 6 months ago

I'm using the gcloud-aio-kms package locally and in production without any issues, thanks for that!

I'm now also trying to run my integration tests in Github Actions. i am using OIDC to authenticate via my github repo to act as a specific service account with permissions that are required. It looks like this approach returns some unexpected Token values. external_account is apparently not a valid enum value.

Thought I'd at least make you aware of the issue right now. I hope I will find the time soon to provide a PR to fix this, if this is still an issue by that time!

 File "/home/runner/work/payments/payments/.venv/lib/python3.11/site-packages/gcloud/aio/auth/token.py", line 166, in __init__
    |     self.token_type = Type(self.service_data['type'])
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/nix/store/2m6gdzz77ikkc5xwp3iiqi901339frp7-python3-3.11.8-env/lib/python3.11/enum.py", line 712, in __call__
    |     return cls.__new__(cls, value)
    |            ^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/nix/store/2m6gdzz77ikkc5xwp3iiqi901339frp7-python3-3.11.8-env/lib/python3.11/enum.py", line 1135, in __new__
    |     raise ve_exc
    | ValueError: 'external_account' is not a valid Type
bjgbeelen commented 5 months ago

Related: https://google-auth.readthedocs.io/en/master/reference/google.auth.external_account.html