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

Deploy GIC BCH Prod #174

Merged
merged 7 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

All notable changes to this project will be documented in this file. As our fork has diverged from AWS SWB mainline branch, we are noting the SWB version and the lab version together, as <swb version>\_<lab version>, starting from SWB mainline, 5.0.0.

## [5.0.0_1.4.2](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.4.1...v5.0.0_1.4.2) (03/14/2024)
- Emergency change to add login-blocking warning and system wide application warnings.

## [5.0.0_1.4.1](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.4.0...v5.0.0_1.4.1) (03/01/2024)
- Add copy changes and parameter for registration page.
- Add PIC-SURE landing page if stage parameter is set.
- Bugfix: Move conda env config to install_kernel script.

## [5.0.0_1.4.0](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.3.2...v5.0.0_1.4.0) (01/25/2024)
* Parameterize user register TOS acceptance.
* Add comma separated study whitelist in stage file.
* Add Jira support widget.
* Add dropdown to help link if more than one url is given.
- Parameterize user register TOS acceptance.
- Add comma separated study whitelist in stage file.
- Add Jira support widget.
- Add dropdown to help link if more than one url is given.

## [5.0.0_1.3.2](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.3.1...v5.0.0_1.3.2) (12/21/2023)
- Update register page email regex validation: validatorjs schema regex fields need slashes before and after the regex, or else it returns a validation error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import { types } from 'mobx-state-tree';

import { getUser } from '@aws-ee/base-ui/dist/helpers/api';
import { BaseStore } from '@aws-ee/base-ui/dist/models/BaseStore';
import { branding } from '@aws-ee/base-ui/dist/helpers/settings';

import { User } from './User';

const UserStore = BaseStore.named('UserStore')
.props({
user: types.maybe(User),
picsureLanding: branding.picsure.dualBranding,
})
.actions(self => {
// save the base implementation of cleanup
Expand All @@ -36,6 +38,11 @@ const UserStore = BaseStore.named('UserStore')
self.user = User.create(user);
});
},
bypassLanding() {
self.runInAction(() => {
self.picsureLanding = false;
});
},
cleanup: () => {
self.user = undefined;
superCleanup();
Expand All @@ -48,6 +55,10 @@ const UserStore = BaseStore.named('UserStore')
return _.isEmpty(self.user);
},

get defaultLocation() {
return self.picsureLanding ? '/landing' : '/dashboard';
},

