Skip to content

Commit

Permalink
Merge pull request #220 from uc-cdis/chore/userapi-path
Browse files Browse the repository at this point in the history
fix(shib): add shibbleth configuration
  • Loading branch information
thanh-nguyen-dang authored Feb 2, 2018
2 parents df6b38d + ba95428 commit 0266f4c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const fetchJsonOrText = (opts) => {
return Promise.resolve({ status: 200, data: JSON.parse(fetchCache[path]) });
}
const request = {
credentials: 'same-origin',
credentials: 'include',
headers: { ...headers, ...customHeaders },
method,
body,
Expand Down Expand Up @@ -96,7 +96,7 @@ export const fetchWrapper = ({ path, method = 'GET', body = null, customHeaders,

export const fetchGraphQL = (graphQLParams) => {
const request = {
credentials: 'same-origin',
credentials: 'include',
headers: { ...headers },
method: 'POST',
body: JSON.stringify(graphQLParams),
Expand Down
2 changes: 1 addition & 1 deletion src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' blob:; img-src 'self' data: https://www.google-analytics.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; object-src 'none'; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://login.bionimbus.org https://wayf.incommonfederation.org; img-src 'self' data: https://www.google-analytics.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; object-src 'none'; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com; connect-src 'self' https://login.bionimbus.org https://wayf.incommonfederation.org">
<meta name="viewport" content="width=device-width" />

<link rel="stylesheet" type="text/css" media="all" href="<%= htmlWebpackPlugin.options.basename %>/src/css/bootstrap.min.css">
Expand Down
19 changes: 17 additions & 2 deletions src/localconf.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ function buildConfig(opts) {

const { dev, mockStore, app, basename, hostname } = Object.assign({}, defaults, opts);

let userapiPath = `${hostname}user/`;
const submissionApiPath = `${hostname}api/v0/submission/`;
const apiPath = `${hostname}api/`;
const submissionApiOauthPath = `${hostname}api/v0/oauth2/`;
// let credentialOauthPath = `${hostname}middleware/oauth2/v0/`;
const credentialCdisPath = `${userapiPath}credentials/cdis/`;
const graphqlPath = `${hostname}api/v0/submission/graphql/`;
let userapiPath = `${hostname}user/`;
let credentialCdisPath = `${userapiPath}credentials/cdis/`;
let login = {
url: `${userapiPath}login/google?redirect=`,
title: 'Login from Google',
Expand Down Expand Up @@ -131,6 +131,21 @@ function buildConfig(opts) {
{ icon: 'face', link: '/identity', color: '#daa520', name: 'profile' },
{ icon: 'content_copy', link: '/files', color: '#a2a2a2', name: 'data' },
];
} else if (app === 'genomel') {
appname = 'GenoMEL Data Commons Portal';
const userapiPathOut = 'https://login.bionimbus.org/';
credentialCdisPath = `${userapiPath}credentials/cdis/`;
login = {
url: `${userapiPathOut}login/shib?redirect=`,
title: 'Login from NIH',
};
navItems = [
{ icon: 'home', link: '/', color: '#a2a2a2', name: 'home' },
{ icon: 'search', link: '/query', color: '#daa520', name: 'query' },
{ icon: 'class', link: '/DD', color: '#a2a2a2', name: 'dictionary' },
{ icon: 'face', link: '/identity', color: '#daa520', name: 'profile' },
{ icon: 'content_copy', link: '/files', color: '#a2a2a2', name: 'data' },
];
} else if (app === 'gdc') {
userapiPath = dev === true ? `${hostname}user/` : `${hostname}api/`;
// credentialPath = `${userapiPath}credentials/cleversafe/`;
Expand Down

0 comments on commit 0266f4c

Please sign in to comment.