Skip to content

Commit

Permalink
Merge pull request #387 from auth0/authz-node18-dev
Browse files Browse the repository at this point in the history
Authz: node18 re-write
  • Loading branch information
sauntimo authored Oct 9, 2024
2 parents 6b907a0 + 9f19bb3 commit 5ca8d21
Show file tree
Hide file tree
Showing 135 changed files with 38,048 additions and 25,950 deletions.
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

0 comments on commit 5ca8d21

Please sign in to comment.