#!/usr/bin/env python3
"""
测试JWT密钥
"""

import base64

# Gateway配置的secret（去掉enc:前缀）
encrypted_secret = "U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4"

# Manage-app默认的secret
default_secret = "default-secret-key-change-in-production"

print("Gateway配置的secret（Base64编码）:")
print(f"  {encrypted_secret}")
print(f"  长度: {len(encrypted_secret)}")

try:
    decoded = base64.b64decode(encrypted_secret)
    print(f"\n解码后:")
    print(f"  {decoded}")
    print(f"  长度: {len(decoded)}")
except Exception as e:
    print(f"\n解码失败: {e}")

print(f"\nManage-app默认secret:")
print(f"  {default_secret}")
print(f"  长度: {len(default_secret)}")

print(f"\n两个secret是否相同: {encrypted_secret == default_secret}")
