1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: remove enableLegacyRoutes option from v2

This commit is contained in:
Ivar Conradi Østhus 2021-04-13 08:45:02 +02:00
parent 223bbbb50d
commit 469e87a923
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09
7 changed files with 9 additions and 9 deletions

View File

@ -52,5 +52,5 @@
} }
} }
], ],
"ignorePatterns": ["**/docs/api/oas/"] "ignorePatterns": ["**/docs/api/oas/", "examples/**"]
} }

View File

@ -85,7 +85,6 @@ Add `googleAdminAuth()` function and other options
function googleAdminAuth(app) {} function googleAdminAuth(app) {}
let options = { let options = {
enableLegacyRoutes: false,
adminAuthentication: 'custom', adminAuthentication: 'custom',
preRouterHook: googleAdminAuth, preRouterHook: googleAdminAuth,
}; };
@ -242,7 +241,6 @@ function googleAdminAuth(app) {
} }
const options = { const options = {
enableLegacyRoutes: false,
adminAuthentication: 'custom', adminAuthentication: 'custom',
preRouterHook: googleAdminAuth, preRouterHook: googleAdminAuth,
}; };

View File

@ -9,7 +9,7 @@ Generally, the intention is that `unleash-server` should always provide support
(Work In Process!) (Work In Process!)
### Role-based Access Control (RBAC) ### 1. Role-based Access Control (RBAC)
We have implemented RBAC in Unleash v4. This has totally changed the permission system in Unleash. We have implemented RBAC in Unleash v4. This has totally changed the permission system in Unleash.
@ -30,6 +30,12 @@ const user = userService.loginUserWithoutPassword(
req.session.user = user; req.session.user = user;
``` ```
### 3. Legacy v2 routes removed
Only relevant if you use the `enableLegacyRoutes` option.
Im v2 you could query feature toggles on `/api/features`. This was deprecated in v4 and we introduced two different endpoints (`/api/admin/features` and `/api/client/features`) to be able to optimize performance and security. In v3 you could still enable the legacy routes via the `enableLegacyRoutes` option. This was removed in v4.
## Upgrading from v2.x to v3.x ## Upgrading from v2.x to v3.x
The notable change introduced in Unleash v3.x is a strict separation of API paths for client requests and admin requests. This makes it easier to implement different authentication mechanisms for the admin UI and all unleash-clients. You can read more about [securing unleash](https://github.com/Unleash/unleash/blob/master/docs/securing-unleash.md). The notable change introduced in Unleash v3.x is a strict separation of API paths for client requests and admin requests. This makes it easier to implement different authentication mechanisms for the admin UI and all unleash-clients. You can read more about [securing unleash](https://github.com/Unleash/unleash/blob/master/docs/securing-unleash.md).

View File

@ -3,7 +3,7 @@ id: securing_unleash
title: Securing Unleash title: Securing Unleash
--- ---
> This guide is only relevant if you are using Unleash Open-Source. The Enterprise edition does already ship with a secure setup and multiple SSO options. > This guide is only relevant if you are using Unleash Open-Source. The Enterprise edition does already ship with a secure setup and multiple SSO options.
The Unleash API is split into two different paths: `/api/client` and `/api/admin`. This makes it easy to have different authentication strategy for the admin interface and the client-api used by the applications integrating with Unleash. The Unleash API is split into two different paths: `/api/client` and `/api/admin`. This makes it easy to have different authentication strategy for the admin interface and the client-api used by the applications integrating with Unleash.
@ -73,7 +73,6 @@ const sharedSecret = '12312Random';
unleash unleash
.start({ .start({
databaseUrl: 'postgres://unleash_user:passord@localhost:5432/unleash', databaseUrl: 'postgres://unleash_user:passord@localhost:5432/unleash',
enableLegacyRoutes: false,
preRouterHook: app => { preRouterHook: app => {
app.use('/api/client', (req, res, next) => { app.use('/api/client', (req, res, next) => {
if (req.header('authorization') !== sharedSecret) { if (req.header('authorization') !== sharedSecret) {

View File

@ -9,7 +9,6 @@ const sharedSecret = '12312Random';
unleash unleash
.start({ .start({
databaseUrl: 'postgres://unleash_user:passord@localhost:5432/unleash', databaseUrl: 'postgres://unleash_user:passord@localhost:5432/unleash',
enableLegacyRoutes: false,
preRouterHook: app => { preRouterHook: app => {
app.use('/api/client', (req, res, next) => { app.use('/api/client', (req, res, next) => {
if (req.header('authorization') === sharedSecret) { if (req.header('authorization') === sharedSecret) {

View File

@ -66,7 +66,6 @@ function defaultOptions() {
baseUriPath: process.env.BASE_URI_PATH || '', baseUriPath: process.env.BASE_URI_PATH || '',
unleashUrl: process.env.UNLEASH_URL || 'http://localhost:4242', unleashUrl: process.env.UNLEASH_URL || 'http://localhost:4242',
serverMetrics: true, serverMetrics: true,
enableLegacyRoutes: false, // deprecated. Remove in v4,
publicFolder, publicFolder,
versionCheck: { versionCheck: {
url: url:

View File

@ -17,7 +17,6 @@ function getSetup() {
baseUriPath: base, baseUriPath: base,
stores, stores,
eventBus, eventBus,
enableLegacyRoutes: true,
getLogger, getLogger,
}; };
const services = createServices(stores, config); const services = createServices(stores, config);