Skip to content

Commit

Permalink
Rename AzurePublicCloud -> AzurePublic (Azure#17733)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored Apr 26, 2022
1 parent a62335c commit 1b1719c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions sdk/azcore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Breaking Changes
* Renamed `cloud.Configuration.LoginEndpoint` to `.ActiveDirectoryAuthorityHost`
* Renamed `cloud.AzurePublicCloud` to `cloud.AzurePublic`
* Removed `AuxiliaryTenants` field from `arm/ClientOptions` and `arm/policy/BearerTokenOptions`
* Removed `TokenRequestOptions.TenantID`
* `Poller[T].PollUntilDone()` now takes an `options *PollUntilDoneOptions` param instead of `freq time.Duration`
Expand Down
2 changes: 1 addition & 1 deletion sdk/azcore/arm/arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func init() {
Audience: "https://management.core.usgovcloudapi.net",
Endpoint: "https://management.usgovcloudapi.net",
}
cloud.AzurePublicCloud.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
Audience: "https://management.core.windows.net/",
Endpoint: "https://management.azure.com",
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/azcore/arm/runtime/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azr
}

func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) {
c := cloud.AzurePublicCloud
c := cloud.AzurePublic
if !reflect.ValueOf(o.Cloud).IsZero() {
c = o.Cloud
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/azcore/arm/runtime/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestPipelineWithCustomPolicies(t *testing.T) {
}

func TestPipelineAudience(t *testing.T) {
for _, c := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublicCloud} {
for _, c := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublic} {
srv, close := mock.NewServer()
defer close()
srv.AppendResponse(mock.WithStatusCode(200))
Expand Down
4 changes: 2 additions & 2 deletions sdk/azcore/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ var (
AzureGovernment = Configuration{
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
}
// AzurePublicCloud contains configuration for Azure Public Cloud.
AzurePublicCloud = Configuration{
// AzurePublic contains configuration for Azure Public Cloud.
AzurePublic = Configuration{
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
}
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/azidentity/azidentity.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func setAuthorityHost(cc cloud.Configuration) (string, error) {
if len(cc.Services) > 0 {
return "", errors.New("missing ActiveDirectoryAuthorityHost for specified cloud")
}
host = cloud.AzurePublicCloud.ActiveDirectoryAuthorityHost
host = cloud.AzurePublic.ActiveDirectoryAuthorityHost
if envAuthorityHost := os.Getenv(azureAuthorityHost); envAuthorityHost != "" {
host = envAuthorityHost
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/azidentity/azidentity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func setEnvironmentVariables(t *testing.T, vars map[string]string) {
}

func Test_WellKnownHosts(t *testing.T) {
for _, cloud := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublicCloud} {
for _, cloud := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublic} {
host, err := setAuthorityHost(cloud)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -196,7 +196,7 @@ func Test_DefaultAuthorityHost(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if authorityHost != cloud.AzurePublicCloud.ActiveDirectoryAuthorityHost {
if authorityHost != cloud.AzurePublic.ActiveDirectoryAuthorityHost {
t.Fatal("unexpected default host: " + authorityHost)
}
}
Expand Down

0 comments on commit 1b1719c

Please sign in to comment.