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

publicly expose _default._load_credentials_from_info #1313

Closed
kapilt opened this issue May 28, 2023 · 3 comments · Fixed by #1326
Closed

publicly expose _default._load_credentials_from_info #1313

kapilt opened this issue May 28, 2023 · 3 comments · Fixed by #1326
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@kapilt
Copy link

kapilt commented May 28, 2023

at the moment the public interface is just google.auth.default() and load_credentials_from_file, but if we have a data dictionary already due to it being loaded from a non file source it would be nice to pass it directly to load_credentials_from_info https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/_default.py#L133

the load from file function is just a super thin wrapper to load from info.

afaics load_credentials_from_info is the most compatible across all the auth forms that gcp supports. (user default app, service account, external).

@clundin25
Copy link
Contributor

Hey @kapilt, can you expand on your use case a bit more? How is this dict being created?

@clundin25 clundin25 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label May 30, 2023
@kapilt
Copy link
Author

kapilt commented Jun 7, 2023

we're typically storing the credential info in a big table style data store, we want to be able to use service accounts, or workload identity federation information directly from the data store. using load_credentials_from_info would allow that, serializing to a temp file to using the existing interface is fairly extraneous.

@clundin25
Copy link
Contributor

@kapilt,

That sounds reasonable. I'll chat with the team and propose adding an API load_credentials_from_dict that will let applications use a dictionary instead of a file

clundin25 added a commit to clundin25/google-auth-library-python that referenced this issue Jun 7, 2023
…efault credential object from a dictionary.

This resolves googleapis#1313.
clundin25 added a commit to clundin25/google-auth-library-python that referenced this issue Jun 7, 2023
…efault credential object from a dictionary.

This resolves googleapis#1313.
clundin25 added a commit that referenced this issue Jun 8, 2023
feat: Add public API load_credentials_from_dict to allow creating a default credential object from a dictionary.

This resolves #1313.
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

Successfully merging a pull request may close this issue.

2 participants