Skip to content

Commit 2c8b63f

Browse files
Copilotgavinbarronramsessanchez
authored
Add BleuCloud, DelosCloud, and GovSGCloud sovereign cloud environments, remove deprecated Germany cloud (#3523)
* Initial plan * Add BleuCloud and DelosCloud environments, remove old Germany cloud Co-authored-by: gavinbarron <7122716+gavinbarron@users.noreply.github.com> * Add GovSGCloud sovereign cloud environment Co-authored-by: gavinbarron <7122716+gavinbarron@users.noreply.github.com> * Fix PowerShell test to use DelosCloud instead of removed Germany environment Co-authored-by: gavinbarron <7122716+gavinbarron@users.noreply.github.com> * Revert generated files and update GovSGCloud comment to Sovereign Government Cloud Co-authored-by: gavinbarron <7122716+gavinbarron@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gavinbarron <7122716+gavinbarron@users.noreply.github.com> Co-authored-by: Gavin Barron <gavin.barron@gmail.com> Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>
1 parent 6608cfd commit 2c8b63f

4 files changed

Lines changed: 54 additions & 24 deletions

File tree

src/Authentication/Authentication.Test/Common/GraphSettingsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public void ShouldLoadSettingsFromConfiguredDataStore()
115115

116116
// Assert
117117
Assert.NotNull(loadedEnvironment);
118-
// 5 built-in + 2 user-defined
119-
Assert.Equal(7, settings.Environments.Count());
118+
// 7 built-in + 2 user-defined
119+
Assert.Equal(9, settings.Environments.Count());
120120
Assert.Equal("https://login.MyNewCloud.com", loadedEnvironment.AzureADEndpoint);
121121
Assert.Equal("https://graph.MyNewCloud.com", loadedEnvironment.GraphEndpoint);
122122
Assert.Equal(GraphEnvironmentConstants.EnvironmentType.UserDefined, loadedEnvironment.Type);
@@ -155,8 +155,8 @@ public void ShouldRemoveSettingsFromConfiguredDataStore()
155155

156156
// Assert
157157
Assert.NotEmpty(settingsContent);
158-
// 5 built-in + 1 user-defined
159-
Assert.Equal(6, settings.Environments.Count());
158+
// 7 built-in + 1 user-defined
159+
Assert.Equal(8, settings.Environments.Count());
160160

161161
GraphSession.Reset();
162162
}

src/Authentication/Authentication.Test/Handlers/NationalCloudHandlerTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ public async Task ShouldUseGlobalCloudWhenEnvironmentIsNotSet()
6464
}
6565

6666
[Fact]
67-
public async Task ShouldUseGermanyCloudWhenEnvironmentIsSetToGermany()
67+
public async Task ShouldUseDelosCloudWhenEnvironmentIsSetToDelos()
6868
{
6969
GraphSession.Initialize(() => new GraphSession());
7070

7171
// Arrange
72-
GraphEnvironment germanyEnvironment = GraphEnvironment.BuiltInEnvironments[GraphEnvironmentConstants.EnvironmentName.Germany];
73-
GraphSession.Instance.Environment = germanyEnvironment;
72+
GraphEnvironment delosEnvironment = GraphEnvironment.BuiltInEnvironments[GraphEnvironmentConstants.EnvironmentName.DelosCloud];
73+
GraphSession.Instance.Environment = delosEnvironment;
7474
Uri requestUrl = new Uri($"https://graph.microsoft.com/beta/users?{topParam}&{selectParam}");
7575
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUrl);
7676

@@ -80,7 +80,7 @@ public async Task ShouldUseGermanyCloudWhenEnvironmentIsSetToGermany()
8080

8181
// Assert
8282
Assert.Equal(requestUrl.Scheme, response.RequestMessage.RequestUri.Scheme);
83-
Assert.Equal("graph.microsoft.de", response.RequestMessage.RequestUri.Host);
83+
Assert.Equal("graph.svc.sovcloud.de", response.RequestMessage.RequestUri.Host);
8484
Assert.Contains(topParam, sentRequestQuery);
8585
Assert.Contains(selectParam, sentRequestQuery);
8686
Assert.Equal(2, sentRequestQuery.Split('&').Length);

