sample: delete samples/snippets directory#1964
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Added `CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE` and `CLOUDSDK_CONTEXT_AWARE_CERTIFICATE_CONFIG_FILE_PATH` as fallback environment variables for mTLS configuration. Updated `google/auth/transport/_mtls_helper.py` to check these variables if the primary `GOOGLE_API_...` variables are not set. Added tests to verify precedence and fallback logic.
…6834227 Add fallback environment variables for mTLS configuration
feat (iam): Add Cloud SDK context-aware mTLS env var fallbacks and define the env in environment_vars.py
|
Here is the summary of possible violations 😱 DetailsThere are 2 possible violations for removing region tag in use.
The end of the violation section. All the stuff below is FYI purposes only. Here is the summary of changes. You are about to delete 5 region tags.
This comment is generated by snippet-bot.
|
Summary of ChangesHello @chalmerlowe, 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 primarily focuses on two distinct areas: the removal of outdated sample code and enhancements to mTLS configuration. The Highlights
Changelog
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 primarily removes the samples/snippets directory. It also introduces fallback environment variables for mTLS configuration and updates the logic to use them. The new logic is correct and is accompanied by tests. I've suggested a few minor refactorings in google/auth/transport/_mtls_helper.py to improve code conciseness and readability by using or for fallback logic. Overall, the changes look good.
| use_client_cert = getenv(environment_vars.GOOGLE_API_USE_CLIENT_CERTIFICATE) | ||
| if use_client_cert is None or use_client_cert == "": | ||
| use_client_cert = getenv( | ||
| environment_vars.CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE | ||
| ) |
| cert_path = getenv(environment_vars.GOOGLE_API_CERTIFICATE_CONFIG) | ||
| if cert_path is None: | ||
| cert_path = getenv( | ||
| environment_vars.CLOUDSDK_CONTEXT_AWARE_CERTIFICATE_CONFIG_FILE_PATH | ||
| ) |
There was a problem hiding this comment.
This logic for determining cert_path can also be simplified using the or operator. This also makes the handling of an empty string consistent with how use_client_cert is handled.
cert_path = getenv(
environment_vars.GOOGLE_API_CERTIFICATE_CONFIG
) or getenv(
environment_vars.CLOUDSDK_CONTEXT_AWARE_CERTIFICATE_CONFIG_FILE_PATH
)
Deletes the samples/snippets directory following a relocation of the samples to the python-docs-samples repo.
Moved in preparaation