-
Notifications
You must be signed in to change notification settings - Fork 385
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
fix(common): missed using CARootsFilePathOption
#12997
Merged
coryan
merged 4 commits into
googleapis:main
from
coryan:fix-common-use-CARootsFilePathOption
Oct 30, 2023
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -306,16 +306,37 @@ struct AccessTokenLifetimeOption { | |
* Configures a custom CA (Certificates Authority) certificates file. | ||
* | ||
* Most applications should use the system's root certificates and should avoid | ||
* setting this option unnecessarily. A common exception to this recommendation | ||
* are containerized applications. These often deploy without system's root | ||
* certificates and need to explicitly configure a root of trust. | ||
* setting this option unnecessarily. | ||
* | ||
* The value of this option should be the name of a file in [PEM format]. | ||
* Consult your security team and/or system administrator for the contents of | ||
* this file. Be aware of the security implications of adding new CA | ||
* certificates to this file. Only use trustworthy sources for the CA | ||
* certificates. | ||
* | ||
* The most common cases where this option is needed include: | ||
* | ||
* - Containerized applications that deploy without the system's root | ||
* certificates and need to explicitly configure a root of trust. | ||
* - Applications using gRPC-based services on Windows and macOS, where gRPC | ||
* does not use the default root of trust. Though it might be possible to | ||
* set the `GRPC_DEFAULT_SSL_ROOTS_FILE_PATH` environment variable instead. | ||
* | ||
* You should set this option both in the credentials and the client options. | ||
* For example: | ||
* @code | ||
* using gc = ::google::cloud; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/using/namespace/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
* auto ca = gc::Options{}.set<gc::CARootsFilePathOption>("path/to/roots.pem"); | ||
* auto credentials = gc::MakeServiceAccountCredentials(..., ca); | ||
* // Make a copy, only needed if you plan to use `ca` again. | ||
* auto opts = ca; | ||
* // Using bigtable to illustrate the option usage, this applies to all | ||
* // libraries in `google-cloud-cpp`. | ||
* auto connection = gc::bigtable::MakeDataConnection( | ||
* opts.set<gc::UnifiedCredentialsOption>(credentials)); | ||
* // Use `connection` as usual. | ||
* @endcode | ||
* | ||
* For REST-based libraries this configures the [CAINFO option] in libcurl. | ||
* These are used for all credentials that require authentication, including the | ||
* default credentials. | ||
|
@@ -325,8 +346,7 @@ struct AccessTokenLifetimeOption { | |
* | ||
* @warning gRPC does not have a programmatic mechanism to set the CA | ||
* certificates for the default credentials. This option only has no effect | ||
* with `MakeGoogleDefaultCredentials()`, or | ||
* `MakeServiceAccountCredentials()`. | ||
* with `MakeGoogleDefaultCredentials()`. | ||
* Consider using the `GRPC_DEFAULT_SSL_ROOTS_FILE_PATH` environment | ||
* variable in these cases. | ||
* | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
s/and the client options/and in the connection options/
They would not apply if passed to the client only, right?
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.
Done.