-
Notifications
You must be signed in to change notification settings - Fork 248
L126: C-core: Support ALTS Credentials in Google Default Credentials #504
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
58aaa6c
L123: C-core: Support ALTS Credentials in Google Default Credentials
anniefrchz 7fe3088
Incorporate initial feedback
anniefrchz 3f8ebd6
Add discussion link and fix number
anniefrchz 8c2d33a
Add discussion link and fix number
anniefrchz 1d45a78
Adress comments and nits
anniefrchz 2a9d07f
Rename file and fix some nits
anniefrchz 766d654
Incorporate changes to the GoogleDefaultCredentials options
anniefrchz 666cda0
Add details on implementation for C++ libraries
anniefrchz 9e23f30
Create sections per language
anniefrchz c38532b
S/int/size_t in struct definition
anniefrchz d42398e
Move header
anniefrchz 9faf191
Use a boolean instead of query parameters
anniefrchz 27d887c
Update Date
anniefrchz 899ad3b
Change flag name for grpc_google_compute_engine_credentials_create
anniefrchz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # L126: C-core: Support ALTS Hard Bound Call Credentials in Google Default Credentials | ||
|
|
||
| * Author(s): anniefrchz | ||
| * Approver: markdroth | ||
| * Status: In Review | ||
| * Implemented in: C++ | ||
| * Last updated: 2025-07-08 | ||
| * Discussion at: https://groups.google.com/g/grpc-io/c/7rRWghiS95E/m/nENwU3BtCgAJ | ||
|
|
||
| ## Abstract | ||
|
|
||
| This proposal outlines a change to the gRPC Core C-API to support | ||
| alts-credentials configurations within `grpc_google_default_credentials`. This | ||
| enhancement specifically allows a secondary set of call credentials for ALTS to | ||
| be provided alongside the default credentials. | ||
|
|
||
| ## Background | ||
|
|
||
| The existing `grpc_google_default_credentials_create` function allows the | ||
| configuration of a single set of call credentials. In some scenarios, a client | ||
| would want to communicate with services that support hard bound credentials over | ||
| ALTS. This proposal addresses the possibility to support this use case on a | ||
| channel initialized with Google's default credentials. | ||
|
|
||
| ## Proposal | ||
|
|
||
| This proposal modifies the function `grpc_google_default_credentials_create` to | ||
| add a second set of call credentials. | ||
|
|
||
| ```c | ||
| GRPCAPI grpc_channel_credentials* grpc_google_default_credentials_create( | ||
| grpc_call_credentials* tls_credentials, | ||
| grpc_call_credentials* alts_credentials); | ||
| ``` | ||
| This new function accepts two arguments: | ||
| 1. `tls_credentials`: The primary call credentials, consistent with the | ||
| existing API. This is usually used for TLS connections. | ||
| 2. `alts_credentials`: A secondary set of call credentials to be used | ||
| specifically for ALTS connections. | ||
| After a secure connection is established, the gRPC runtime identifies the | ||
| connection's transport security type, which indicates whether the underlying | ||
| connection is using a protocol like ALTS or TLS. The runtime then selects the | ||
| appropriate call credentials for that connection. If the determined transport | ||
| security type is ALTS, the provided alts_credentials will be used. For all other | ||
| transport types, the primary call_credentials are used, maintaining the default | ||
| behavior. | ||
| Additionally, external customers will de able to create GoogleDefaultCredentials | ||
| by setting a GoogleDefaultCredentialsOptions value into their standard call. | ||
| For this addition, the proposed struct `GoogleDefaultCredentialsOptions` will hold | ||
| a boolean that will be default to false. Callers of the GoogleDefaultCredentials() | ||
| API will be able to set use_alts to false value, if required to indicate the | ||
| request for the underlying bound token call credentials. | ||
| ```c | ||
| struct GoogleDefaultCredentialsOptions { | ||
anniefrchz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bool use_alts = false; | ||
| }; | ||
| ``` | ||
|
|
||
|
|
||
| ## Rationale | ||
|
|
||
| The primary motivation for this change is to enable seamless support for hybrid | ||
| security environments on a single gRPC channel. | ||
|
|
||
| The advantages of this approach are: | ||
|
|
||
| * Consolidated API: It avoids introducing a new function for a closely related | ||
| feature, keeping the API surface clean and concise. An initial review of the | ||
| pull request favored this path to avoid an unnecessary new API. | ||
| * Improved Discoverability: Developers only need to be aware of a single | ||
| function for creating Google default credentials. The optional nature of the | ||
| second parameter would make the basic use case simple while allowing for the | ||
| more advanced dual-credential scenario when needed. | ||
| * Logical Cohesion: Since the new functionality is an extension of the | ||
| existing credential creation process, incorporating it into the original | ||
| function maintains logical cohesion. The function's responsibility is | ||
| expanded rather than duplicated across multiple functions. | ||
| * Cross-language support: Since wrapper languages like Python use this API, | ||
| supporting ALTS bound credentials will be straightforward by passing them as | ||
| an argument to the existing API. | ||
|
|
||
| ## Implementation | ||
|
|
||
| The implementation for this proposal has been completed and merged into the main | ||
| gRPC repository. | ||
|
|
||
| * Pull Request: grpc/grpc#39770 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.