[Core] Make _enforce_https a module level function#45890
Open
pvaneck wants to merge 1 commit intoAzure:mainfrom
Open
[Core] Make _enforce_https a module level function#45890pvaneck wants to merge 1 commit intoAzure:mainfrom
pvaneck wants to merge 1 commit intoAzure:mainfrom
Conversation
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors bearer token credential policies to make _enforce_https a module-level helper, avoiding cross-class protected member access in async policies and aligning sync/async implementations.
Changes:
- Introduced module-level
_enforce_https(request)helper in bothazure-coreandcorehttpauthentication policy modules. - Updated sync and async bearer token policies to call
_enforce_httpsdirectly instead of a base-class@staticmethod. - Simplified async policy imports by removing the dependency on
_BearerTokenCredentialPolicyBasesolely for HTTPS enforcement.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/core/corehttp/corehttp/runtime/policies/_authentication_async.py | Switches async policy HTTPS enforcement to module-level _enforce_https. |
| sdk/core/corehttp/corehttp/runtime/policies/_authentication.py | Moves _enforce_https out of _BearerTokenCredentialPolicyBase into module scope and updates call site. |
| sdk/core/azure-core/azure/core/pipeline/policies/_authentication_async.py | Replaces protected cross-class call with direct _enforce_https usage. |
| sdk/core/azure-core/azure/core/pipeline/policies/_authentication.py | Adds module-level _enforce_https, removes the old staticmethod, and updates call site. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes: #45402