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

fix(shib): add shibbleth configuration #220

Merged
merged 1 commit into from
Feb 2, 2018
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
2 changes: 1 addition & 1 deletion data/getSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { gdcSubPath } = (function () {

if (process.argv.length < 3) {
let gdcDefaultPath = process.env.HOSTNAME ? `https://${process.env.HOSTNAME}/api/v0/submission/` : 'http://localhost:5000/v0/submission/';
if (gdcDefaultPath.startsWith('revproxy')) {
if (process.env.HOSTNAME.startsWith('revproxy')) {
gdcDefaultPath = `http://${process.env.HOSTNAME}/api/v0/submission/`
}
return { status: 'ok', gdcSubPath: addSlash(process.env.GDC_SUBPATH || gdcDefaultPath) };
Expand Down
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