standardJsonMaskField static method

bool standardJsonMaskField(
  1. String key, {
  2. Iterable<String>? extraKeys,
})

A standard implementation of mask filed.

  • extraKeys is the extra keys to mask.

Implementation

static bool standardJsonMaskField(String key, {Iterable<String>? extraKeys}) {
  key = key.trim().toLowerCase();
  return key == 'password' ||
      key == 'pass' ||
      key == 'passwordhash' ||
      key == 'passhash' ||
      key == 'passphrase' ||
      key == 'ping' ||
      key == 'secret' ||
      key == 'privatekey' ||
      key == 'pkey' ||
      (extraKeys != null && extraKeys.contains(key));
}