-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
(A single, complete) Cloud Client Library for IAM #11572
Comments
Thanks for the feedback @rrrix! This is definitely something that needs to be fixed. I'll investigate if it's possible to make improvements in a non-breaking way. I've labeled this as a bug and added it to our internal backlog. |
100% agree, and had the same experience. It seems like a strange omission to not have nice APIs for IAM, and have to use the old-style dynamic client (ugh). Things like listing roles, etc Compare the service approach which returns typeless dict:
Vs below (example) which returns nicely typed structure
|
Any update on this? What's the preferred way to, for example, get the list of all service accounts? |
AFAIK the only way is to use the API wrapper client and build the service through it (here is the example: https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/list). I have to double down on my support for this - particularly for this service, but also for others (DNS, for example). IAM is a foundational aspect of writing applications that interact with GCP and I feel like I spend 90% of my time trying to decipher and compare what's available to me between the client libraries and the APIs. |
Thanks for the answer! That's indeed what I ended up doing. +1 for a proper IAM support... |
I'm going to transfer this issue to the |
I'm cross-posting this from googleapis/google-cloud-python #10643, because it's not clear where's actually supposed to go...
Hi Googlers,
I'm requesting the Identity and Access Management IAM API (e.g.
https://iam.googleapis.com
) be added as a supported Python Cloud Client Library.I believe it is both reasonable and expected for the existing Identity and Access Management (python-iam) package fully support all IAM APIs. That was my first place to look for working with IAM Roles, Permissions, and Service Accounts. I thought my brain was having a short circuit and that I made a mistake when I saw what is really only the Service Account Credentials API (e.g.
https://iamcredentials.googleapis.com
).As far as code generation goes, googleapis/googleapis has full and complete definitions for all IAM APIs:
iam.googleapis.com
admin/v1
Resources (Service Accounts, Service Account Keys, Roles, Permissions)python-iam
package.iamcredentials.googleapis.com
iam-meta-api.googleapis.com
iam.googleapis.com
v1beta
Workload Identity Poolsiam.googleapis.com
v2beta
IAM Policies APII was a little surprised to find IAM does not have complete support in the Python Cloud Client Libraries. Seems like an oversight? I mean... You can't really do Google Cloud without IAM... :)
Also, it might be worth looking at how the current "IAM" libraries are named / described, since it's very confusing unless you take a few hours to read through all of the code and documentation for each of the packages (as I did).
To be honest, it was a poor developer/user experience constantly being directed to use Client Libraries that don't exist.
Currently, Python Cloud Client Libraries lists two different versions of "Identity and Access Management" packages, one "IAM Logging Protos" package and one "IAM Policy Troubleshooter API" package listed in the README:
I'm not sure why the first two are both called "Identity and Access Management" when neither of them are full IAM APIs. The "IAM Logging Protos" is the only library appropriately named for its specific limited subset of IAM functionality.
The python-grpc-google-iam-v1 package is even more mysterious, as it a single subdirectory (iam/v1/) which appears to be generated or copied from the googleapis/google/iam interface definitions. 🤔
I hope we can get a nice idiomatic & Pythonic Google Cloud IAM SDK at some point. Thanks in advance!
The text was updated successfully, but these errors were encountered: