Skip to content

Commit

Permalink
set different default policy between data-plan and mgmt-plan
Browse files Browse the repository at this point in the history
  • Loading branch information
msyyc committed Jul 9, 2021
1 parent 8bbbf97 commit 5d2821e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion autorest/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ def _get_credential_param(self, azure_arm, credential, credential_default_policy

def _handle_default_authentication_policy(self, azure_arm, credential):

default_policy = 'ARMChallengeAuthenticationPolicy' if azure_arm else "BearerTokenCredentialPolicy"
passed_in_credential_default_policy_type = (
self._autorestapi.get_value("credential-default-policy-type") or "ARMChallengeAuthenticationPolicy"
self._autorestapi.get_value("credential-default-policy-type") or default_policy
)

# right now, we only allow ARMChallengeAuthenticationPolicy, BearerTokenCredentialPolicy and
Expand Down
4 changes: 2 additions & 2 deletions docs/client/initializing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ The following are core libraries your generated code depend on, and the minimum

| Library | Description | Min Version |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| [`azure-core`][azure_core_library] | The most important library to have installed. It provides shared exceptions and modules for all the Python SDK client libraries. | 1.8.2 |
| [`azure-core`][azure_core_library] | The most important library to have installed. It provides shared exceptions and modules for all the Python SDK client libraries. | 1.15.0 |
| [`msrest`][msrest_library] | Library mainly used for serializing and deserializing objects | 0.6.21 |
| [`azure-mgmt-core`][azure_mgmt_core_library] | Required if you're generating mgmt plane code (see `--azure-arm` flag in our [flag index][flag_index]. Provides mgmt plane specific shared exceptions and modules. | 1.2.1 |
| [`azure-mgmt-core`][azure_mgmt_core_library] | Required if you're generating mgmt plane code (see `--azure-arm` flag in our [flag index][flag_index]. Provides mgmt plane specific shared exceptions and modules. | 1.3.0 |

> Note: We highly recommend tying your library to a major version, for instance, adding `azure-core<2.0.0` to tie the `azure-core` library to `1.x.x`
Expand Down

0 comments on commit 5d2821e

Please sign in to comment.