Skip to content

Commit 31b8c27

Browse files
authored
Rename LoginEndpoint to ActiveDirectoryAuthorityHost (Azure#17576)
1 parent a20667c commit 31b8c27

File tree

10 files changed

+21
-20
lines changed

10 files changed

+21
-20
lines changed

sdk/azcore/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Release History
22

3-
## 0.23.2 (Unreleased)
3+
## 0.24.0 (Unreleased)
44

55
### Features Added
66

77
### Breaking Changes
8+
* Renamed `cloud.Configuration.LoginEndpoint` to `.ActiveDirectoryAuthorityHost`
89

910
### Bugs Fixed
1011

sdk/azcore/arm/runtime/policy_register_rp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func TestRPRegistrationPolicyAudience(t *testing.T) {
389389

390390
audience := "audience"
391391
conf := cloud.Configuration{
392-
LoginEndpoint: srv.URL(),
392+
ActiveDirectoryAuthorityHost: srv.URL(),
393393
Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
394394
cloud.ResourceManager: {Audience: audience, Endpoint: srv.URL()},
395395
},

sdk/azcore/cloud/cloud.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ package cloud
99
var (
1010
// AzureChina contains configuration for Azure China.
1111
AzureChina = Configuration{
12-
LoginEndpoint: "https://login.chinacloudapi.cn/", Services: map[ServiceName]ServiceConfiguration{},
12+
ActiveDirectoryAuthorityHost: "https://login.chinacloudapi.cn/", Services: map[ServiceName]ServiceConfiguration{},
1313
}
1414
// AzureGovernment contains configuration for Azure Government.
1515
AzureGovernment = Configuration{
16-
LoginEndpoint: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
16+
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
1717
}
1818
// AzurePublicCloud contains configuration for Azure Public Cloud.
1919
AzurePublicCloud = Configuration{
20-
LoginEndpoint: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
20+
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
2121
}
2222
)
2323

@@ -37,8 +37,8 @@ type ServiceConfiguration struct {
3737

3838
// Configuration configures a cloud.
3939
type Configuration struct {
40-
// LoginEndpoint is the base URL of the cloud's Azure Active Directory.
41-
LoginEndpoint string
40+
// ActiveDirectoryAuthorityHost is the base URL of the cloud's Azure Active Directory.
41+
ActiveDirectoryAuthorityHost string
4242
// Services contains configuration for the cloud's services.
4343
Services map[ServiceName]ServiceConfiguration
4444
}

sdk/azcore/cloud/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Applications deployed to a private cloud such as Azure Stack create a Configurat
3030
appropriate values:
3131
3232
c = cloud.Configuration{
33-
LoginEndpoint: "https://...",
33+
ActiveDirectoryAuthorityHost: "https://...",
3434
Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
3535
cloud.ResourceManager: {
3636
Audience: "...",

sdk/azcore/internal/shared/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ const (
3030
Module = "azcore"
3131

3232
// Version is the semantic version (see http://semver.org) of this module.
33-
Version = "v0.23.2"
33+
Version = "v0.24.0"
3434
)

sdk/azidentity/azidentity.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ const (
3333
)
3434

3535
// setAuthorityHost initializes the authority host for credentials. Precedence is:
36-
// 1. cloud.Configuration.LoginEndpoint value set by user
36+
// 1. cloud.Configuration.ActiveDirectoryAuthorityHost value set by user
3737
// 2. value of AZURE_AUTHORITY_HOST
3838
// 3. default: Azure Public Cloud
3939
func setAuthorityHost(cc cloud.Configuration) (string, error) {
40-
host := cc.LoginEndpoint
40+
host := cc.ActiveDirectoryAuthorityHost
4141
if host == "" {
4242
if len(cc.Services) > 0 {
43-
return "", errors.New("missing LoginEndpoint for specified cloud")
43+
return "", errors.New("missing ActiveDirectoryAuthorityHost for specified cloud")
4444
}
45-
host = cloud.AzurePublicCloud.LoginEndpoint
45+
host = cloud.AzurePublicCloud.ActiveDirectoryAuthorityHost
4646
if envAuthorityHost := os.Getenv(azureAuthorityHost); envAuthorityHost != "" {
4747
host = envAuthorityHost
4848
}

sdk/azidentity/azidentity_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func Test_WellKnownHosts(t *testing.T) {
162162
t.Fatal(err)
163163
}
164164
if !strings.HasPrefix(host, "https://login.") {
165-
t.Fatal("unexpected LoginEndpoint: " + host)
165+
t.Fatal("unexpected ActiveDirectoryAuthorityHost: " + host)
166166
}
167167
}
168168
}
@@ -180,7 +180,7 @@ func Test_SetEnvAuthorityHost(t *testing.T) {
180180

181181
func Test_CustomAuthorityHost(t *testing.T) {
182182
setEnvironmentVariables(t, map[string]string{azureAuthorityHost: testHost + "/not"})
183-
authorityHost, err := setAuthorityHost(cloud.Configuration{LoginEndpoint: testHost})
183+
authorityHost, err := setAuthorityHost(cloud.Configuration{ActiveDirectoryAuthorityHost: testHost})
184184
if err != nil {
185185
t.Fatal(err)
186186
}
@@ -196,7 +196,7 @@ func Test_DefaultAuthorityHost(t *testing.T) {
196196
if err != nil {
197197
t.Fatal(err)
198198
}
199-
if authorityHost != cloud.AzurePublicCloud.LoginEndpoint {
199+
if authorityHost != cloud.AzurePublicCloud.ActiveDirectoryAuthorityHost {
200200
t.Fatal("unexpected default host: " + authorityHost)
201201
}
202202
}
@@ -231,7 +231,7 @@ func Test_GetTokenRequiresScopes(t *testing.T) {
231231

232232
func Test_NonHTTPSAuthorityHost(t *testing.T) {
233233
setEnvironmentVariables(t, map[string]string{azureAuthorityHost: ""})
234-
authorityHost, err := setAuthorityHost(cloud.Configuration{LoginEndpoint: "http://localhost"})
234+
authorityHost, err := setAuthorityHost(cloud.Configuration{ActiveDirectoryAuthorityHost: "http://localhost"})
235235
if err == nil {
236236
t.Fatal("Expected an error but did not receive one.")
237237
}

sdk/azidentity/client_certificate_credential_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func TestClientCertificateCredential_NoPrivateKey(t *testing.T) {
161161
defer close()
162162
srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess)))
163163
options := ClientCertificateCredentialOptions{}
164-
options.Cloud.LoginEndpoint = srv.URL()
164+
options.Cloud.ActiveDirectoryAuthorityHost = srv.URL()
165165
options.Transport = srv
166166
var key crypto.PrivateKey
167167
_, err := NewClientCertificateCredential(fakeTenantID, fakeClientID, test.certs, key, &options)

sdk/azidentity/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/azidentity
22

33
go 1.18
44

5+
replace github.com/Azure/azure-sdk-for-go/sdk/azcore => ../azcore
6+
57
require (
68
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0
79
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1

sdk/azidentity/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ=
2-
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0=
31
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo=
42
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
53
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=

0 commit comments

Comments
 (0)