impl(v3): add support for creating OAuth SA creds from files#15887
Conversation
Summary of ChangesHello @scotthart, 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 is a foundational step in transitioning the OAuth2 API from a GCS-specific implementation to the more versatile GUAC API. It introduces the essential capability to load service account credentials from external JSON and PKCS#12 files, ensuring feature parity with the previous system. The changes involve significant internal refactoring to support these file-based configurations consistently across both gRPC and REST transport layers, paving the way for the eventual decommissioning of the older API. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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.
Code Review
This pull request is a solid step towards unifying credential handling by adding support for creating service account credentials from files. The changes are well-structured, introducing a new factory function MakeServiceAccountCredentialsFromFile and updating internal configurations to handle either a JSON object string or a file path. The implementation correctly dispatches to file-based loading for both gRPC and REST transports, respecting transport-specific limitations.
I've identified a potential crash in a test utility due to unsafe optional dereferencing, which should be addressed. I've also pointed out a minor code duplication that could be refactored for better maintainability. Overall, this is a good contribution.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## prepare-for-v3.0.0 #15887 +/- ##
======================================================
- Coverage 92.87% 92.85% -0.03%
======================================================
Files 2391 2391
Lines 218434 218505 +71
======================================================
+ Hits 202866 202882 +16
- Misses 15568 15623 +55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fb1c0fd to
b01f200
Compare
b01f200 to
e02f3ec
Compare
d8fe957
into
googleapis:prepare-for-v3.0.0
This is the first of a series of PRs (to avoid 1 mega-PR), to decommission the GCS specific OAuth2 API and use the GUAC API instead.
This PR addresses feature parity by porting support for reading service account credentials from JSON and PKCS12 files from the GCS OAuth implementation to the GUAC implementation.
A subsequent PR will rewire the existing GCS OAuth tests for this functionality to use this GUAC implementation.