-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add support for regional STS #19392
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
Merged
Merged
Add support for regional STS #19392
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b09cd3a
regional authorities
chlowell d2a3b38
raise minimum msal version
chlowell 5af18ca
region configuration for client credentials
chlowell b59fe00
tests
chlowell 080dc13
update changelog
chlowell 16a50c7
please use this only on VMs
chlowell 65d244d
fix docstrings
chlowell 33038d1
update core and cryptography requirements
chlowell d079b7d
roll back cryptography upgrade
chlowell 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 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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # ------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
| # ------------------------------------ | ||
| # pylint:skip-file (avoids crash due to six.with_metaclass https://github.com/PyCQA/astroid/issues/713) | ||
| from enum import Enum | ||
| from six import with_metaclass | ||
|
|
||
| from azure.core import CaseInsensitiveEnumMeta | ||
| from msal import ConfidentialClientApplication | ||
|
|
||
|
|
||
| class RegionalAuthority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): | ||
| """Identifies a regional authority for authentication""" | ||
|
|
||
| #: Attempt to discover the appropriate authority. This works on some Azure hosts, such as VMs and | ||
| #: Azure Functions. The non-regional authority is used when discovery fails. | ||
| AUTO_DISCOVER_REGION = ConfidentialClientApplication.ATTEMPT_REGION_DISCOVERY | ||
|
|
||
| ASIA_EAST = "eastasia" | ||
| ASIA_SOUTHEAST = "southeastasia" | ||
| AUSTRALIA_CENTRAL = "australiacentral" | ||
| AUSTRALIA_CENTRAL_2 = "australiacentral2" | ||
| AUSTRALIA_EAST = "australiaeast" | ||
| AUSTRALIA_SOUTHEAST = "australiasoutheast" | ||
| BRAZIL_SOUTH = "brazilsouth" | ||
| CANADA_CENTRAL = "canadacentral" | ||
| CANADA_EAST = "canadaeast" | ||
| CHINA_EAST = "chinaeast" | ||
| CHINA_EAST_2 = "chinaeast2" | ||
| CHINA_NORTH = "chinanorth" | ||
| CHINA_NORTH_2 = "chinanorth2" | ||
| EUROPE_NORTH = "northeurope" | ||
| EUROPE_WEST = "westeurope" | ||
| FRANCE_CENTRAL = "francecentral" | ||
| FRANCE_SOUTH = "francesouth" | ||
| GERMANY_CENTRAL = "germanycentral" | ||
| GERMANY_NORTH = "germanynorth" | ||
| GERMANY_NORTHEAST = "germanynortheast" | ||
| GERMANY_WEST_CENTRAL = "germanywestcentral" | ||
| GOVERNMENT_US_ARIZONA = "usgovarizona" | ||
| GOVERNMENT_US_DOD_CENTRAL = "usdodcentral" | ||
| GOVERNMENT_US_DOD_EAST = "usdodeast" | ||
| GOVERNMENT_US_IOWA = "usgoviowa" | ||
| GOVERNMENT_US_TEXAS = "usgovtexas" | ||
| GOVERNMENT_US_VIRGINIA = "usgovvirginia" | ||
| INDIA_CENTRAL = "centralindia" | ||
| INDIA_SOUTH = "southindia" | ||
| INDIA_WEST = "westindia" | ||
| JAPAN_EAST = "japaneast" | ||
| JAPAN_WEST = "japanwest" | ||
| KOREA_CENTRAL = "koreacentral" | ||
| KOREA_SOUTH = "koreasouth" | ||
| NORWAY_EAST = "norwayeast" | ||
| NORWAY_WEST = "norwaywest" | ||
| SOUTH_AFRICA_NORTH = "southafricanorth" | ||
| SOUTH_AFRICA_WEST = "southafricawest" | ||
| SWITZERLAND_NORTH = "switzerlandnorth" | ||
| SWITZERLAND_WEST = "switzerlandwest" | ||
| UAE_CENTRAL = "uaecentral" | ||
| UAE_NORTH = "uaenorth" | ||
| UK_SOUTH = "uksouth" | ||
| UK_WEST = "ukwest" | ||
| US_CENTRAL = "centralus" | ||
| US_EAST = "eastus" | ||
| US_EAST_2 = "eastus2" | ||
| US_NORTH_CENTRAL = "northcentralus" | ||
| US_SOUTH_CENTRAL = "southcentralus" | ||
| US_WEST = "westus" | ||
| US_WEST_2 = "westus2" | ||
| US_WEST_CENTRAL = "westcentralus" | ||
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
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
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
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
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
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
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
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.
Just a question: should this pattern be applied to all enums, all new enums, or only some?
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.
All enums (see the guidelines). CaseInsensitiveEnumMeta is relatively new, so we've shipped many enums without it. Adding it to those should be non-breaking but not urgent.