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

[do not merge] Combined backend + frontend update - test branch #375

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
18.16
26 changes: 15 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.12.0] - 2024-02-01

- testing

## [2.11.0] - 2021-01-25

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

- `PUBLIC_WT_URL` generation fixed for specific clusters


## [2.6.2] - 2019-03-28

- Clarify authorization information and claims
Expand All @@ -45,19 +48,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 +90,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
18 changes: 16 additions & 2 deletions build/webpack/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,25 @@ module.exports = {
},
{
test: /\.(png|ttf|svg|jpg|gif)/,
loader: 'url-loader?limit=8192'
use: [
{
loader: 'url-loader',
options: {
limit: 8192
}
}
]
},
{
test: /\.(woff|woff2|eot)/,
loader: 'url-loader?limit=100000'
use: [
{
loader: 'url-loader',
options: {
limit: 100000
}
}
]
},
{
test: /\.css$/,
Expand Down
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;
205 changes: 137 additions & 68 deletions build/webpack/config.prod.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,149 @@
"use strict";
'use strict';
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// const webpack = require('webpack');

const webpack = require("webpack");
const StatsWriterPlugin = require("webpack-stats-plugin").StatsWriterPlugin;
const ExtractTextPlugin = require("extract-text-webpack-plugin");
// const StatsWriterPlugin = require("webpack-stats-plugin").StatsWriterPlugin;
// const ExtractTextPlugin = require("extract-text-webpack-plugin");

const project = require("../../package.json");
const config = require("./config.base.js");
const project = require('../../package.json');
// const config = require('./config.base.js');

config.profile = false;
// config.profile = false;

const version = process.env.EXTENSION_VERSION || project.version;

// Build output, which includes the hash.
config.output.filename = `auth0-authz.ui.${version}.js`;
// // Build output, which includes the hash.
// config.output.filename = `auth0-authz.ui.${version}.js`;

// Development modules.
config.module.rules.push({
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [ 'css-loader', 'postcss-loader' ]
})
});
config.module.rules.push({
test: /\.styl/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [ 'css-loader', 'stylus-loader' ]
})
});
// // Development modules.
// config.module.rules.push({
// test: /\.css$/,
// use: ExtractTextPlugin.extract({
// fallback: 'style-loader',
// use: [ 'css-loader', 'postcss-loader' ]
// })
// });
// config.module.rules.push({
// test: /\.styl/,
// use: ExtractTextPlugin.extract({
// fallback: 'style-loader',
// use: [ 'css-loader', 'stylus-loader' ]
// })
// });

// Webpack plugins.
config.plugins = config.plugins.concat([
// Extract CSS to a different file, will require additional configuration.
new ExtractTextPlugin({
filename: `auth0-authz.ui.${version}.css`,
allChunks: true
}),
// // Webpack plugins.
// config.plugins = config.plugins.concat([
// // Extract CSS to a different file, will require additional configuration.
// new ExtractTextPlugin({
// filename: `auth0-authz.ui.${version}.css`,
// allChunks: true
// }),
// new MiniCssExtractPlugin({
// filename: `auth0-authz.ui.${version}.css`
// })

// Separate the vendor in a different file.
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
filename: `auth0-authz.ui.vendors.${version}.js`
}),
// // Separate the vendor in a different file.
// new webpack.optimize.CommonsChunkPlugin({
// name: 'vendors',
// filename: `auth0-authz.ui.vendors.${version}.js`
// })

// Compress and uglify the output.
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
mangle: true,
output: {
comments: false
},
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
}
}),
// // Compress and uglify the output.
// new webpack.optimize.UglifyJsPlugin({
// sourceMap: true,
// mangle: true,
// output: {
// comments: false
// },
// compress: {
// sequences: true,
// dead_code: true,
// conditionals: true,
// booleans: true,
// unused: true,
// if_return: true,
// join_vars: true,
// drop_console: true
// }
// }),

// Alternative to StatsWriterPlugin.
new StatsWriterPlugin({
filename: "manifest.json",
transform: function transformData(data) {
const chunks = {
app: data.assetsByChunkName.app[0],
style: data.assetsByChunkName.app[1],
vendors: data.assetsByChunkName.vendors[0]
};
return JSON.stringify(chunks);
}
})
]);
// // Alternative to StatsWriterPlugin.
// new StatsWriterPlugin({
// filename: "manifest.json",
// transform: function transformData(data) {
// const chunks = {
// app: data.assetsByChunkName.app[0],
// style: data.assetsByChunkName.app[1],
// vendors: data.assetsByChunkName.vendors[0]
// };
// return JSON.stringify(chunks);
// }
// })
// ]);

// module.exports = config;

module.exports = config;
const path = require('path');
// const project = require('../../package.json');

// const version = process.env.EXTENSION_VERSION || project.version;

// Build output, which includes the hash.
module.exports = {
entry: {
app: path.resolve(__dirname, '../../client/app.jsx')
},
output: {
path: path.resolve(__dirname, '../../dist'),
filename: `auth0-authz.ui.${version}.js`
},
plugins: [
new MiniCssExtractPlugin({
filename: `auth0-authz.ui.${version}.css`
})
],
module: {
rules: [
{
test: /\.(js|jsx)$/, // Ensure we're transpiling both JS and JSX files
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.styl$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader'
},
{
loader: 'stylus-loader'
}
]
},
{
test: /\.css$/i,
use: [ MiniCssExtractPlugin.loader, 'css-loader' ]
}
]
},
resolve: {
extensions: [ '.js', '.jsx' ], // Add '.jsx' to the list of extensions to resolve
fallback: {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify')
// "stream": false
}
},
devServer: {
static: {
directory: path.join(__dirname, '../../dist')
},
compress: true,
port: 9000
}
};
Loading
Loading