@ytsaurus/ui 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -8
- package/build/cjs/server/index.js +5 -0
- package/build/cjs/server/index.js.map +1 -1
- package/build/cjs/server/middlewares/check-configuration.d.ts +3 -0
- package/build/cjs/server/middlewares/check-configuration.js +28 -0
- package/build/cjs/server/middlewares/check-configuration.js.map +1 -0
- package/build/esm/server/index.js +5 -0
- package/build/esm/server/index.js.map +1 -1
- package/build/esm/server/middlewares/check-configuration.d.ts +3 -0
- package/build/esm/server/middlewares/check-configuration.js +20 -0
- package/build/esm/server/middlewares/check-configuration.js.map +1 -0
- package/dist/server/index.js +5 -0
- package/dist/server/middlewares/check-configuration.d.ts +3 -0
- package/dist/server/middlewares/check-configuration.js +28 -0
- package/package.json +2 -2
package/README.md
CHANGED
@@ -10,7 +10,16 @@ Additionally you have to provide `secrets/yt-interface-secret.json` file with [a
|
|
10
10
|
|
11
11
|
```json
|
12
12
|
{
|
13
|
-
|
13
|
+
// common oauth token, the token is used if there is no cluster-specific token in the file
|
14
|
+
"oauthToken": "special-user-secret-tocken",
|
15
|
+
"cluster_id1": {
|
16
|
+
// cluster_id1 specific oauth token
|
17
|
+
"oauthToken": "cluster1-special-user-secret-token"
|
18
|
+
},
|
19
|
+
"cluster_id2": {
|
20
|
+
// cluster_id2 specific oauth token
|
21
|
+
"oauthToken": "cluster2-special-user-secret-token"
|
22
|
+
}
|
14
23
|
}
|
15
24
|
```
|
16
25
|
|
@@ -43,9 +52,20 @@ Another way is to provide `clusters-config.json` and run the command like:
|
|
43
52
|
$ npm run dev:app
|
44
53
|
```
|
45
54
|
|
55
|
+
### Docker
|
56
|
+
|
57
|
+
There is ability to build docker-image:
|
58
|
+
|
59
|
+
```
|
60
|
+
$ docker build . -t ytsaurus-ui:my-tag
|
61
|
+
```
|
62
|
+
|
63
|
+
All application files in a resulting docker-image will be placed in /opt/app, so you have to mount `/opt/app/cluster-config.json` and `/opt/app/secrets/yt-interface-secret.json`.
|
64
|
+
|
46
65
|
### Environment variables
|
47
66
|
|
48
67
|
- `YT_AUTH_ALLOW_INSECURE` - if defined allows insecure (over http) authentication, do not use it for production
|
68
|
+
- `ALLOW_PASSWORD_AUTH` - If defined, the app requires a password for cluster access
|
49
69
|
|
50
70
|
### Feature flags
|
51
71
|
|
@@ -74,12 +94,9 @@ Available flags (**default values** are highlighted in bold):
|
|
74
94
|
|
75
95
|
By default the application uses base configuration from `path_to_dist/server/configs/common.js` file. The behavior might be adjusted through `APP_ENV` and `APP_INSTALLATION` environment variables, see [README.config.md](./docs/configuration.md) for more details.
|
76
96
|
|
77
|
-
###
|
78
|
-
|
79
|
-
There is ability to build docker-image:
|
97
|
+
### Migration
|
80
98
|
|
81
|
-
|
82
|
-
$ docker build . -t ytsaurus-ui:my-tag
|
83
|
-
```
|
99
|
+
#### v1.17.0
|
84
100
|
|
85
|
-
|
101
|
+
- [`YT_AUTH_CLUSTER_ID`](https://github.com/ytsaurus/ytsaurus-ui/blob/ui-v1.16.1/packages/ui/README.md#environment-variables) environment variable has been replaced by [`ALLOW_PASSWORD_AUTH`](https://github.com/ytsaurus/ytsaurus-ui/blob/main/packages/ui/README.md#environment-variables).
|
102
|
+
- [`config.ytAuthCluster`](https://github.com/ytsaurus/ytsaurus-ui/blob/ui-v1.16.1/packages/ui/src/%40types/core.d.ts#L75) option has been replaced by [`config.allowPasswordAuth`](https://github.com/ytsaurus/ytsaurus-ui/blob/ui-v1.17.0/packages/ui/src/%40types/core.d.ts#L16).
|
@@ -13,6 +13,7 @@ const routes_1 = __importDefault(require("./routes"));
|
|
13
13
|
const oauth_1 = require("./middlewares/oauth");
|
14
14
|
const authorization_1 = require("./middlewares/authorization");
|
15
15
|
const authorization_2 = require("./utils/authorization");
|
16
|
+
const check_configuration_1 = require("./middlewares/check-configuration");
|
16
17
|
const nodekit = new nodekit_1.NodeKit({ configsPath: path_1.default.resolve(__dirname, './configs') });
|
17
18
|
const { appName, appEnv, appInstallation, appDevMode } = nodekit.config;
|
18
19
|
nodekit.ctx.log('AppConfig details', {
|
@@ -37,6 +38,10 @@ if (authMiddlewares.length) {
|
|
37
38
|
nodekit.config.appAuthHandler = (0, authorization_1.createAuthMiddleware)();
|
38
39
|
}
|
39
40
|
(_b = (_a = nodekit.config).adjustAppConfig) === null || _b === void 0 ? void 0 : _b.call(_a, nodekit);
|
41
|
+
const configurationErrors = (0, check_configuration_1.createConfigurationErrorsMidleware)(nodekit.config);
|
42
|
+
if (configurationErrors) {
|
43
|
+
nodekit.config.appBeforeAuthMiddleware = [configurationErrors];
|
44
|
+
}
|
40
45
|
const app = new expresskit_1.ExpressKit(nodekit, routes_1.default);
|
41
46
|
(0, configure_app_1.configureApp)(app);
|
42
47
|
if (require.main === module) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","_interopRequireDefault","require","_nodekit","_expresskit","_configureApp","_ytAuth","_routes","_oauth","_authorization","_authorization2","obj","__esModule","default","nodekit","NodeKit","configsPath","path","resolve","__dirname","_nodekit$config","config","appName","appEnv","appInstallation","appDevMode","ctx","log","_nodekit$config2","allowPasswordAuth","ytOAuthSettings","authMiddlewares","push","authorizationResolver","createOAuthAuthorizationResolver","createYTAuthorizationResolver","length","appBeforeAuthMiddleware","concat","_toConsumableArray","appAuthHandler","createAuthMiddleware","_nodekit$config$adjus","_nodekit$config3","adjustAppConfig","call","app","ExpressKit","routes","configureApp","main","module","run","_default","exports"],"sources":["index.ts"],"sourcesContent":["import path from 'path';\nimport
|
1
|
+
{"version":3,"names":["_path","_interopRequireDefault","require","_nodekit","_expresskit","_configureApp","_ytAuth","_routes","_oauth","_authorization","_authorization2","_checkConfiguration","obj","__esModule","default","nodekit","NodeKit","configsPath","path","resolve","__dirname","_nodekit$config","config","appName","appEnv","appInstallation","appDevMode","ctx","log","_nodekit$config2","allowPasswordAuth","ytOAuthSettings","authMiddlewares","push","authorizationResolver","createOAuthAuthorizationResolver","createYTAuthorizationResolver","length","appBeforeAuthMiddleware","concat","_toConsumableArray","appAuthHandler","createAuthMiddleware","_nodekit$config$adjus","_nodekit$config3","adjustAppConfig","call","configurationErrors","createConfigurationErrorsMidleware","app","ExpressKit","routes","configureApp","main","module","run","_default","exports"],"sources":["index.ts"],"sourcesContent":["import path from 'path';\nimport {NodeKit} from '@gravity-ui/nodekit';\nimport {ExpressKit} from '@gravity-ui/expresskit';\n\nimport {configureApp} from './configure-app';\n\nimport {createYTAuthorizationResolver} from './middlewares/yt-auth';\nimport routes from './routes';\nimport {createOAuthAuthorizationResolver} from './middlewares/oauth';\nimport {createAuthMiddleware} from './middlewares/authorization';\nimport {authorizationResolver} from './utils/authorization';\nimport {createConfigurationErrorsMidleware} from './middlewares/check-configuration';\n\nconst nodekit = new NodeKit({configsPath: path.resolve(__dirname, './configs')});\n\nconst {appName, appEnv, appInstallation, appDevMode} = nodekit.config;\nnodekit.ctx.log('AppConfig details', {\n appName,\n appEnv,\n appInstallation,\n appDevMode,\n});\n\nconst {allowPasswordAuth, ytOAuthSettings} = nodekit.config;\n\nconst authMiddlewares = [];\n\nif (ytOAuthSettings) {\n authMiddlewares.push(authorizationResolver(createOAuthAuthorizationResolver()));\n}\n\nif (allowPasswordAuth) {\n authMiddlewares.push(authorizationResolver(createYTAuthorizationResolver()));\n}\n\nif (authMiddlewares.length) {\n nodekit.config.appBeforeAuthMiddleware = [\n ...(nodekit.config.appBeforeAuthMiddleware || []),\n ...authMiddlewares,\n ];\n\n nodekit.config.appAuthHandler = createAuthMiddleware();\n}\n\nnodekit.config.adjustAppConfig?.(nodekit);\n\nconst configurationErrors = createConfigurationErrorsMidleware(nodekit.config);\nif (configurationErrors) {\n nodekit.config.appBeforeAuthMiddleware = [configurationErrors];\n}\n\nconst app = new ExpressKit(nodekit, routes);\nconfigureApp(app);\n\nif (require.main === module) {\n app.run();\n}\n\nexport default app;\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,s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A,IAAIL,iBAAiB,EAAE;EACnBE,eAAe,CAACC,IAAI,CAAC,IAAAC,qCAAqB,EAAC,IAAAE,qCAA6B,EAAC,CAAC,CAAC,CAAC;AAChF;AAEA,IAAIJ,eAAe,CAACK,MAAM,EAAE;EACxBtB,OAAO,CAACO,MAAM,CAACgB,uBAAuB,MAAAC,MAAA,KAAAC,2BAAA,EAC9BzB,OAAO,CAACO,MAAM,CAACgB,uBAAuB,IAAI,EAAE,GAC7CN,eAAe,CACrB;EAEDjB,OAAO,CAACO,MAAM,CAACmB,cAAc,GAAG,IAAAC,mCAAoB,EAAC,CAAC;AAC1D;AAEA,CAAAC,qBAAA,IAAAC,gBAAA,GAAA7B,OAAO,CAACO,MAAM,EAACuB,eAAe,cAAAF,qBAAA,eAA9BA,qBAAA,CAAAG,IAAA,CAAAF,gBAAA,EAAiC7B,OAAO,CAAC;AAEzC,IAAMgC,mBAAmB,GAAG,IAAAC,sDAAkC,EAACjC,OAAO,CAACO,MAAM,CAAC;AAC9E,IAAIyB,mBAAmB,EAAE;EACrBhC,OAAO,CAACO,MAAM,CAACgB,uBAAuB,GAAG,CAACS,mBAAmB,CAAC;AAClE;AAEA,IAAME,GAAG,GAAG,IAAIC,sBAAU,CAACnC,OAAO,EAAEoC,eAAM,CAAC;AAC3C,IAAAC,0BAAY,EAACH,GAAG,CAAC;AAEjB,IAAI/C,OAAO,CAACmD,IAAI,KAAKC,MAAM,EAAE;EACzBL,GAAG,CAACM,GAAG,CAAC,CAAC;AACb;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEemC,GAAG"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createConfigurationErrorsMidleware = void 0;
|
4
|
+
function checkConfigurationMiddleware(errors) {
|
5
|
+
return function checkConfiguration(_req, res) {
|
6
|
+
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
7
|
+
const body = `Please fix the problems below:<br>
|
8
|
+
<ol>
|
9
|
+
${errors.map((i) => `<li>${i}</li>`).join('\n')}
|
10
|
+
</ol>
|
11
|
+
Please refer to the <a target='_blank' href='https://github.com/ytsaurus/ytsaurus-ui/tree/main/packages/ui#migration'>migration notices<a/> for more details.
|
12
|
+
`;
|
13
|
+
res.status(500).end(body);
|
14
|
+
};
|
15
|
+
}
|
16
|
+
function createConfigurationErrorsMidleware(config) {
|
17
|
+
const configurationErrors = [];
|
18
|
+
if (process.env.YT_AUTH_CLUSTER_ID) {
|
19
|
+
configurationErrors.push('The YT_AUTH_CLUSTER_ID environment variable is no longer supported, please replace it with ALLOW_PASSWORD_AUTH');
|
20
|
+
}
|
21
|
+
if ('ytAuthCluster' in config) {
|
22
|
+
configurationErrors.push('The config setting `config.ytAuthCluster` is no longer supported, please replace it with `config.allowPasswordAuth` or use ALLOW_PASSWORD_AUTH environment variable');
|
23
|
+
}
|
24
|
+
return configurationErrors.length > 0
|
25
|
+
? checkConfigurationMiddleware([...configurationErrors])
|
26
|
+
: undefined;
|
27
|
+
}
|
28
|
+
exports.createConfigurationErrorsMidleware = createConfigurationErrorsMidleware;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["checkConfigurationMiddleware","errors","checkConfiguration","_req","res","setHeader","body","concat","map","i","join","status","end","createConfigurationErrorsMidleware","config","configurationErrors","process","env","YT_AUTH_CLUSTER_ID","push","length","undefined"],"sources":["check-configuration.ts"],"sourcesContent":["import type {Request, Response} from 'express';\nimport {AppMiddleware} from '@gravity-ui/expresskit';\nimport {AppConfig} from '@gravity-ui/nodekit';\n\nfunction checkConfigurationMiddleware(errors: Array<string>): AppMiddleware {\n return function checkConfiguration(_req: Request, res: Response) {\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n const body = `Please fix the problems below:<br>\n <ol>\n ${errors.map((i) => `<li>${i}</li>`).join('\\n')}\n </ol>\n Please refer to the <a target='_blank' href='https://github.com/ytsaurus/ytsaurus-ui/tree/main/packages/ui#migration'>migration notices<a/> for more details.\n `;\n res.status(500).end(body);\n };\n}\n\nexport function createConfigurationErrorsMidleware(config: AppConfig) {\n const configurationErrors: Array<string> = [];\n if (process.env.YT_AUTH_CLUSTER_ID) {\n configurationErrors.push(\n 'The YT_AUTH_CLUSTER_ID environment variable is no longer supported, please replace it with ALLOW_PASSWORD_AUTH',\n );\n }\n\n if ('ytAuthCluster' in config) {\n configurationErrors.push(\n 'The config setting `config.ytAuthCluster` is no longer supported, please replace it with `config.allowPasswordAuth` or use ALLOW_PASSWORD_AUTH environment variable',\n );\n }\n\n return configurationErrors.length > 0\n ? checkConfigurationMiddleware([...configurationErrors])\n : undefined;\n}\n"],"mappings":";;;;;;AAIA,SAASA,4BAA4BA,CAACC,MAAqB,EAAiB;EACxE,OAAO,SAASC,kBAAkBA,CAACC,IAAa,EAAEC,GAAa,EAAE;IAC7DA,GAAG,CAACC,SAAS,CAAC,cAAc,EAAE,0BAA0B,CAAC;IACzD,IAAMC,IAAI,4EAAAC,MAAA,CAEAN,MAAM,CAACO,GAAG,CAAC,UAACC,CAAC;MAAA,cAAAF,MAAA,CAAYE,CAAC;IAAA,CAAO,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,6MAGtD;IACDN,GAAG,CAACO,MAAM,CAAC,GAAG,CAAC,CAACC,GAAG,CAACN,IAAI,CAAC;EAC7B,CAAC;AACL;AAEO,SAASO,kCAAkCA,CAACC,MAAiB,EAAE;EAClE,IAAMC,mBAAkC,GAAG,EAAE;EAC7C,IAAIC,OAAO,CAACC,GAAG,CAACC,kBAAkB,EAAE;IAChCH,mBAAmB,CAACI,IAAI,CACpB,gHACJ,CAAC;EACL;EAEA,IAAI,eAAe,IAAIL,MAAM,EAAE;IAC3BC,mBAAmB,CAACI,IAAI,CACpB,qKACJ,CAAC;EACL;EAEA,OAAOJ,mBAAmB,CAACK,MAAM,GAAG,CAAC,GAC/BpB,4BAA4B,IAAAO,MAAA,CAAKQ,mBAAmB,CAAC,CAAC,GACtDM,SAAS;AACnB"}
|
@@ -9,6 +9,7 @@ import routes from './routes';
|
|
9
9
|
import { createOAuthAuthorizationResolver } from './middlewares/oauth';
|
10
10
|
import { createAuthMiddleware } from './middlewares/authorization';
|
11
11
|
import { authorizationResolver } from './utils/authorization';
|
12
|
+
import { createConfigurationErrorsMidleware } from './middlewares/check-configuration';
|
12
13
|
var nodekit = new NodeKit({
|
13
14
|
configsPath: path.resolve(__dirname, './configs')
|
14
15
|
});
|
@@ -38,6 +39,10 @@ if (authMiddlewares.length) {
|
|
38
39
|
nodekit.config.appAuthHandler = createAuthMiddleware();
|
39
40
|
}
|
40
41
|
(_nodekit$config$adjus = (_nodekit$config3 = nodekit.config).adjustAppConfig) === null || _nodekit$config$adjus === void 0 || _nodekit$config$adjus.call(_nodekit$config3, nodekit);
|
42
|
+
var configurationErrors = createConfigurationErrorsMidleware(nodekit.config);
|
43
|
+
if (configurationErrors) {
|
44
|
+
nodekit.config.appBeforeAuthMiddleware = [configurationErrors];
|
45
|
+
}
|
41
46
|
var app = new ExpressKit(nodekit, routes);
|
42
47
|
configureApp(app);
|
43
48
|
if (require.main === module) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["path","NodeKit","ExpressKit","configureApp","createYTAuthorizationResolver","routes","createOAuthAuthorizationResolver","createAuthMiddleware","authorizationResolver","nodekit","configsPath","resolve","__dirname","_nodekit$config","config","appName","appEnv","appInstallation","appDevMode","ctx","log","_nodekit$config2","allowPasswordAuth","ytOAuthSettings","authMiddlewares","push","length","appBeforeAuthMiddleware","concat","_toConsumableArray","appAuthHandler","_nodekit$config$adjus","_nodekit$config3","adjustAppConfig","call","app","require","main","module","run"],"sources":["index.ts"],"sourcesContent":["import path from 'path';\nimport
|
1
|
+
{"version":3,"names":["path","NodeKit","ExpressKit","configureApp","createYTAuthorizationResolver","routes","createOAuthAuthorizationResolver","createAuthMiddleware","authorizationResolver","createConfigurationErrorsMidleware","nodekit","configsPath","resolve","__dirname","_nodekit$config","config","appName","appEnv","appInstallation","appDevMode","ctx","log","_nodekit$config2","allowPasswordAuth","ytOAuthSettings","authMiddlewares","push","length","appBeforeAuthMiddleware","concat","_toConsumableArray","appAuthHandler","_nodekit$config$adjus","_nodekit$config3","adjustAppConfig","call","configurationErrors","app","require","main","module","run"],"sources":["index.ts"],"sourcesContent":["import path from 'path';\nimport {NodeKit} from '@gravity-ui/nodekit';\nimport {ExpressKit} from '@gravity-ui/expresskit';\n\nimport {configureApp} from './configure-app';\n\nimport {createYTAuthorizationResolver} from './middlewares/yt-auth';\nimport routes from './routes';\nimport {createOAuthAuthorizationResolver} from './middlewares/oauth';\nimport {createAuthMiddleware} from './middlewares/authorization';\nimport {authorizationResolver} from './utils/authorization';\nimport {createConfigurationErrorsMidleware} from './middlewares/check-configuration';\n\nconst nodekit = new NodeKit({configsPath: path.resolve(__dirname, './configs')});\n\nconst {appName, appEnv, appInstallation, appDevMode} = nodekit.config;\nnodekit.ctx.log('AppConfig details', {\n appName,\n appEnv,\n appInstallation,\n appDevMode,\n});\n\nconst {allowPasswordAuth, ytOAuthSettings} = nodekit.config;\n\nconst authMiddlewares = [];\n\nif (ytOAuthSettings) {\n authMiddlewares.push(authorizationResolver(createOAuthAuthorizationResolver()));\n}\n\nif (allowPasswordAuth) {\n authMiddlewares.push(authorizationResolver(createYTAuthorizationResolver()));\n}\n\nif (authMiddlewares.length) {\n nodekit.config.appBeforeAuthMiddleware = [\n ...(nodekit.config.appBeforeAuthMiddleware || []),\n ...authMiddlewares,\n ];\n\n nodekit.config.appAuthHandler = createAuthMiddleware();\n}\n\nnodekit.config.adjustAppConfig?.(nodekit);\n\nconst configurationErrors = createConfigurationErrorsMidleware(nodekit.config);\nif (configurationErrors) {\n nodekit.config.appBeforeAuthMiddleware = [configurationErrors];\n}\n\nconst app = new ExpressKit(nodekit, routes);\nconfigureApp(app);\n\nif (require.main === module) {\n app.run();\n}\n\nexport default app;\n"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,MAAM;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,eAAe,CAACE,MAAM,EAAE;EACxBjB,OAAO,CAACK,MAAM,CAACa,uBAAuB,MAAAC,MAAA,CAAAC,kBAAA,CAC9BpB,OAAO,CAACK,MAAM,CAACa,uBAAuB,IAAI,EAAE,GAC7CH,eAAe,CACrB;EAEDf,OAAO,CAACK,MAAM,CAACgB,cAAc,GAAGxB,oBAAoB,CAAC,CAAC;AAC1D;AAEA,CAAAyB,qBAAA,IAAAC,gBAAA,GAAAvB,OAAO,CAACK,MAAM,EAACmB,eAAe,cAAAF,qBAAA,eAA9BA,qBAAA,CAAAG,IAAA,CAAAF,gBAAA,EAAiCvB,OAAO,CAAC;AAEzC,IAAM0B,mBAAmB,GAAG3B,kCAAkC,CAACC,OAAO,CAACK,MAAM,CAAC;AAC9E,IAAIqB,mBAAmB,EAAE;EACrB1B,OAAO,CAACK,MAAM,CAACa,uBAAuB,GAAG,CAACQ,mBAAmB,CAAC;AAClE;AAEA,IAAMC,GAAG,GAAG,IAAInC,UAAU,CAACQ,OAAO,EAAEL,MAAM,CAAC;AAC3CF,YAAY,CAACkC,GAAG,CAAC;AAEjB,IAAIC,OAAO,CAACC,IAAI,KAAKC,MAAM,EAAE;EACzBH,GAAG,CAACI,GAAG,CAAC,CAAC;AACb;AAEA,eAAeJ,GAAG"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
function checkConfigurationMiddleware(errors) {
|
2
|
+
return function checkConfiguration(_req, res) {
|
3
|
+
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
4
|
+
var body = "Please fix the problems below:<br>\n <ol>\n ".concat(errors.map(function (i) {
|
5
|
+
return "<li>".concat(i, "</li>");
|
6
|
+
}).join('\n'), "\n </ol>\n Please refer to the <a target='_blank' href='https://github.com/ytsaurus/ytsaurus-ui/tree/main/packages/ui#migration'>migration notices<a/> for more details.\n ");
|
7
|
+
res.status(500).end(body);
|
8
|
+
};
|
9
|
+
}
|
10
|
+
export function createConfigurationErrorsMidleware(config) {
|
11
|
+
var configurationErrors = [];
|
12
|
+
if (process.env.YT_AUTH_CLUSTER_ID) {
|
13
|
+
configurationErrors.push('The YT_AUTH_CLUSTER_ID environment variable is no longer supported, please replace it with ALLOW_PASSWORD_AUTH');
|
14
|
+
}
|
15
|
+
if ('ytAuthCluster' in config) {
|
16
|
+
configurationErrors.push('The config setting `config.ytAuthCluster` is no longer supported, please replace it with `config.allowPasswordAuth` or use ALLOW_PASSWORD_AUTH environment variable');
|
17
|
+
}
|
18
|
+
return configurationErrors.length > 0 ? checkConfigurationMiddleware([].concat(configurationErrors)) : undefined;
|
19
|
+
}
|
20
|
+
// #sourceMappingURL=check-configuration.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["checkConfigurationMiddleware","errors","checkConfiguration","_req","res","setHeader","body","concat","map","i","join","status","end","createConfigurationErrorsMidleware","config","configurationErrors","process","env","YT_AUTH_CLUSTER_ID","push","length","undefined"],"sources":["check-configuration.ts"],"sourcesContent":["import type {Request, Response} from 'express';\nimport {AppMiddleware} from '@gravity-ui/expresskit';\nimport {AppConfig} from '@gravity-ui/nodekit';\n\nfunction checkConfigurationMiddleware(errors: Array<string>): AppMiddleware {\n return function checkConfiguration(_req: Request, res: Response) {\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n const body = `Please fix the problems below:<br>\n <ol>\n ${errors.map((i) => `<li>${i}</li>`).join('\\n')}\n </ol>\n Please refer to the <a target='_blank' href='https://github.com/ytsaurus/ytsaurus-ui/tree/main/packages/ui#migration'>migration notices<a/> for more details.\n `;\n res.status(500).end(body);\n };\n}\n\nexport function createConfigurationErrorsMidleware(config: AppConfig) {\n const configurationErrors: Array<string> = [];\n if (process.env.YT_AUTH_CLUSTER_ID) {\n configurationErrors.push(\n 'The YT_AUTH_CLUSTER_ID environment variable is no longer supported, please replace it with ALLOW_PASSWORD_AUTH',\n );\n }\n\n if ('ytAuthCluster' in config) {\n configurationErrors.push(\n 'The config setting `config.ytAuthCluster` is no longer supported, please replace it with `config.allowPasswordAuth` or use ALLOW_PASSWORD_AUTH environment variable',\n );\n }\n\n return configurationErrors.length > 0\n ? checkConfigurationMiddleware([...configurationErrors])\n : undefined;\n}\n"],"mappings":"AAIA,SAASA,4BAA4BA,CAACC,MAAqB,EAAiB;EACxE,OAAO,SAASC,kBAAkBA,CAACC,IAAa,EAAEC,GAAa,EAAE;IAC7DA,GAAG,CAACC,SAAS,CAAC,cAAc,EAAE,0BAA0B,CAAC;IACzD,IAAMC,IAAI,4EAAAC,MAAA,CAEAN,MAAM,CAACO,GAAG,CAAC,UAACC,CAAC;MAAA,cAAAF,MAAA,CAAYE,CAAC;IAAA,CAAO,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,6MAGtD;IACDN,GAAG,CAACO,MAAM,CAAC,GAAG,CAAC,CAACC,GAAG,CAACN,IAAI,CAAC;EAC7B,CAAC;AACL;AAEA,OAAO,SAASO,kCAAkCA,CAACC,MAAiB,EAAE;EAClE,IAAMC,mBAAkC,GAAG,EAAE;EAC7C,IAAIC,OAAO,CAACC,GAAG,CAACC,kBAAkB,EAAE;IAChCH,mBAAmB,CAACI,IAAI,CACpB,gHACJ,CAAC;EACL;EAEA,IAAI,eAAe,IAAIL,MAAM,EAAE;IAC3BC,mBAAmB,CAACI,IAAI,CACpB,qKACJ,CAAC;EACL;EAEA,OAAOJ,mBAAmB,CAACK,MAAM,GAAG,CAAC,GAC/BpB,4BAA4B,IAAAO,MAAA,CAAKQ,mBAAmB,CAAC,CAAC,GACtDM,SAAS;AACnB"}
|
package/dist/server/index.js
CHANGED
@@ -13,6 +13,7 @@ const routes_1 = __importDefault(require("./routes"));
|
|
13
13
|
const oauth_1 = require("./middlewares/oauth");
|
14
14
|
const authorization_1 = require("./middlewares/authorization");
|
15
15
|
const authorization_2 = require("./utils/authorization");
|
16
|
+
const check_configuration_1 = require("./middlewares/check-configuration");
|
16
17
|
const nodekit = new nodekit_1.NodeKit({ configsPath: path_1.default.resolve(__dirname, './configs') });
|
17
18
|
const { appName, appEnv, appInstallation, appDevMode } = nodekit.config;
|
18
19
|
nodekit.ctx.log('AppConfig details', {
|
@@ -37,6 +38,10 @@ if (authMiddlewares.length) {
|
|
37
38
|
nodekit.config.appAuthHandler = (0, authorization_1.createAuthMiddleware)();
|
38
39
|
}
|
39
40
|
(_b = (_a = nodekit.config).adjustAppConfig) === null || _b === void 0 ? void 0 : _b.call(_a, nodekit);
|
41
|
+
const configurationErrors = (0, check_configuration_1.createConfigurationErrorsMidleware)(nodekit.config);
|
42
|
+
if (configurationErrors) {
|
43
|
+
nodekit.config.appBeforeAuthMiddleware = [configurationErrors];
|
44
|
+
}
|
40
45
|
const app = new expresskit_1.ExpressKit(nodekit, routes_1.default);
|
41
46
|
(0, configure_app_1.configureApp)(app);
|
42
47
|
if (require.main === module) {
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createConfigurationErrorsMidleware = void 0;
|
4
|
+
function checkConfigurationMiddleware(errors) {
|
5
|
+
return function checkConfiguration(_req, res) {
|
6
|
+
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
7
|
+
const body = `Please fix the problems below:<br>
|
8
|
+
<ol>
|
9
|
+
${errors.map((i) => `<li>${i}</li>`).join('\n')}
|
10
|
+
</ol>
|
11
|
+
Please refer to the <a target='_blank' href='https://github.com/ytsaurus/ytsaurus-ui/tree/main/packages/ui#migration'>migration notices<a/> for more details.
|
12
|
+
`;
|
13
|
+
res.status(500).end(body);
|
14
|
+
};
|
15
|
+
}
|
16
|
+
function createConfigurationErrorsMidleware(config) {
|
17
|
+
const configurationErrors = [];
|
18
|
+
if (process.env.YT_AUTH_CLUSTER_ID) {
|
19
|
+
configurationErrors.push('The YT_AUTH_CLUSTER_ID environment variable is no longer supported, please replace it with ALLOW_PASSWORD_AUTH');
|
20
|
+
}
|
21
|
+
if ('ytAuthCluster' in config) {
|
22
|
+
configurationErrors.push('The config setting `config.ytAuthCluster` is no longer supported, please replace it with `config.allowPasswordAuth` or use ALLOW_PASSWORD_AUTH environment variable');
|
23
|
+
}
|
24
|
+
return configurationErrors.length > 0
|
25
|
+
? checkConfigurationMiddleware([...configurationErrors])
|
26
|
+
: undefined;
|
27
|
+
}
|
28
|
+
exports.createConfigurationErrorsMidleware = createConfigurationErrorsMidleware;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ytsaurus/ui",
|
3
|
-
"version": "1.22.
|
3
|
+
"version": "1.22.1",
|
4
4
|
"repository": {
|
5
5
|
"type": "github",
|
6
6
|
"url": "https://github.com/YTsaurus/ytsaurus-ui/tree/main/packages/ui"
|
@@ -186,7 +186,7 @@
|
|
186
186
|
"engines": {
|
187
187
|
"node": ">=18"
|
188
188
|
},
|
189
|
-
"gitHead": "
|
189
|
+
"gitHead": "0b406a4e7f0d5f7def958b64b92c278b6afa57eb",
|
190
190
|
"overrides": {
|
191
191
|
"react-split-pane": {
|
192
192
|
"react": "$react",
|