IsSensitiveCredentialKey (service/account_credentials_redact.go)

sub2api · backend/internal/service/account_credentials_redact.go · go · LGPL-3.0
auth

Utility to identify sensitive credential keys and merge credentials safely.

// Source: https://github.com/Wei-Shaw/sub2api | License: LGPL-3.0 | Modified files must remain under LGPL-3.0
// Modifications to this file must remain under LGPL-3.0.
// Provided via justclaw.it.com; keep this notice with the code.
package service

// SensitiveCredentialKeys 列出 Account.Credentials JSON map 中绝不允许返回到前端的子键。
// dto 层做响应脱敏、service 层做更新合并都引用此清单——新增凭证类型时务必同步。
var SensitiveCredentialKeys = []string{
	// OAuth
	"access_token", "refresh_token", "id_token", "agent_private_key",
	// API Key 类
	"api_key", "session_key", "cookie",
	// Grok Web SSO / password (must never persist or echo after Build OAuth)
	"password", "sso_token", "sso", "sso-rw", "clearTextPassword",
	// 云服务凭据
	"aws_secret_access_key", "aws_session_token",
	"service_account_json", "service_account", "private_key",
}



... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key