// TODO this method should really be moved to the User model and renamed to something like projectIdOptions
get projectIdDropdown() {
const result = _.map(self.user.projectId, id => ({ key: id, value: id, text: id }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,42 @@ const cognitoType = {
$id: '#/properties/customRegister',
type: 'boolean',
},
appAlerts: {
$id: '#/properties/appAlerts',
type: 'object',
properties: {
loginBlocking: {
$id: '#/properties/appAlerts/loginBlocking',
type: 'string',
},
banner: {
$id: '#/properties/appAlerts/banner',
type: 'array',
items: {
$id: '#/properties/appAlerts/banner/items',
type: 'object',
properties: {
title: {
$id: '#/properties/appAlerts/banner/items/title',
type: 'string',
},
text: {
$id: '#/properties/appAlerts/banner/items/text',
type: 'string',
},
type: {
$id: '#/properties/appAlerts/banner/items/type',
type: 'string',
},
dismissable: {
$id: '#/properties/appAlerts/banner/items/dismissable',
type: 'boolean',
},
},
},
},
},
},
federatedIdentityProviders: {
$id: '#/properties/providerConfig/properties/federatedIdentityProviders',
type: 'array',
Expand Down Expand Up @@ -362,6 +398,7 @@ const publicConfigurations = [
'https://test-raas1.auth.us-east-1.amazoncognito.com/oauth2/authorize?response_type=token&client_id=199999999991&redirect_uri=https://12345.cloudfront.net&idp_identifier=datalake.example.com',
signOutUri:
'https://test-raas1.auth.us-east-1.amazoncognito.com/logout?client_id=199999999991&logout_uri=https://12345.cloudfront.net',
customRegister: false,
},
{
id: 'https://cognito-idp.us-east-1.amazonaws.com/us-east-1_poolId2',
Expand All @@ -374,6 +411,7 @@ const publicConfigurations = [
clientId: '28888888888882',
enableNativeUserPoolUsers: false,
customRegister: false,
appAlerts: undefined,
},
{
id: 'datalake2.example.com',
Expand All @@ -384,6 +422,7 @@ const publicConfigurations = [
'https://test-raas2.auth.us-east-1.amazoncognito.com/login?response_type=token&client_id=28888888888882&redirect_uri=https://12345.cloudfront.net&idp_identifier=datalake2.example.com',
signOutUri:
'https://test-raas2.auth.us-east-1.amazoncognito.com/logout?client_id=28888888888882&logout_uri=https://12345.cloudfront.net',
customRegister: false,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ async function configure(context) {
credentialHandlingType: provider.config.type.config.credentialHandlingType,
signInUri: provider.config.signInUri,
signOutUri: provider.config.signOutUri,
customRegister: provider.config.customRegister || false,
appAlerts: provider.appAlerts,
};

if (provider.config.type.type !== cognitoAuthType) {
Expand All @@ -58,7 +60,6 @@ async function configure(context) {
userPoolId: provider.config.userPoolId,
clientId: provider.config.clientId,
enableNativeUserPoolUsers: provider.config.enableNativeUserPoolUsers,
customRegister: provider.config.customRegister || false,
};

if (cognitoPublicInfo.enableNativeUserPoolUsers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const deSerializeProviderConfig = providerConfigStr => JSON.parse(providerConfig

const toProviderConfig = dbResultItem =>
_.assign({}, dbResultItem, {
appAlerts: dbResultItem.appAlerts,
config: dbResultItem && deSerializeProviderConfig(dbResultItem.config),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,42 @@
"$id": "#/properties/customRegister",
"type": "boolean"
},
"appAlerts": {
"$id": "#/properties/appAlerts",
"type": "object",
"properties": {
"loginBlocking": {
"$id": "#/properties/appAlerts/loginBlocking",
"type": "string"
},
"banner": {
"$id": "#/properties/appAlerts/banner",
"type": "array",
"items": {
"$id": "#/properties/appAlerts/banner/items",
"type": "object",
"properties": {
"title": {
"$id": "#/properties/appAlerts/banner/items/title",
"type": "string"
},
"text": {
"$id": "#/properties/appAlerts/banner/items/text",
"type": "string"
},
"type": {
"$id": "#/properties/appAlerts/banner/items/type",
"type": "string"
},
"dismissable": {
"$id": "#/properties/appAlerts/banner/items/dismissable",
"type": "boolean"
}
}
}
}
}
},
"federatedIdentityProviders": {
"$id": "#/properties/providerConfig/properties/federatedIdentityProviders",
"type": "array",
Expand Down
3 changes: 0 additions & 3 deletions addons/addon-base-ui/packages/base-ui/src/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ import { inject, observer } from 'mobx-react';
import { getEnv } from 'mobx-state-tree';
import { Message, Container } from 'semantic-ui-react';

import { branding } from './helpers/settings';

// expected props
// - pluginRegistry (via injection)
// - app (via injection)
// - location (from react router)
class AppContainer extends Component {
componentDidMount() {
document.title = branding.page.title;
document.querySelector("link[rel='shortcut icon']").href = this.props.assets.images.faviconIcon;
document.querySelector("link[rel='icon']").href = this.props.assets.images.faviconImage;
}
Expand Down
22 changes: 14 additions & 8 deletions addons/addon-base-ui/packages/base-ui/src/helpers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,30 @@ const autoLogoutTimeoutInMinutes = process.env.REACT_APP_AUTO_LOGOUT_TIMEOUT_IN_

const branding = {
login: {
title: process.env.REACT_APP_BRAND_LOGIN_TITLE,
subtitle: process.env.REACT_APP_BRAND_LOGIN_SUBTITLE,
title: process.env.REACT_APP_LOGIN_TITLE,
subtitle: process.env.REACT_APP_LOGIN_SUBTITLE,
warning: process.env.REACT_APP_LOGIN_WARNING,
tosLink: process.env.REACT_APP_LOGIN_TOS === 'true',
links: process.env.REACT_APP_LOGIN_LINKS,
},
register: {
title: process.env.REACT_APP_USER_REGISTRATION_TITLE,
summary: process.env.REACT_APP_USER_REGISTRATION_SUMMARY,
subtitle: process.env.REACT_APP_USER_REGISTRATION_SUBTITLE,
success: process.env.REACT_APP_USER_REGISTRATION_SUCCESS,
tosRequired: process.env.REACT_APP_USER_REGISTRATION_TOS_REQUIRED === 'true',
},
tos: {
onLanding: process.env.REACT_APP_TOS_LINK_ON_LANDING === 'true',
picsure: {
dualBranding: process.env.REACT_APP_PICSURE_DUALBRANDING === 'true',
url: process.env.REACT_APP_PICSURE_URL || '',
browserTitle: process.env.REACT_APP_PICSURE_BROWSER_TITLE,
title: process.env.REACT_APP_PICSURE_TITLE,
subtitle: process.env.REACT_APP_PICSURE_SUBTITLE,
},
main: {
title: process.env.REACT_APP_BRAND_MAIN_TITLE,
loginWarning: process.env.REACT_APP_LOGIN_WARNING,
browserTitle: process.env.REACT_APP_BROWSER_TITLE,
},
page: {
title: process.env.REACT_APP_BRAND_PAGE_TITLE,
title: process.env.REACT_APP_PAGE_TITLE,
help: process.env.REACT_APP_HELP_URL,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ function adjustRedirectUri(uri, redirectType = 'login') {
return adjustedUri;
}

const BannerAlert = types.model({
title: types.maybeNull(types.string),
text: types.string,
type: types.optional(types.string, 'info'),
dismissable: types.optional(types.boolean, true),
});

const AppAlerts = types.model({
loginBlocking: types.maybeNull(types.string),
banner: types.optional(types.array(BannerAlert), []),
});

const AuthenticationProviderPublicConfig = types
.model('AuthenticationProviderPublicConfig', {
id: '',
Expand All @@ -61,6 +73,7 @@ const AuthenticationProviderPublicConfig = types
signOutUri: '',
enableNativeUserPoolUsers: types.maybeNull(types.boolean),
customRegister: types.maybeNull(types.boolean),
appAlerts: types.maybeNull(AppAlerts),
})
.actions(self => ({
cleanup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ const AuthenticationProviderPublicConfigsStore = BaseStore.named('Authentication
const configs = self.authenticationProviderPublicConfigs || [];
return configs.find(({ type }) => type === nativeUserPool) || {};
},
get loginBlocking() {
return _.get(this.nativeUserPool, 'appAlerts.loginBlocking', false);
},
get bannerAlerts() {
return _.get(this.nativeUserPool, 'appAlerts.banner', []).slice();
},
toAuthenticationProviderFromId(authenticationProviderId) {
return _.find(self.authenticationProviderPublicConfigs, { id: authenticationProviderId });
},
Expand Down
Loading
Loading