تخطَّ إلى المحتوى

Hardcoded Secret (ARCH9110)

هذا المحتوى غير متوفر بلغتك بعد.

Key swift.security.hardcoded-secret · Severity error · Category security · CWE CWE-798

Flags string literals assigned to secret-looking names (password, apiKey, token, secret, privateKey).

let apiKey = "sk_live_4f9a1b2c3d4e5f6a7b8c"
let apiKey = try Keychain.read("payment.apiKey")

Read secrets from the Keychain or the environment; never from source.