Skip to content

Conversation

@scotthart
Copy link
Member

@scotthart scotthart commented Jan 14, 2026

This PR focuses on removing the deprecated GCS OAuth wrappers around the OAuth implementation in the common library. In addition to deleting a lot of code, it also adds a few features to the common OAuth and Credentials libraries to maintain feature parity.

Highlights include:

  • replacing uses of Oauth2CredentialsOption with UnifiedCredentialsOption and removes Oauth2CredentialsOption
  • adding support for creating ServiceAccountCredentials from either JSON or P12 files to common Credentials
  • ensuring that GCS's special behavior regarding self signed JWTs and additional scopes is preserved via oauth2_internal::DisableSelfSignedJWTOption
  • maintains GCS feature parity regarding signing of blobs, urls, documents, etc.

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 14, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 significantly refactors the authentication infrastructure within the Google Cloud C++ client library for Google Cloud Storage. The primary goal is to consolidate authentication logic by removing GCS-specific OAuth2 implementations and fully adopting the unified google::cloud::Credentials interface. This change simplifies the codebase, enhances maintainability, and provides a more consistent developer experience across Google Cloud services. Additionally, it introduces a convenient new method for initializing service account credentials directly from file paths.

Highlights

  • Decommissioned GCS-specific OAuth2 API: The entire google::cloud::storage::oauth2 namespace and its associated credential implementations have been removed, streamlining the authentication layer.
  • Transition to Unified Credentials: The Google Cloud Storage (GCS) client library now exclusively utilizes the unified google::cloud::Credentials API for all authentication mechanisms, reducing code duplication and improving consistency.
  • New Service Account Credentials from File API: A new public API, MakeServiceAccountCredentialsFromFile, has been introduced in the unified credentials library, enabling the creation of service account credentials directly from a file path.
  • Enhanced Internal Credential Handling: Internal gRPC and REST credential visitors have been updated to seamlessly process service account configurations provided via file paths, ensuring consistent behavior across different transports.
  • Removed Oauth2CredentialsOption: The GCS-specific Oauth2CredentialsOption has been removed from the client options, with UnifiedCredentialsOption now serving as the standard for credential configuration.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 decommissions the GCS-specific OAuth2 API, replacing it with a unified credentials implementation. This is a significant and positive refactoring that centralizes authentication logic. The changes are extensive, involving the removal of many old credential-related files and updating call sites to use the new APIs. My review found a couple of places where error handling for file operations could be improved to provide better diagnostics. Otherwise, the changes look correct and consistent with the goal of the PR.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 77.47253% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.82%. Comparing base (c201e56) to head (1345e57).

Files with missing lines Patch % Lines
...oud/internal/oauth2_service_account_credentials.cc 65.90% 15 Missing ⚠️
...ts/service_account_credentials_integration_test.cc 0.00% 10 Missing ⚠️
google/cloud/internal/unified_grpc_credentials.cc 56.25% 7 Missing ⚠️
.../cloud/storage/benchmarks/throughput_experiment.cc 0.00% 5 Missing ⚠️
google/cloud/internal/unified_rest_credentials.cc 75.00% 4 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           prepare-for-v3.0.0   #15883      +/-   ##
======================================================
- Coverage               92.87%   92.82%   -0.05%     
======================================================
  Files                    2391     2360      -31     
  Lines                  218434   216582    -1852     
======================================================
- Hits                   202866   201045    -1821     
+ Misses                  15568    15537      -31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart scotthart force-pushed the v3_storage_use_unified_creds branch from dc982cb to 3e9ad21 Compare January 16, 2026 01:03
@scotthart scotthart force-pushed the v3_storage_use_unified_creds branch from 3e9ad21 to 1345e57 Compare January 16, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant