-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
131 changed files
with
3,404 additions
and
2,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
{ | ||
"extends": [ | ||
"../node_modules/cloudify-ui-common/configs/eslint-common-node.json" | ||
"plugin:node/recommended-module", | ||
"../.eslintrc.temp-overrides.json" | ||
], | ||
"rules": { | ||
"prefer-promise-reject-errors": "off" | ||
} | ||
"prefer-promise-reject-errors": "off", | ||
"node/no-missing-require": ["error", { | ||
"tryExtensions": [".js", ".ts", ".json"] | ||
}], | ||
"node/no-missing-import": ["error", {"tryExtensions": [".js", ".json", ".ts"]}] | ||
}, | ||
"overrides": [{ | ||
"files": "**/*.js", | ||
"extends": ["../node_modules/cloudify-ui-common/configs/eslint-common-node.json"] | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { RequestHandler } from 'express'; | ||
import { noop } from 'lodash'; | ||
|
||
const middlewareMock: RequestHandler = (req, _res, next) => { | ||
req.user = { username: 'testuser' }; | ||
next(); | ||
}; | ||
|
||
export default { | ||
authenticate: () => middlewareMock, | ||
initialize: () => middlewareMock, | ||
use: noop | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// @ts-nocheck File not migrated fully to TS | ||
import { Strategy } from 'passport-cookie'; | ||
import { getUser } from '../handler/AuthHandler'; | ||
import { TOKEN_COOKIE_NAME } from '../consts'; | ||
|
||
export default () => { | ||
return new Strategy({ cookieName: TOKEN_COOKIE_NAME }, (token, done) => | ||
getUser(token) | ||
.then(user => done(null, user)) | ||
.catch(err => done(null, false, err + token)) | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// @ts-nocheck File not migrated fully to TS | ||
|
||
import { Strategy } from 'passport-saml'; | ||
import fs from 'fs'; | ||
import { getConfig } from '../config'; | ||
|
||
export default () => { | ||
let cert; | ||
try { | ||
cert = fs.readFileSync(getConfig().app.saml.certPath, 'utf-8'); | ||
} catch (e) { | ||
throw new Error('Could not read SAML certificate [saml.certPath]', e); | ||
} | ||
|
||
return new Strategy( | ||
{ | ||
path: '/auth/saml/callback', | ||
entryPoint: getConfig().app.saml.ssoUrl, | ||
cert | ||
}, | ||
(user, done) => done(null, user) | ||
); | ||
}; |
19 changes: 8 additions & 11 deletions
19
backend/auth/TokenStrategy.js → backend/auth/TokenStrategy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'] | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.