fix(security): add nosec for bandit B324 md5 in feature flag
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 17s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m4s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m13s

This commit is contained in:
2026-07-13 00:49:50 +08:00
parent e02a7475bc
commit 2cdaa24735
@@ -84,7 +84,7 @@ class FeatureFlagConfig:
# 基于 identifier 做哈希取模,确保同一用户始终落在同一侧
if identifier:
hash_val = int(hashlib.md5(f"{self.name}:{identifier}".encode("utf-8")).hexdigest(), 16)
hash_val = int(hashlib.md5(f"{self.name}:{identifier}".encode("utf-8")).hexdigest(), 16) # nosec B324 - 用于哈希取模做百分比切流,非安全用途
return (hash_val % 100) < self.percentage
# 无 identifier 且百分比在 0-100 之间 → 按比例随机(不保证一致性)