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

Authz: node18 re-write #387

Merged
merged 87 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
2eedbff
Test version bump
sauntimo Feb 2, 2024
4a639ec
Temporarily set static asset path to develop
sauntimo Feb 6, 2024
699db9f
working api build
sauntimo Feb 9, 2024
5c75beb
taget node 18.16
sauntimo Feb 9, 2024
901aaae
Update .nvmrc
sauntimo Feb 9, 2024
89c8989
Update more deps
sauntimo Feb 14, 2024
ba3236b
Change package version to those available in webtask
sauntimo Feb 14, 2024
b331f12
Move deps to dev deps
sauntimo Feb 14, 2024
7932ee6
Fix joi syntax
sauntimo Feb 15, 2024
cf709a6
Fix webpack build
sauntimo Feb 15, 2024
4659d1a
Fix hapi plugin registration
sauntimo Feb 15, 2024
2f8fcbf
WIP: Hapi now starts
sauntimo Feb 20, 2024
a57f297
Updating more routes to async
sauntimo Feb 20, 2024
3d491f3
Move sessions plugin into repo
sauntimo Feb 22, 2024
8183ac2
WIP Updates for pairing
sauntimo Mar 1, 2024
0e0bef2
WIP but extension now starts
sauntimo Mar 6, 2024
23f53d5
wip commit
sauntimo Jul 5, 2024
fd9b9f5
Fix rule publish
sauntimo Aug 12, 2024
e4fc2e6
WIP: working on swagger for API explorer
sauntimo Aug 13, 2024
6fbd8d4
Fixed api auth
sauntimo Aug 15, 2024
fd454f9
WIP: Fixing integration tests
sauntimo Aug 15, 2024
9c62693
Fix remaining groups integratin tests
sauntimo Aug 15, 2024
4cd249a
Fix policy integration tests
sauntimo Aug 16, 2024
d2cd3f7
Fix role integration tests
sauntimo Aug 16, 2024
6bb720c
Fix users-route unit tests
sauntimo Aug 19, 2024
37fea66
Fix jwt signing for unit tests
sauntimo Aug 21, 2024
de4d6e0
WIP configuration route unit tests
sauntimo Aug 22, 2024
bbf39a9
Fix validation error messages
sauntimo Aug 22, 2024
ed57a2c
Fix connections-route unit tests
sauntimo Aug 22, 2024
9da1683
Fix groups-mapping-route unit tests
sauntimo Aug 22, 2024
d5d19aa
Fix groups-members-route unit tests
sauntimo Aug 22, 2024
9a610e4
Fix groups-nested-route unit tests
sauntimo Aug 22, 2024
5f00d00
Fix groups-roles-route unit tests
sauntimo Aug 22, 2024
d4cc561
Fix groups-route unit tests
sauntimo Aug 22, 2024
d056e1e
Fix metadata-route + unit test
sauntimo Aug 22, 2024
ca4ad5b
Fix permissions-route unit tests
sauntimo Aug 22, 2024
dd4f0f6
Fix storage provider unit tests
sauntimo Aug 22, 2024
83783c0
Fix users-groups-route unit tests
sauntimo Aug 22, 2024
b7c1eaa
Fix users-roles-route unit tests
sauntimo Aug 22, 2024
ade9c13
Fix users-route unit tests
sauntimo Aug 22, 2024
c568dbf
Fix auth unit tests
sauntimo Aug 22, 2024
769ceab
Fix queries unit tests
sauntimo Aug 22, 2024
a7a6cb9
Fix UserOverview test
sauntimo Aug 22, 2024
b19457b
Fix configuration reducers unit tests
sauntimo Aug 22, 2024
48b878d
Remove dev commands
sauntimo Aug 22, 2024
9f2c80b
Remove commented code:
sauntimo Aug 22, 2024
967eb09
keep version 2.12.0 for dev
sauntimo Aug 22, 2024
f9824ab
Updated package-lock.json
sauntimo Aug 23, 2024
3776009
Fix eslint for react+jsx
sauntimo Aug 27, 2024
1ce5b01
Fix client build errors
sauntimo Aug 27, 2024
6c8b0ad
Add unit test for user search
sauntimo Aug 27, 2024
dde8df9
Fix bug with missing search params + add unit & integration tests
sauntimo Aug 27, 2024
b9130e1
fix eslint rule
sauntimo Aug 30, 2024
4f988fc
Add settings object to eslint config
sauntimo Aug 30, 2024
9d73854
Improve error handling
sauntimo Aug 30, 2024
c1118ec
Refactor tests + add tests for deleting used entities
sauntimo Aug 30, 2024
acc85ed
Translate expired jwt error
sauntimo Aug 30, 2024
5ae14b1
Add test for not deleting nested group
sauntimo Aug 30, 2024
130d36c
Linting
sauntimo Aug 30, 2024
e02ccd0
Aoiv wildcard user search for connections
sauntimo Aug 30, 2024
523a373
Remove source map plugin which breaks frontend
sauntimo Aug 30, 2024
0db3465
Fix link to docs
sauntimo Aug 30, 2024
e0a876a
Remove commented code
sauntimo Aug 30, 2024
2eb31cb
Fix policy integration tests
sauntimo Aug 30, 2024
c36a1df
Fix expanded group test
sauntimo Aug 30, 2024
cbaed1a
Disable caching on layer0 test spaces
sauntimo Aug 30, 2024
8ab01b4
Refactor + fix some tests
sauntimo Aug 30, 2024
8d7c05d
Fix window.config.SEARCH_ENGINE
sauntimo Aug 31, 2024
13b7a69
Add comment on origin of session file
sauntimo Sep 17, 2024
f30fdc2
Rename file
sauntimo Sep 17, 2024
6b28b52
gitignore local config
sauntimo Sep 17, 2024
bb77c58
use node:util promisify
sauntimo Sep 17, 2024
684574b
Remove bluebird dep
sauntimo Sep 17, 2024
f2c7b02
Remove request dep
sauntimo Sep 17, 2024
16421ec
Verify jwt on login/callback
sauntimo Sep 17, 2024
e93cd72
remove log
sauntimo Sep 17, 2024
79f867e
map APIError to Bad Request
sauntimo Sep 17, 2024
e400511
Fix extension hook token validation
sauntimo Sep 19, 2024
ced85ea
Override version of auth0-extension-tools
sauntimo Oct 2, 2024
87688e7
Remove runtime prop from webtask.json
sauntimo Oct 2, 2024
8a9b79b
Fix response code in on-update
sauntimo Oct 2, 2024
93329dc
remove references to removed dependencies
sauntimo Oct 7, 2024
02c8454
remove unused dependencies
sauntimo Oct 7, 2024
76c6cd0
Display version number in extension title
sauntimo Oct 7, 2024
10f9754
Remove /develop from asset urls
sauntimo Oct 7, 2024
54ccca7
Fix issue with updating group roles
sauntimo Oct 8, 2024
9f19bb3
fix problematic deps for snyk
sauntimo Oct 8, 2024
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
45 changes: 3 additions & 42 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,44 +1,5 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"env": {
"development": {
"presets": []
},
"production": {
"presets": [
"minify"
]
}
},
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
"presets": ["@babel/preset-env", ["@babel/preset-react", {"runtime": "automatic"}]],
"plugins": ["@babel/plugin-proposal-export-default-from"],
"sourceMaps": true
}
10 changes: 7 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"extends": ["auth0-base", "plugin:import/errors", "plugin:import/warnings"],
"extends": ["auth0-base", "plugin:import/errors", "plugin:import/warnings", "plugin:react/recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"ecmaVersion": 4,
"ecmaVersion": 8,
"sourceType": "module"
},
"env": {
Expand All @@ -17,6 +17,9 @@
"Auth0Lock": false,
"window": false
},
"settings": {
"import/resolver": { "node": { "extensions": [".js",".jsx"] } }
},
"rules": {
"max-len": 0,
"react/display-name": 0,
Expand All @@ -31,7 +34,8 @@
"SwitchCase": 1
}
],
"import/no-extraneous-dependencies": [error, { "devDependencies": true }],

"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"import/namespace": 0,
"import/named": 0,
"import/prefer-default-export": 0,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ npm-debug.log
server/db.json
server/data.json
server/config.json
server/local.config.json
dist
build/extension/bundle-size.json
server/config.json
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
18.16
27 changes: 16 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [2.12.0] - 2024-09-01

- Update to run on node 18.16.0
- Bumps hapi.js framework to 21.3.3, and many other associated version bumps

## [2.11.0] - 2021-01-25

- Fix local development
Expand Down Expand Up @@ -31,7 +36,6 @@

- `PUBLIC_WT_URL` generation fixed for specific clusters


## [2.6.2] - 2019-03-28

- Clarify authorization information and claims
Expand All @@ -45,19 +49,19 @@
**BREAKING CHANGE:** After upgrading to 2.6 or a higher version, you need to do the following to continue operation:

1. Rotate your key and re-publish the rule on the extension's Configuration page. This is needed due to the changed
logic on storing and handling the Api Key.
logic on storing and handling the Api Key.
2. The rule published by this extension is named `auth0-authorization-extension`. Check your tenant's rules. If you see
a rule named `auth0-authz` disable/remove it **by following the instructions below**.
a rule named `auth0-authz` disable/remove it **by following the instructions below**.

#### Checklist to disable/remove `auth0-authz` rule:
#### Checklist to disable/remove `auth0-authz` rule:

