Skip to content

Commit 328056f

Browse files
handsomejack-42bgavrilMS
authored andcommitted
refactor(oauth): rename aad instance discovery endpoint const
This enables adding the same const for dSTS later in the process.
1 parent a9d2090 commit 328056f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apps/internal/oauth/ops/authority/authority.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
const (
2525
authorizationEndpoint = "https://%v/%v/oauth2/v2.0/authorize"
26-
instanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
26+
aadInstanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
2727
tenantDiscoveryEndpointWithRegion = "https://%s.%s/%s/v2.0/.well-known/openid-configuration"
2828
regionName = "REGION_NAME"
2929
defaultAPIVersion = "2021-10-01"
@@ -522,7 +522,7 @@ func (c Client) AADInstanceDiscovery(ctx context.Context, authorityInfo Info) (I
522522
discoveryHost = authorityInfo.Host
523523
}
524524

525-
endpoint := fmt.Sprintf(instanceDiscoveryEndpoint, discoveryHost)
525+
endpoint := fmt.Sprintf(aadInstanceDiscoveryEndpoint, discoveryHost)
526526
err = c.Comm.JSONCall(ctx, endpoint, http.Header{}, qv, nil, &resp)
527527
}
528528
return resp, err

apps/internal/oauth/ops/authority/authority_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func TestAADInstanceDiscovery(t *testing.T) {
214214
},
215215
{
216216
desc: "Success with authorityInfo.Host not in trusted list",
217-
endpoint: fmt.Sprintf(instanceDiscoveryEndpoint, defaultHost),
217+
endpoint: fmt.Sprintf(aadInstanceDiscoveryEndpoint, defaultHost),
218218
authInfo: Info{
219219
Host: "host",
220220
Tenant: "tenant",
@@ -227,7 +227,7 @@ func TestAADInstanceDiscovery(t *testing.T) {
227227
},
228228
{
229229
desc: "Success with authorityInfo.Host in trusted list",
230-
endpoint: fmt.Sprintf(instanceDiscoveryEndpoint, "login.microsoftonline.de"),
230+
endpoint: fmt.Sprintf(aadInstanceDiscoveryEndpoint, "login.microsoftonline.de"),
231231
authInfo: Info{
232232
Host: "login.microsoftonline.de",
233233
Tenant: "tenant",

0 commit comments

Comments
 (0)