Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR addresses a credential scanner failure in VPN Gateway certificate-based authentication tests by replacing hardcoded certificate files (which likely contained real credentials) with dynamically generated test certificates using the cryptography library. The test now generates a complete certificate chain (Root CA → Intermediate CA → Leaf certificates) at runtime in a temporary directory.
Changes:
- Replaced static certificate files with dynamic certificate generation using the cryptography library
- Added helper methods to generate CA chains, leaf certificates, and PFX files with proper certificate hierarchies
- Implemented proper cleanup of temporary certificate files using try-finally blocks
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test_network_commands.py | Added certificate generation utilities and refactored test to generate certificates dynamically instead of using static files |
| VpnGatewayoutboundcert.pfx | Removed hardcoded certificate file that likely triggered credential scanner |
| VpnGatewayInboundCert.cer | Removed hardcoded certificate file that likely triggered credential scanner |
| VpnGatewayAuthCert.cer | Removed hardcoded certificate file that likely triggered credential scanner |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py
Outdated
Show resolved
Hide resolved
0245e64 to
9ca6aad
Compare
necusjz
left a comment
There was a problem hiding this comment.
The main purpose of this PR is to consume the certificates on the fly.
Related command
Description
This PR fixes a credential scanner failure introduced by CLI support for VPN Gateway connection certificate-based authentication.
Testing Guide
History Notes
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.