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:
parent
223bbbb50d
commit
469e87a923
@ -52,5 +52,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ignorePatterns": ["**/docs/api/oas/"]
|
"ignorePatterns": ["**/docs/api/oas/", "examples/**"]
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
};
|
};
|
||||||
|
@ -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).
|
||||||
|
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -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:
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user