Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: sovereign clouds #955

Open
wants to merge 61 commits into
base: dev
Choose a base branch
from
Open

Feature: sovereign clouds #955

wants to merge 61 commits into from

Conversation

thewahome
Copy link
Collaborator

@thewahome thewahome commented May 19, 2021

Overview

Brings in the sovereign clouds feature (Closes #868)
Enables support for the canary environment (Closes #584)
Updates the Chinese version to the latest GE (Closes #614)

Demo

image

image

image

Notes

  • Logging in with a Microsoft work account exposes the 'Canary' option. Logging in from a China Locale exposes the China Cloud option.
  • Users who do not have access to the clouds will not be presented with the option in the more actions area or the cloud selector prompt.
  • We need to know whether we need to have soverign cloud support for Try It

Testing Instructions

China cloud

  • The Client ID changes, so when a user opts in, the page reloads

Canary

  • Log in with your Microsoft account
  • Go to the more actions area
  • Choose 'Select Cloud'
  • Select the canary version and close the dialog.
  • Notice the change in the URL to your selected cloud

@microsoftgraph microsoftgraph deleted a comment from github-actions bot May 19, 2021
@microsoftgraph microsoftgraph deleted a comment from github-actions bot May 19, 2021
@microsoftgraph microsoftgraph deleted a comment from github-actions bot May 19, 2021
@microsoftgraph microsoftgraph deleted a comment from github-actions bot May 20, 2021

const storageKey = 'cloud';

export const clouds: ICloud[] = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment that tells people that this is where new clouds are added

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

17.7% 17.7% Coverage
0.0% 0.0% Duplication

src/app/views/authentication/AuthenticationErrorsHints.ts Outdated Show resolved Hide resolved

const initialState: ICloud = globalCloud;

export function cloud(state = initialState, action: IAction): ICloud {
Copy link
Contributor

@Onokaev Onokaev Dec 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Can we add a test for this reducer?

import { IAction } from '../../../types/action';
import { SET_ACTIVE_CLOUD_SUCCESS } from '../redux-constants';

export function setActiveCloud(response: object): IAction {
Copy link
Contributor

@Onokaev Onokaev Dec 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Can we add a test for this action?

msalApplication.logout({
authority: this.getAuthority()
});
// msalApplication.logoutRedirect();
Copy link
Contributor

@Onokaev Onokaev Dec 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this must be a stray comment :)

@@ -50,7 +50,10 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {

public logOut() {
this.deleteHomeAccountId();
msalApplication.logoutRedirect();
msalApplication.logout({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logout function is deprecated in msal. We can use the logoutRedirect function in place of this

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-955.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-955.centralus.azurestaticapps.net

}

private canAccessChinaCloud() {
return geLocale === 'en-US';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using this when sovereign clouds in different countries was something to support.

I would use the locale to match the clouds I had. So that if a cloud for the region exists I would suggest to the user that they can opt in to using another cloud

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This specific line was tied specifically to the China cloud.. I used en_Us for demos

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe we can use locale to determine anything reliable regarding what clouds a user wants to be able to use.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-955.centralus.azurestaticapps.net

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 4, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

13.4% 13.4% Coverage
4.4% 4.4% Duplication

@thewahome thewahome requested a review from a team as a code owner February 15, 2024 13:41
}

const { emailAddress }: any = this.profile;
return (emailAddress && emailAddress.includes('.onmicrosoft.com'));

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

'
.onmicrosoft.com
' can be anywhere in the URL, and arbitrary hosts may come before or after it.
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-955.centralus.azurestaticapps.net

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-955.centralus.azurestaticapps.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants