-
Notifications
You must be signed in to change notification settings - Fork 549
feat: Add credential type parameter to CredentialFactory #3064
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
feat: Add credential type parameter to CredentialFactory #3064
Conversation
Summary of ChangesHello @robertvoinescu-work, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant enhancements to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces new overloads to CredentialFactory that allow specifying the credential type as a string, which is a useful enhancement. The implementation is clean, with good refactoring to reduce code duplication, particularly in error handling for JSON deserialization. The accompanying tests are thorough, covering both success and failure cases for the new functionality. I have one high-severity comment regarding a missing null check that could lead to an unhandled exception.
8e94bfa to
75fc034
Compare
7b27ca5 to
d0b9008
Compare
41ddc03 to
783d7a5
Compare
amanda-tarafa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor changes. Thanks!
| }; | ||
|
|
||
| [Fact] | ||
| public void FromStream_WrapsDeserializationException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try one with a bad JSON also, you don't need to write the bad JSON to a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the additional test.
783d7a5 to
cf06ec7
Compare
Features: - googleapis#3064 Introduces methods to create a google credential by specifying the type and either a path to the credential or the credential as a json string. - googleapis#3059 Support loading scopes of impersonated credentials from file.
Features: - googleapis#3064 Adds methods to load a credential by specifying the type and either file path or json string. - googleapis#3059 Supports loading scopes for impersonated credentials from new optional `scopes` field.
This change introduces new overloads to the that allow specifying the credential type as a string parameter. This provides a way to create credentials from JSON data without having to specify the type statically.