Skip to content

Commit

Permalink
sprintfix: 国密变量统一
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Aug 21, 2023
1 parent 53a361f commit 8d03634
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
strategy:
fail-fast: false
matrix:
BKAPP_CRYPTO_TYPE:
BKPAAS_BK_CRYPTO_TYPE:
- "CLASSIC"
- "SHANGMI"
PYTHON_VERSION:
- "3.6"
name: "[CodeCov][${{ matrix.BKAPP_CRYPTO_TYPE }}] with Python ${{ matrix.PYTHON_VERSION }}"
name: "[CodeCov][${{ matrix.BKPAAS_BK_CRYPTO_TYPE }}] with Python ${{ matrix.PYTHON_VERSION }}"
env:
DJANGO_SETTINGS_MODULE: "settings"
DEBUG: true
Expand Down
4 changes: 2 additions & 2 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
BKAPP_ENABLE_DHCP = env.BKAPP_ENABLE_DHCP
BK_BACKEND_CONFIG = env.BK_BACKEND_CONFIG
BKPAAS_MAJOR_VERSION = env.BKPAAS_MAJOR_VERSION
BKAPP_CRYPTO_TYPE = env.BKAPP_CRYPTO_TYPE
BKPAAS_BK_CRYPTO_TYPE = env.BKPAAS_BK_CRYPTO_TYPE


# ===============================================================================
Expand Down Expand Up @@ -393,7 +393,7 @@
}

# 加密
if BKAPP_CRYPTO_TYPE == env.constants.BkCryptoType.SHANGMI.value:
if BKPAAS_BK_CRYPTO_TYPE == env.constants.BkCryptoType.SHANGMI.value:
BKCRYPTO.update(
{
"ASYMMETRIC_CIPHER_TYPE": bkcrypto_constants.AsymmetricCipherType.SM2.value,
Expand Down
6 changes: 4 additions & 2 deletions env/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"BKAPP_ENABLE_DHCP",
"BKAPP_IS_PAAS_DEPLOY",
"BK_BACKEND_CONFIG",
"BKAPP_CRYPTO_TYPE",
"BKPAAS_BK_CRYPTO_TYPE",
"LOG_TYPE",
"LOG_LEVEL",
"BK_LOG_DIR",
Expand Down Expand Up @@ -62,7 +62,9 @@
# 是否为后台配置
BK_BACKEND_CONFIG = BK_BACKEND_CONFIG
# 加密类型,默认值为 `CLASSIC`,可选项:`CLASSIC-国际密码算法`, `SHANGMI-国际商用算法`
BKAPP_CRYPTO_TYPE = get_type_env(key="BKAPP_CRYPTO_TYPE", default=constants.BkCryptoType.CLASSIC.value, _type=str)
BKPAAS_BK_CRYPTO_TYPE = get_type_env(
key="BKPAAS_BK_CRYPTO_TYPE", default=constants.BkCryptoType.CLASSIC.value, _type=str
)

# ===============================================================================
# 日志
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,4 @@ data:
BKAPP_NAV_OPEN_SOURCE_URL: "{{ .Values.config.bkAppNavOpenSourceUrl }}"
BKAPP_NAV_HELPER_URL: "{{ .Values.config.bkAppNavHelperUrl }}"
BKPAAS_BK_DOMAIN: "{{ .Values.global.bkDomain }}"
BKAPP_CRYPTO_TYPE: "{{ .Values.global.bkCryptoType | default "CLASSIC" }}"

BKPAAS_BK_CRYPTO_TYPE: "{{ .Values.global.bkCryptoType | default "CLASSIC" }}"
2 changes: 1 addition & 1 deletion support-files/templates/nodeman#bin#environ.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export BKAPP_BACKEND_HOST="__BK_NODEMAN_PUBLIC_DOWNLOAD_URL__"
export BKAPP_PUBLIC_PATH="__BK_NODEMAN_PUBLIC_PATH__"
export BK_FILE_PATH="__BK_HOME__/bknodeman/cert/saas_priv.txt"
export BK_NODEMAN_API_ADDR="__BK_NODEMAN_API_ADDR__"
export BKAPP_CRYPTO_TYPE="__BK_CRYPTO_TYPE__"
export BKPAAS_BK_CRYPTO_TYPE="__BK_CRYPTO_TYPE__"

# CMDB
# 资源池业务ID
Expand Down

0 comments on commit 8d03634

Please sign in to comment.