replace the secret field from obfuscated to full-masked value (#24800)
Co-authored-by: charles liu <dearcharles.liu@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,10 @@ def obfuscated_token(token: str) -> str:
|
|||||||
return token[:6] + "*" * 12 + token[-2:]
|
return token[:6] + "*" * 12 + token[-2:]
|
||||||
|
|
||||||
|
|
||||||
|
def full_mask_token(token_length=20):
|
||||||
|
return "*" * token_length
|
||||||
|
|
||||||
|
|
||||||
def encrypt_token(tenant_id: str, token: str):
|
def encrypt_token(tenant_id: str, token: str):
|
||||||
from models.account import Tenant
|
from models.account import Tenant
|
||||||
from models.engine import db
|
from models.engine import db
|
||||||
|
@@ -17,7 +17,7 @@ class EnvironmentVariableField(fields.Raw):
|
|||||||
return {
|
return {
|
||||||
"id": value.id,
|
"id": value.id,
|
||||||
"name": value.name,
|
"name": value.name,
|
||||||
"value": encrypter.obfuscated_token(value.value),
|
"value": encrypter.full_mask_token(),
|
||||||
"value_type": value.value_type.value,
|
"value_type": value.value_type.value,
|
||||||
"description": value.description,
|
"description": value.description,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user