1. Go to your tenant's rules
2. Modify `auth0-authorization-extension`'s order to be right next to `auth0-authz` extension.
3. Check `auth0-authz` to be sure that it is not authored by you and no manual changes are done.
4. Check `auth0-authz` to be sure that disabling/removing it will not change authorization flow in a way to grant
access or privileges to users that shouldn't have it.
5. Disable the `auth0-authz` rule. After verifying that everything is in order, you can choose to keep
it disabled or remove it.
1. Go to your tenant's rules
2. Modify `auth0-authorization-extension`'s order to be right next to `auth0-authz` extension.
3. Check `auth0-authz` to be sure that it is not authored by you and no manual changes are done.
4. Check `auth0-authz` to be sure that disabling/removing it will not change authorization flow in a way to grant
access or privileges to users that shouldn't have it.
5. Disable the `auth0-authz` rule. After verifying that everything is in order, you can choose to keep
it disabled or remove it.

Failing to do these will cause an "InvalidApiKey" or "You are not allowed to access this application." error on rule
execution.
Expand Down Expand Up @@ -87,6 +91,7 @@ execution.
- Optimizations to avoid Blocking event loop

## [2.4.8] - 2017-12-14

- Uses `setImmediate` to avoid blocks

## [2.4.7] - 2017-11-28
Expand Down
99 changes: 7 additions & 92 deletions build/webpack/config.base.js
Original file line number Diff line number Diff line change
@@ -1,115 +1,30 @@
const path = require('path');
const webpack = require('webpack');
const poststylus = require('poststylus');
const autoprefixer = require('autoprefixer');
const postcssReporter = require('postcss-reporter');

module.exports = {
devtool: 'cheap-module-source-map',
devtool: 'source-map',
stats: true,

// The application and the vendor libraries.
entry: {
app: path.resolve(__dirname, '../../client/app.jsx'),
vendors: [
'@babel/polyfill',
'axios',
'bluebird',
'classnames',
'history',
'immutable',
'jwt-decode',
'lodash',
'moment',
'react',
'react-bootstrap',
'react-dom',
'react-loader-advanced',
'react-router',
'react-redux',
'redux',
'redux-form',
'redux-thunk',
'redux-logger',
'redux-promise-middleware',
'redux-simple-router'
]
app: path.resolve(__dirname, '../../client/app.jsx')
},

target: 'web',

// Output directory.
output: {
path: path.join(__dirname, '../../dist'),
filename: 'bundle.js',
publicPath: '/app/'
},

plugins: [],

// Module configuration.
resolve: {
alias: {
// React: require('react')
},
modules: [ 'node_modules' ],
extensions: [ '.json', '.js', '.jsx' ]
},

// Load all modules.
module: {
rules: [
{
test: /\.jsx?$/,
use: [ { loader: 'babel-loader' } ],
exclude: path.join(__dirname, '../../node_modules/')
},
{
test: /\.(png|ttf|svg|jpg|gif)/,
loader: 'url-loader?limit=8192'
},
{
test: /\.(woff|woff2|eot)/,
loader: 'url-loader?limit=100000'
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
},
{
test: /\.styl$/,
use: [ 'style-loader', 'css-loader', 'stylus-loader' ]
}
]
},

// Default plugins.
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.ProvidePlugin({
React: 'react',
Promise: 'imports-loader?this=>global!exports-loader?global.Promise!bluebird'
}),
new webpack.DefinePlugin({
__DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
'process.env': {
BROWSER: JSON.stringify(true),
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
WARN_DB_SIZE: 409600,
MAX_MULTISELECT_USERS: 5,
MULTISELECT_DEBOUNCE_MS: 250,
PER_PAGE: 10
},
__CLIENT__: JSON.stringify(true),
__SERVER__: JSON.stringify(false)
}),
new webpack.LoaderOptionsPlugin({
options: {
stylus: {
use: [
poststylus([
autoprefixer({ browsers: [ 'last 2 versions', 'IE > 8' ] }),
postcssReporter({ clearMessages: true })
])
]
}
}
})
]
}
};
9 changes: 9 additions & 0 deletions build/webpack/config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ config.stats = {
reasons: true
};

config.resolve.fallback = {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify')
};

// Webpack plugins.
config.plugins = config.plugins.concat([
new webpack.HotModuleReplacementPlugin()
]);


config.mode = 'development';


module.exports = config;
Loading
Loading