@next-core/brick-container 2.98.4 → 2.98.6

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/dist/preview.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="zh-CN" data-theme="light" data-mode="default"><head><meta charset="utf-8"/><base href="<!--# echo var='base_href' default='/' -->"/><script>window.DEVELOPER_PREVIEW = true;</script><link href="preview.5fb551513edc8051ce6c.css" rel="stylesheet"></head><body><div id="preview-root"><div id="main-mount-point"></div><div id="bg-mount-point" style="display: none"></div><div id="portal-mount-point"></div></div><script src="dll.3ea99c34.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.72e368a83355f2b8e640.js"></script></body></html>
1
+ <!doctype html><html lang="zh-CN" data-theme="light" data-mode="default"><head><meta charset="utf-8"/><base href="<!--# echo var='base_href' default='/' -->"/><script>window.DEVELOPER_PREVIEW = true;</script><link href="preview.5fb551513edc8051ce6c.css" rel="stylesheet"></head><body><div id="preview-root"><div id="main-mount-point"></div><div id="bg-mount-point" style="display: none"></div><div id="portal-mount-point"></div></div><script src="dll.1aba6ab3.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.d633590bef44d91b5fad.js"></script></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/brick-container",
3
- "version": "2.98.4",
3
+ "version": "2.98.6",
4
4
  "description": "Brick Container Server",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/brick-container",
6
6
  "license": "GPL-3.0",
@@ -41,18 +41,18 @@
41
41
  "ws": "^8.11.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@next-core/brick-dll": "^2.50.7",
44
+ "@next-core/brick-dll": "^2.50.8",
45
45
  "@next-core/brick-icons": "^2.34.9",
46
46
  "@next-core/custom-antd-styles": "^1.27.1",
47
47
  "@next-core/illustrations": "^0.11.37",
48
48
  "@next-core/less-plugin-css-variables": "^0.2.8",
49
49
  "@next-core/theme": "^1.5.4",
50
50
  "@next-core/webpack-config-factory": "^2.25.2",
51
- "@next-dll/ace": "^2.0.808",
51
+ "@next-dll/ace": "^2.0.809",
52
52
  "@next-dll/d3": "^2.0.84",
53
53
  "@next-dll/echarts": "^2.0.85",
54
- "@next-dll/editor-bricks-helper": "^0.41.7",
55
- "@next-dll/react-dnd": "^0.1.746",
54
+ "@next-dll/editor-bricks-helper": "^0.41.8",
55
+ "@next-dll/react-dnd": "^0.1.747",
56
56
  "babel-loader": "^8.3.0",
57
57
  "clean-webpack-plugin": "^4.0.0",
58
58
  "copy-webpack-plugin": "^6.4.1",
@@ -73,5 +73,5 @@
73
73
  "webpack-dev-server": "^4.11.1",
74
74
  "webpack-merge": "^5.8.0"
75
75
  },
76
- "gitHead": "6a633f931b24484c6015158c5e59e5d1c357f973"
76
+ "gitHead": "a8efbe1c6306e23b0a4056ec5215eba58e77348a"
77
77
  }
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ TOOLS_DIR = "/usr/local/easyops/deploy_init/tools"
5
+ APP_ID = "brick_next"
6
+
7
+ import sys
8
+ sys.path.append(TOOLS_DIR)
9
+
10
+
11
+ def get_token(user, org):
12
+ """
13
+ 通过 app_id 从配置中获取 client_id 和 secret, 然后调用 get_token_util.get_token
14
+
15
+ 参数: (user: 用户名, org: 组织名)
16
+ 返回: token 或空字符串(当认证功能关闭时)
17
+ 异常: 当认证功能启用但相关工具或配置缺失时抛出异常
18
+ """
19
+
20
+ # 尝试导入 deploy_init config_reader
21
+ try:
22
+ from config_reader import get_config_value
23
+ except ImportError:
24
+ return ""
25
+
26
+ try:
27
+ enable = get_config_value("deploy_init", "common", "check_auth_token.enable")
28
+ if str(enable).lower() != "true":
29
+ return ""
30
+ except KeyError:
31
+ return ""
32
+ except Exception as e:
33
+ raise Exception("get_token: failed to read check_auth_token.enable: %s" % str(e))
34
+
35
+ # 尝试导入 deploy_init get_token_util
36
+ try:
37
+ import get_token_util
38
+ except ImportError:
39
+ # 开关打开的情况下,如果没有找到 get_token_util 模块,则抛出异常
40
+ raise Exception("get_token: check_auth_token is enabled, but deploy_init get_token_util module not found!")
41
+
42
+ try:
43
+ client_id = get_config_value(APP_ID, "application", "client_id")
44
+ secret = get_config_value(APP_ID, "application", "secret")
45
+ except KeyError as ke:
46
+ raise Exception("get_token: required key missing in appId [%s]: %s" % (APP_ID, str(ke)))
47
+ except Exception as e:
48
+ raise Exception("get_token: failed to read clientId or secret for appId [%s]: %s" % (APP_ID, str(e)))
49
+
50
+ return get_token_util.get_token(user, org, client_id, secret)
51
+
52
+
53
+ if __name__ == '__main__':
54
+ if len(sys.argv) != 3:
55
+ sys.stderr.write("Usage: python custom_get_token_util.py <user> <org>\n")
56
+ sys.exit(1)
57
+
58
+ user = sys.argv[1]
59
+ org = sys.argv[2]
60
+
61
+ token = get_token(user, org)
62
+ print(token)
63
+
64
+
@@ -1,25 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- import sys
4
- import os
3
+ from custom_get_token_util import get_token
5
4
 
6
- TOOLS_DIR = "/usr/local/easyops/deploy_init/tools"
7
- sys.path.append(TOOLS_DIR)
8
- get_token = None
9
- token_util_path = os.path.join(TOOLS_DIR, "get_token_util.py")
10
- if os.path.exists(token_util_path):
11
- from get_token_util import get_token
12
-
13
- APP_ID = "brick_next"
14
5
  DEFAULT_USER = "defaultUser"
15
6
 
16
7
 
17
8
  def get_headers(org, user=DEFAULT_USER):
18
9
  headers = {"org": str(org), "user": user}
19
- if get_token is None:
20
- return headers
21
-
22
- token = get_token(user=user, org=int(org), app_id=APP_ID)
10
+ token = get_token(user=user, org=int(org))
23
11
  if not token:
24
12
  return headers
25
13