src/Authentication/Authentication/GraphEnvironmentConstants.cs

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,24 @@ public static class EnvironmentName
3030
public const string USGovDoD = "USGovDoD";
3131

3232
/// <summary>
33-
/// The graph national cloud for Germany.
33+
/// The graph national cloud for China.
3434
/// </summary>
35-
public const string Germany = "Germany";
35+
public const string China = "China";
3636

3737
/// <summary>
38-
/// The graph national cloud for China.
38+
/// The French sovereign cloud operated by Bleu.
3939
/// </summary>
40-
public const string China = "China";
40+
public const string BleuCloud = "BleuCloud";
41+
42+
/// <summary>
43+
/// The German sovereign cloud operated by Delos.
44+
/// </summary>
45+
public const string DelosCloud = "DelosCloud";
46+
47+
/// <summary>
48+
/// Sovereign Government Cloud.
49+
/// </summary>
50+
public const string GovSGCloud = "GovSGCloud";
4151
}
4252

4353
/// <summary>
@@ -84,16 +94,6 @@ public static class EnvironmentType
8494
GraphEndpoint = "https://dod-graph.microsoft.us"
8595
}
8696
},
87-
// Germany national cloud endpoints.
88-
{
89-
EnvironmentName.Germany, new GraphEnvironment
90-
{
91-
Name = EnvironmentName.Germany,
92-
Type = EnvironmentType.BuiltIn,
93-
AzureADEndpoint = "https://login.microsoftonline.de",
94-
GraphEndpoint = "https://graph.microsoft.de"
95-
}
96-
},
9797
// China national cloud endpoints.
9898
{
9999
EnvironmentName.China, new GraphEnvironment
@@ -103,6 +103,36 @@ public static class EnvironmentType
103103
AzureADEndpoint = "https://login.chinacloudapi.cn",
104104
GraphEndpoint = "https://microsoftgraph.chinacloudapi.cn"
105105
}
106+
},
107+
// French sovereign cloud endpoints.
108+
{
109+
EnvironmentName.BleuCloud, new GraphEnvironment
110+
{
111+
Name = EnvironmentName.BleuCloud,
112+
Type = EnvironmentType.BuiltIn,
113+
AzureADEndpoint = "https://login.sovcloud-identity.fr",
114+
GraphEndpoint = "https://graph.svc.sovcloud.fr"
115+
}
116+
},
117+
// German sovereign cloud endpoints.
118+
{
119+
EnvironmentName.DelosCloud, new GraphEnvironment
120+
{
121+
Name = EnvironmentName.DelosCloud,
122+
Type = EnvironmentType.BuiltIn,
123+
AzureADEndpoint = "https://login.sovcloud-identity.de",
124+
GraphEndpoint = "https://graph.svc.sovcloud.de"
125+
}
126+
},
127+
// Sovereign Government Cloud endpoints.
128+
{
129+
EnvironmentName.GovSGCloud, new GraphEnvironment
130+
{
131+
Name = EnvironmentName.GovSGCloud,
132+
Type = EnvironmentType.BuiltIn,
133+
AzureADEndpoint = "https://login.sovcloud-identity.sg",
134+
GraphEndpoint = "https://graph.svc.sovcloud.sg"
135+
}
106136
}
107137
};
108138
}

src/Authentication/Authentication/test/Get-MgContext.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Describe 'Get-MgContext' {
2727

2828

2929
It 'Should return the correct environment when specified via Connect-MgGraph -Environment' {
30-
Connect-MgGraph -AccessToken (ConvertTo-SecureString -AsPlainText -String $DummyToken) -Environment Germany
30+
Connect-MgGraph -AccessToken (ConvertTo-SecureString -AsPlainText -String $DummyToken) -Environment DelosCloud
3131
$Context = Get-MgContext
3232
$Context | Should -Not -Be $null
33-
$Context.Environment | Should -Be "Germany"
33+
$Context.Environment | Should -Be "DelosCloud"
3434
$Context.AuthType | Should -Be "UserProvidedAccessToken"
3535
}
3636
}

0 commit comments

Comments
 (0)