export const NDC_SECRET_CAPABILITY_SOURCE =
  String.raw`ndc_(?:edp(?:wb|rb|pr)|fndbg)_[A-Za-z0-9_-]+`;

export const SECRET_LIKE_KEY =
  /(token|secret|password|authorization|access[_-]?token|refresh[_-]?token|api[_-]?key)/i;

export const SECRET_LIKE_MATERIAL_KEY =
  /(token|secret|password|authorization|access[_-]?token|refresh[_-]?token|api[_-]?key|material|value)/i;

export const SECRET_LIKE_REFERENCE =
  /(?:[?&](?:token|secret|password|authorization|access[_-]?token|refresh[_-]?token|api[_-]?key)=|(?:bearer|basic)\s+)/i;

export const SECRET_LIKE_VALUE = new RegExp(
  `(?:${NDC_SECRET_CAPABILITY_SOURCE}|[?&](?:token|secret|password|authorization|access[_-]?token|refresh[_-]?token|api[_-]?key)=|(?:bearer|basic)\\s+\\S+|eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+)`,
  "i",
);
