Skip to content

Commit cd914e4

Browse files
Copilotmohitc1
andauthored
Rename SovSG → GovSG in Common module, Fixes AB#3565148 (#3068)
The Singapore sovereign cloud was incorrectly named "SovSG" — the correct branding is "GovSG". This is a pure identifier rename; the hostname `login.sovcloud-identity.sg` is unchanged. ### Production code - **`AzureActiveDirectoryCloud.java`**: `SOVSG_CLOUD_HOST` → `GOVSG_CLOUD_HOST`, `SOVSG` → `GOVSG`, JavaDoc updated - **`AzureActiveDirectory.java`**: import, `KNOWN_CLOUD_DISCOVERY_HOSTS` entry, and `preSeedSovereignClouds()` reference updated ### Tests - `AzureActiveDirectoryCloudTest.kt` — test functions, local variable `sovsg` → `govsg`, all constant references - `AzureActiveDirectoryTest.kt` — `testIsKnownCloudDiscoveryHost_sovsg` → `_govsg` - `AzureActiveDirectoryAuthorityCloudTest.kt` — three test functions and local variables renamed - `AuthorityKnownAuthorityTest.kt` — comment and test function renamed ### Changelog - Added a `[PATCH]` entry to `changelog.txt` under `vNext` noting the rename. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > ## Rename SovSG to GovSG in Common module > > Fixes [AB#3565148](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3565148) > > ### Objective > Rename all occurrences of **SovSG** to **GovSG** in the Common module. The Singapore sovereign cloud was incorrectly named "SovSG" — the correct term is "GovSG". > > ### Context > The sovereign cloud constants and instances in `AzureActiveDirectoryCloud.java` use the incorrect abbreviation "SovSG" for the Singapore sovereign cloud. This needs to be corrected to "GovSG" across all production code and associated tests. The actual hostname `login.sovcloud-identity.sg` is correct and must NOT be changed. > > ### Technical Requirements > > #### 1. AzureActiveDirectoryCloud.java > Path: `common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectoryCloud.java` > - Rename constant `SOVSG_CLOUD_HOST` to `GOVSG_CLOUD_HOST` (line 127). The string value `"login.sovcloud-identity.sg"` must NOT change. > - Update JavaDoc comment: `SovSG sovereign cloud` to `GovSG sovereign cloud` (line 144) > - Rename static instance `SOVSG` to `GOVSG` (line 145) > - Update all references to `SOVSG_CLOUD_HOST` within the instance constructor call (lines 146-148) to `GOVSG_CLOUD_HOST` > > #### 2. AzureActiveDirectory.java > Path: `common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectory.java` > - Rename import: `import static ...AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST` to `GOVSG_CLOUD_HOST` (line 31) > - Rename usage in `KNOWN_CLOUD_DISCOVERY_HOSTS` set: `SOVSG_CLOUD_HOST` to `GOVSG_CLOUD_HOST` (line 119) > - Rename usage in `preSeedSovereignClouds()`: `AzureActiveDirectoryCloud.SOVSG` to `AzureActiveDirectoryCloud.GOVSG` (line 137) > > #### 3. AzureActiveDirectoryCloudTest.kt > Path: `common4j/src/test/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectoryCloudTest.kt` > - Rename test function `testSovsgCloudHostConstant()` to `testGovsgCloudHostConstant()` > - Update reference `AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST` to `AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST` > - Rename test function `testSovsgCloudInstance()` to `testGovsgCloudInstance()` > - Rename local variable `val sovsg` to `val govsg` and all its usages > - Update all `AzureActiveDirectoryCloud.SOVSG` to `AzureActiveDirectoryCloud.GOVSG` > - Update all `AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST` to `AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST` > > #### 4. AzureActiveDirectoryTest.kt > Path: `common4j/src/test/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectoryTest.kt` > - Rename test function `testIsKnownCloudDiscoveryHost_sovsg()` to `testIsKnownCloudDiscoveryHost_govsg()` > > #### 5. AzureActiveDirectoryAuthorityCloudTest.kt > Path: `common4j/src/test/com/microsoft/identity/common/java/authorities/AzureActiveDirectoryAuthorityCloudTest.kt` > - Rename test functions: `testIsSameCloudAsAuthority_bothSovsg_returnsTrue` to `bothGovsg`, `bleuVsSovsg` to `bleuVsGovsg`, `delosVsSovsg` to `delosVsGovsg` > - Rename local variables `val sovsg` to `val govsg` and all usages > - Update all `SOVSG_CLOUD_HOST` to `GOVSG_CLOUD_HOST` > > #### 6. AuthorityKnownAuthorityTest.kt > Path: `common4j/src/test/com/microsoft/identity/common/java/authorities/AuthorityKnownAuthorityTest.kt` > - Update comment: `(SovSG)` to `(GovSG)` > - Rename test function `testIsKnownAuthority_sovsgSovereignCloud()` to `testIsKnownAuthority_govsgSovereignCloud()` > - Update reference `AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST` to `AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST` > > ### Acceptance Criteria > - All `SOVSG`, `SovSG`, `sovsg`, `Sovsg` identifiers and comments in common4j are renamed to `GOVSG`, `GovSG`, `govsg`, `Govsg` respectively. > - The actual hostname string `login.sovcloud-identity.sg` is NOT changed anywhere. > - All existing tests pass after the rename (run `./gradlew :common4j:test`). > - No logic changes — this is purely a naming fix. > - Follow .github/copilot-instructions.md strictly. > </details> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mohitc1 <22034758+mohitc1@users.noreply.github.com>
1 parent 06771b8 commit cd914e4

7 files changed

Lines changed: 36 additions & 35 deletions

File tree

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
vNext
22
----------
3+
- [PATCH] Rename SovSG to GovSG for the Singapore sovereign cloud identifiers (#3068)
34

45
Version 24.1.0
56
----------

common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import static com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.DELOS_CLOUD_HOST;
2929
import static com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.PPE_CLOUD_HOST;
3030
import static com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.PUBLIC_CLOUD_HOST;
31-
import static com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST;
31+
import static com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST;
3232
import static com.microsoft.identity.common.java.providers.microsoft.azureactivedirectory.AzureActiveDirectoryCloud.US_GOV_CLOUD_HOST;
3333

3434
import com.google.gson.Gson;
@@ -116,7 +116,7 @@ public class AzureActiveDirectory
116116
US_GOV_CLOUD_HOST,
117117
BLEU_CLOUD_HOST,
118118
DELOS_CLOUD_HOST,
119-
SOVSG_CLOUD_HOST
119+
GOVSG_CLOUD_HOST
120120
)));
121121

122122
static {
@@ -134,7 +134,7 @@ private static void preSeedSovereignClouds() {
134134
for (final AzureActiveDirectoryCloud cloud : new AzureActiveDirectoryCloud[]{
135135
AzureActiveDirectoryCloud.BLEU,
136136
AzureActiveDirectoryCloud.DELOS,
137-
AzureActiveDirectoryCloud.SOVSG
137+
AzureActiveDirectoryCloud.GOVSG
138138
}) {
139139
sAadClouds.put(
140140
cloud.getPreferredNetworkHostName().toLowerCase(Locale.US),

common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectoryCloud.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void setIsValidated(final boolean isValidated) {
124124
public static final String US_GOV_CLOUD_HOST = "login.microsoftonline.us";
125125
public static final String BLEU_CLOUD_HOST = "login.sovcloud-identity.fr";
126126
public static final String DELOS_CLOUD_HOST = "login.sovcloud-identity.de";
127-
public static final String SOVSG_CLOUD_HOST = "login.sovcloud-identity.sg";
127+
public static final String GOVSG_CLOUD_HOST = "login.sovcloud-identity.sg";
128128

129129
// These are added without network calls because they are not part of instance discovery yet.
130130
/** Bleu sovereign cloud (France). */
@@ -141,10 +141,10 @@ void setIsValidated(final boolean isValidated) {
141141
Collections.singletonList(DELOS_CLOUD_HOST)
142142
);
143143

144-
/** SovSG sovereign cloud (Singapore). */
145-
public static final AzureActiveDirectoryCloud SOVSG = new AzureActiveDirectoryCloud(
146-
SOVSG_CLOUD_HOST,
147-
SOVSG_CLOUD_HOST,
148-
Collections.singletonList(SOVSG_CLOUD_HOST)
144+
/** GovSG sovereign cloud (Singapore). */
145+
public static final AzureActiveDirectoryCloud GOVSG = new AzureActiveDirectoryCloud(
146+
GOVSG_CLOUD_HOST,
147+
GOVSG_CLOUD_HOST,
148+
Collections.singletonList(GOVSG_CLOUD_HOST)
149149
);
150150
}

common4j/src/test/com/microsoft/identity/common/java/authorities/AuthorityKnownAuthorityTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ class AuthorityKnownAuthorityTest {
5656
}
5757

5858
/**
59-
* Verifies that a sovereign cloud authority (SovSG) is recognized as known.
59+
* Verifies that a sovereign cloud authority (GovSG) is recognized as known.
6060
*/
6161
@Test
62-
fun testIsKnownAuthority_sovsgSovereignCloud() {
62+
fun testIsKnownAuthority_govsgSovereignCloud() {
6363
val authority = Authority.getAuthorityFromAuthorityUrl(
64-
"https://${AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST}/common"
64+
"https://${AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST}/common"
6565
)
6666
assertTrue(Authority.isKnownAuthority(authority))
6767
}

common4j/src/test/com/microsoft/identity/common/java/authorities/AzureActiveDirectoryAuthorityCloudTest.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class AzureActiveDirectoryAuthorityCloudTest {
5151
}
5252

5353
@Test
54-
fun testIsSameCloudAsAuthority_bothSovsg_returnsTrue() {
55-
val authority1 = createAuthority(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST)
56-
val authority2 = createAuthority(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST)
54+
fun testIsSameCloudAsAuthority_bothGovsg_returnsTrue() {
55+
val authority1 = createAuthority(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST)
56+
val authority2 = createAuthority(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST)
5757
assertTrue(authority1.isSameCloudAsAuthority(authority2))
5858
}
5959

@@ -65,16 +65,16 @@ class AzureActiveDirectoryAuthorityCloudTest {
6565
}
6666

6767
@Test
68-
fun testIsSameCloudAsAuthority_bleuVsSovsg_returnsFalse() {
68+
fun testIsSameCloudAsAuthority_bleuVsGovsg_returnsFalse() {
6969
val bleu = createAuthority(AzureActiveDirectoryCloud.BLEU_CLOUD_HOST)
70-
val sovsg = createAuthority(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST)
71-
assertFalse(bleu.isSameCloudAsAuthority(sovsg))
70+
val govsg = createAuthority(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST)
71+
assertFalse(bleu.isSameCloudAsAuthority(govsg))
7272
}
7373

7474
@Test
75-
fun testIsSameCloudAsAuthority_delosVsSovsg_returnsFalse() {
75+
fun testIsSameCloudAsAuthority_delosVsGovsg_returnsFalse() {
7676
val delos = createAuthority(AzureActiveDirectoryCloud.DELOS_CLOUD_HOST)
77-
val sovsg = createAuthority(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST)
78-
assertFalse(delos.isSameCloudAsAuthority(sovsg))
77+
val govsg = createAuthority(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST)
78+
assertFalse(delos.isSameCloudAsAuthority(govsg))
7979
}
8080
}

common4j/src/test/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectoryCloudTest.kt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class AzureActiveDirectoryCloudTest {
3838
}
3939

4040
@Test
41-
fun testSovsgCloudHostConstant() {
42-
assertEquals("login.sovcloud-identity.sg", AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST)
41+
fun testGovsgCloudHostConstant() {
42+
assertEquals("login.sovcloud-identity.sg", AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST)
4343
}
4444

4545
@Test
@@ -67,21 +67,21 @@ class AzureActiveDirectoryCloudTest {
6767
}
6868

6969
@Test
70-
fun testSovsgCloudInstance() {
71-
val sovsg = AzureActiveDirectoryCloud.SOVSG
72-
assertNotNull(sovsg)
73-
assertEquals(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST, sovsg.preferredNetworkHostName)
74-
assertEquals(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST, sovsg.preferredCacheHostName)
75-
assertNotNull(sovsg.hostAliases)
76-
assertEquals(1, sovsg.hostAliases.size)
77-
assertEquals(AzureActiveDirectoryCloud.SOVSG_CLOUD_HOST, sovsg.hostAliases[0])
78-
assertTrue(sovsg.isValidated)
70+
fun testGovsgCloudInstance() {
71+
val govsg = AzureActiveDirectoryCloud.GOVSG
72+
assertNotNull(govsg)
73+
assertEquals(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST, govsg.preferredNetworkHostName)
74+
assertEquals(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST, govsg.preferredCacheHostName)
75+
assertNotNull(govsg.hostAliases)
76+
assertEquals(1, govsg.hostAliases.size)
77+
assertEquals(AzureActiveDirectoryCloud.GOVSG_CLOUD_HOST, govsg.hostAliases[0])
78+
assertTrue(govsg.isValidated)
7979
}
8080

8181
@Test
8282
fun testSovereignCloudInstancesAreDistinct() {
8383
assertNotEquals(AzureActiveDirectoryCloud.BLEU, AzureActiveDirectoryCloud.DELOS)
84-
assertNotEquals(AzureActiveDirectoryCloud.BLEU, AzureActiveDirectoryCloud.SOVSG)
85-
assertNotEquals(AzureActiveDirectoryCloud.DELOS, AzureActiveDirectoryCloud.SOVSG)
84+
assertNotEquals(AzureActiveDirectoryCloud.BLEU, AzureActiveDirectoryCloud.GOVSG)
85+
assertNotEquals(AzureActiveDirectoryCloud.DELOS, AzureActiveDirectoryCloud.GOVSG)
8686
}
8787
}

common4j/src/test/com/microsoft/identity/common/java/providers/microsoft/azureactivedirectory/AzureActiveDirectoryTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class AzureActiveDirectoryTest {
6565
}
6666

6767
@Test
68-
fun testIsKnownCloudDiscoveryHost_sovsg() {
68+
fun testIsKnownCloudDiscoveryHost_govsg() {
6969
assertTrue(AzureActiveDirectory.isKnownCloudDiscoveryHost("login.sovcloud-identity.sg"))
7070
}
7171

0 commit comments

Comments
 (0)