OxL Справочник OxL
РусскийEnglish

error secret-leak

error Стандарт: [§13.3]

Результат secret.reveal() попадает в лог, строку или ответ.

What it means#

A secret<T> is hidden from logs and traces and printed as ***; reveal() is the only way to read it (§13.3). The analyzer follows the revealed value and reports when it reaches a log call, string interpolation or a response, where it would defeat that protection.

Example#

oxl✓ проверяется в CI
fn login(token: secret<str>) io {
  print("token is {token.reveal()}")      // <- secret-leak
}
error
secret-leak

How to fix#

oxl✓ проверяется в CI
fn login(token: secret<str>) io {
  print("token is {token}")
}

Pass the secret itself (it prints as ***) and call reveal() only at the point where the plain value is needed, such as a cryptographic function.

See also#

OxL 1.0.0-beta · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства