jackson/next.config.js

136 lines
3.6 KiB
JavaScript
Raw Normal View History

const { i18n } = require('./next-i18next.config');
/** @type {import('next').NextConfig} */
2022-02-16 01:39:38 +00:00
module.exports = {
experimental: { esmExternals: false, webpackBuildWorker: true },
2022-11-24 21:27:02 +00:00
productionBrowserSourceMaps: true,
reactStrictMode: true,
i18n,
output: 'standalone',
webpack: (config, { dev, webpack, isServer }) => {
// Enable source maps in development mode and for server-side rendering
if (!dev && isServer) {
config.devtool = 'source-map';
}
2022-02-16 01:39:38 +00:00
if (isServer) {
// Module not found
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp:
2024-01-11 14:25:09 +00:00
/(^@google-cloud\/spanner|^@mongodb-js\/zstd|^aws-crt|^aws4$|^pg-native$|^mongodb-client-encryption$|^@sap\/hana-client$|^@sap\/hana-client\/extension\/Stream$|^snappy$|^react-native-sqlite-storage$|^bson-ext$|^cardinal$|^kerberos$|^hdb-pool$|^sql.js$|^sqlite3$|^better-sqlite3$|^ioredis$|^typeorm-aurora-data-api-driver$|^pg-query-stream$|^oracledb$|^mysql$|^snappy\/package\.json$|^cloudflare:sockets$)/,
2022-02-16 01:39:38 +00:00
})
);
}
config.module = {
...config.module,
exprContextCritical: false,
};
2022-02-16 01:39:38 +00:00
return config;
},
Support for OIDC flow (#306) * Support 'POST' at authorization endpoint * handle additional scope params * handle additional claims param * Try with `legacy-peer-deps` true * Fix logic * Set legacy-peer-deps to `true` * Remove `.npmrc` files and sync packages from main * Resolve conflicts * Load jwtSigningKeys into env * Return id_token for OIDC flow * Support `nonce` * Add type for `nonce` * Set `nonce` only if present in request * Expose OpenId provider metadata * Update metadata * Tweak path remove dot, map jwks * Add jwsAlg and source keys using base64 * Source jose from root package.json too * JWS utils * Serve jwks_uri * Load private key for signing * Fix authz endpoint * Format example env * Fix claims * Format discovery and add missing metadata * Include the basic profile in id_token * Fix claims access * Remove console log * Sync package lock * Cleanup * Support for claims is optional * cleanup type * Set `Content-Type` header * Remove default from env * Handle jwt env * oidc fixture * Test for oidc flow, check id_token in response * Add jwt envs * Fix for undefined * Remove keys check in controller init * Runtime check for JWS keys * check if id_token is absent * Check for claims and verify signature * Snapshot test oidc discovery page * Add snapshot for linux to work in CI * Test with a fontless screenshot * test with this one * add a debug step * Get the entire dir for snapshot * Test with this * Comment out debug step * snapshot test jwks * Update env * Upload screenshot for linux * Add debug step * Update snapshot * Sync package lock * Remove local testing snapshots * Assert using api request * Update to use api test for jwks endpoint * Set `JWS_ALG` env * Prefix openid vars * Fix env access * Fix e2e test * Fix options in tests * Fix env var access * Use ttl from env * Simplify exp value setting * oidc discovery controller * Fix typing * Handle case where signing keys are not set * return `oidcDiscoveryController` * Throw a JacksonError like object * Use controllers and cleanup * throw JacksonError like object * Minor formatting * Fix typing and add check for undefined * Keep order of packages same as in main * Update key generation comment * Initialise `openid` correctly in npm * Cleanup * Set `sub` claim * Set 'sub' only for oidc flow
2022-07-23 17:04:55 +00:00
rewrites: async () => {
return [
{
source: '/.well-known/saml.cer',
destination: '/api/well-known/saml.cer',
},
Support for OIDC flow (#306) * Support 'POST' at authorization endpoint * handle additional scope params * handle additional claims param * Try with `legacy-peer-deps` true * Fix logic * Set legacy-peer-deps to `true` * Remove `.npmrc` files and sync packages from main * Resolve conflicts * Load jwtSigningKeys into env * Return id_token for OIDC flow * Support `nonce` * Add type for `nonce` * Set `nonce` only if present in request * Expose OpenId provider metadata * Update metadata * Tweak path remove dot, map jwks * Add jwsAlg and source keys using base64 * Source jose from root package.json too * JWS utils * Serve jwks_uri * Load private key for signing * Fix authz endpoint * Format example env * Fix claims * Format discovery and add missing metadata * Include the basic profile in id_token * Fix claims access * Remove console log * Sync package lock * Cleanup * Support for claims is optional * cleanup type * Set `Content-Type` header * Remove default from env * Handle jwt env * oidc fixture * Test for oidc flow, check id_token in response * Add jwt envs * Fix for undefined * Remove keys check in controller init * Runtime check for JWS keys * check if id_token is absent * Check for claims and verify signature * Snapshot test oidc discovery page * Add snapshot for linux to work in CI * Test with a fontless screenshot * test with this one * add a debug step * Get the entire dir for snapshot * Test with this * Comment out debug step * snapshot test jwks * Update env * Upload screenshot for linux * Add debug step * Update snapshot * Sync package lock * Remove local testing snapshots * Assert using api request * Update to use api test for jwks endpoint * Set `JWS_ALG` env * Prefix openid vars * Fix env access * Fix e2e test * Fix options in tests * Fix env var access * Use ttl from env * Simplify exp value setting * oidc discovery controller * Fix typing * Handle case where signing keys are not set * return `oidcDiscoveryController` * Throw a JacksonError like object * Use controllers and cleanup * throw JacksonError like object * Minor formatting * Fix typing and add check for undefined * Keep order of packages same as in main * Update key generation comment * Initialise `openid` correctly in npm * Cleanup * Set `sub` claim * Set 'sub' only for oidc flow
2022-07-23 17:04:55 +00:00
{
source: '/.well-known/openid-configuration',
destination: '/api/well-known/openid-configuration',
},
{
source: '/.well-known/oidc-configuration',
destination: '/well-known/oidc-configuration',
},
{
2022-10-29 13:21:30 +00:00
source: '/.well-known/sp-metadata',
destination: '/api/well-known/sp-metadata',
},
{
source: '/.well-known/idp-metadata',
destination: '/api/well-known/idp-metadata',
},
{
source: '/.well-known/saml-configuration',
destination: '/well-known/saml-configuration',
},
{
source: '/.well-known/idp-configuration',
destination: '/well-known/idp-configuration',
},
Support for OIDC flow (#306) * Support 'POST' at authorization endpoint * handle additional scope params * handle additional claims param * Try with `legacy-peer-deps` true * Fix logic * Set legacy-peer-deps to `true` * Remove `.npmrc` files and sync packages from main * Resolve conflicts * Load jwtSigningKeys into env * Return id_token for OIDC flow * Support `nonce` * Add type for `nonce` * Set `nonce` only if present in request * Expose OpenId provider metadata * Update metadata * Tweak path remove dot, map jwks * Add jwsAlg and source keys using base64 * Source jose from root package.json too * JWS utils * Serve jwks_uri * Load private key for signing * Fix authz endpoint * Format example env * Fix claims * Format discovery and add missing metadata * Include the basic profile in id_token * Fix claims access * Remove console log * Sync package lock * Cleanup * Support for claims is optional * cleanup type * Set `Content-Type` header * Remove default from env * Handle jwt env * oidc fixture * Test for oidc flow, check id_token in response * Add jwt envs * Fix for undefined * Remove keys check in controller init * Runtime check for JWS keys * check if id_token is absent * Check for claims and verify signature * Snapshot test oidc discovery page * Add snapshot for linux to work in CI * Test with a fontless screenshot * test with this one * add a debug step * Get the entire dir for snapshot * Test with this * Comment out debug step * snapshot test jwks * Update env * Upload screenshot for linux * Add debug step * Update snapshot * Sync package lock * Remove local testing snapshots * Assert using api request * Update to use api test for jwks endpoint * Set `JWS_ALG` env * Prefix openid vars * Fix env access * Fix e2e test * Fix options in tests * Fix env var access * Use ttl from env * Simplify exp value setting * oidc discovery controller * Fix typing * Handle case where signing keys are not set * return `oidcDiscoveryController` * Throw a JacksonError like object * Use controllers and cleanup * throw JacksonError like object * Minor formatting * Fix typing and add check for undefined * Keep order of packages same as in main * Update key generation comment * Initialise `openid` correctly in npm * Cleanup * Set `sub` claim * Set 'sub' only for oidc flow
2022-07-23 17:04:55 +00:00
{
source: '/oauth/jwks',
destination: '/api/oauth/jwks',
},
Setup Link Feature (#628) * Share setup link related changes 1. Setup link creation for saml connection 2. Setup link creation for Directory sync 3. Regeneration of Setup link 4. Ability to open setup link without login 5. Setup link opens up SAML connection page 6. Saml Connection page hides Tenant & Product fields * Saving SAML and OIDC configuration * showing the connection list on setup page * Connections CRUD * UI changes for Setup layout * semantics changes connection -> sso-connection * directory sync support for share link * showing only current tenant product directories * fixes mentioned in commnets by Aswin * prettier formatting * fixed route * minor fixes * Fix the layout rendering for the /setup routes * minor fixes * review changes * package lock changes * package json and lock changes * removed xmlbuilder * package lock changes * removed api call from ConnectionList component * Back button link fix * intermediate changes for Setup link list feature * setup link list related changes * UI fixes and actions * removed unwanted import * setup link list action hooked with correct functions * path rewrites, styling changes, toast regenerate & delete setup links * fixes for mutate * minor tweaks to clipboard icon * updated package-lock * formatting changes * removed console log * Added cusor pointer for action for LinkList component Removed unused variable & validation of empty token Removed redundent validation code linting fixes * Auto redirect in setup link page for sso-connection create form Delete icon on setup link list page on hover red color & tooltips * removed redirect and used isValidating * fixes for router replace * toast for setup links * fixes for dsync apis * redirect related change * removing redirect for sso-connection * fallback to error.message Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Kiran <kiran@boxyhq.com>
2022-12-13 21:41:27 +00:00
{
source: '/admin/directory-sync/setup-link',
destination: '/admin/setup-link',
},
{
source: '/admin/sso-connection/setup-link',
destination: '/admin/setup-link',
Setup Link Feature (#628) * Share setup link related changes 1. Setup link creation for saml connection 2. Setup link creation for Directory sync 3. Regeneration of Setup link 4. Ability to open setup link without login 5. Setup link opens up SAML connection page 6. Saml Connection page hides Tenant & Product fields * Saving SAML and OIDC configuration * showing the connection list on setup page * Connections CRUD * UI changes for Setup layout * semantics changes connection -> sso-connection * directory sync support for share link * showing only current tenant product directories * fixes mentioned in commnets by Aswin * prettier formatting * fixed route * minor fixes * Fix the layout rendering for the /setup routes * minor fixes * review changes * package lock changes * package json and lock changes * removed xmlbuilder * package lock changes * removed api call from ConnectionList component * Back button link fix * intermediate changes for Setup link list feature * setup link list related changes * UI fixes and actions * removed unwanted import * setup link list action hooked with correct functions * path rewrites, styling changes, toast regenerate & delete setup links * fixes for mutate * minor tweaks to clipboard icon * updated package-lock * formatting changes * removed console log * Added cusor pointer for action for LinkList component Removed unused variable & validation of empty token Removed redundent validation code linting fixes * Auto redirect in setup link page for sso-connection create form Delete icon on setup link list page on hover red color & tooltips * removed redirect and used isValidating * fixes for router replace * toast for setup links * fixes for dsync apis * redirect related change * removing redirect for sso-connection * fallback to error.message Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Kiran <kiran@boxyhq.com>
2022-12-13 21:41:27 +00:00
},
{
source: '/admin/sso-connection/setup-link/new',
destination: '/admin/setup-link/new',
},
{
source: '/admin/directory-sync/setup-link/new',
destination: '/admin/setup-link/new',
},
{
source: '/.well-known',
destination: '/well-known',
},
Admin portal sso login (#762) * env, login button & translations * added setting in sidebar Added login with sso button Added connection create form in settings * added new pages for Self SSO connection CRUD * Fixed Self SSO issue * Use @boxyhq/react-ui component for SSO * `await` on method instead of class * Fix import * Set fields to non-editable for settings view * Tweak for settings view * Add link for settings in sidebar * Take in admin SSO defaults from env * Tweak edit page for settings view * Remove `NEXT_PUBLIC` prefix * Switch back to getSSP from getStaticProps * Sync lock file * Set defaults in env * Filter out admin sso tenant/product * Load admin SSO tenant/product * Update heading * Fix back link * Use latest published version * Set `clientId` to dummy in provider init * Use the defaults from env * Fix redirectUrl after savingConnection for settingsView * Use `isLoading` from SWR * Fix settings view url for mutation and redirect in Edit * Replace api route path * Use rewrite instead of router.push and other tweaks * Reuse `ConnectionList` for settings * Use pagination query params in settings api * Import styles from sdk * Fix failing build * Use latest version * - Display badge for system sso connections - Reuse admin connection for retrieving system sso connections * Tweak styling * Construct profile in updateUser as done previously * Update react-ui * Remove extra truthy check * Hide pagination buttons for settings view * Install @boxyhq/react-ui as symlink to local * Tweak badge size * Rename admin portal sso envs * Fix the edit redirection for system sso Co-authored-by: ukrocks007 <ukrocks.mehta@gmail.com> Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Kiran K <kiran@boxyhq.com>
2023-01-12 15:09:08 +00:00
{
source: '/admin/settings',
destination: '/admin/settings/sso-connection',
},
{
source: '/api/v1/connections/:path*',
destination: '/api/v1/sso/:path*',
},
{
source: '/api/v1/directory-sync/:path*',
destination: '/api/v1/dsync/:path*',
},
{
source: '/api/v1/saml-traces/:path*',
destination: '/api/v1/sso-traces/:path*',
},
Support for OIDC flow (#306) * Support 'POST' at authorization endpoint * handle additional scope params * handle additional claims param * Try with `legacy-peer-deps` true * Fix logic * Set legacy-peer-deps to `true` * Remove `.npmrc` files and sync packages from main * Resolve conflicts * Load jwtSigningKeys into env * Return id_token for OIDC flow * Support `nonce` * Add type for `nonce` * Set `nonce` only if present in request * Expose OpenId provider metadata * Update metadata * Tweak path remove dot, map jwks * Add jwsAlg and source keys using base64 * Source jose from root package.json too * JWS utils * Serve jwks_uri * Load private key for signing * Fix authz endpoint * Format example env * Fix claims * Format discovery and add missing metadata * Include the basic profile in id_token * Fix claims access * Remove console log * Sync package lock * Cleanup * Support for claims is optional * cleanup type * Set `Content-Type` header * Remove default from env * Handle jwt env * oidc fixture * Test for oidc flow, check id_token in response * Add jwt envs * Fix for undefined * Remove keys check in controller init * Runtime check for JWS keys * check if id_token is absent * Check for claims and verify signature * Snapshot test oidc discovery page * Add snapshot for linux to work in CI * Test with a fontless screenshot * test with this one * add a debug step * Get the entire dir for snapshot * Test with this * Comment out debug step * snapshot test jwks * Update env * Upload screenshot for linux * Add debug step * Update snapshot * Sync package lock * Remove local testing snapshots * Assert using api request * Update to use api test for jwks endpoint * Set `JWS_ALG` env * Prefix openid vars * Fix env access * Fix e2e test * Fix options in tests * Fix env var access * Use ttl from env * Simplify exp value setting * oidc discovery controller * Fix typing * Handle case where signing keys are not set * return `oidcDiscoveryController` * Throw a JacksonError like object * Use controllers and cleanup * throw JacksonError like object * Minor formatting * Fix typing and add check for undefined * Keep order of packages same as in main * Update key generation comment * Initialise `openid` correctly in npm * Cleanup * Set `sub` claim * Set 'sub' only for oidc flow
2022-07-23 17:04:55 +00:00
];
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*',
},
],
},
async headers() {
return [
{
source: '/(.*?)',
headers: [
{
key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains;',
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
],
},
];
},
2022-02-16 01:39:38 +00:00
};