Sensitive class final
Marks a declaration as holding a secret that must never reach a log, a console, a string interpolation or an exception message.
The sensitive_exposure rule reports a reference to an annotated field,
getter, parameter, local variable or top-level variable when it is built
into a string, converted with toString(), passed to a logging sink such
as print, or put into an exception message.
class Session {
@Sensitive()
final String token;
// Reported: the token would end up in the log.
void debug() => print('token: $token');
}
Redact the value explicitly instead, for example by logging only its length or a masked prefix.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited