HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //opt/alt/alt-nodejs22/root/lib/node_modules/npm/node_modules/@npmcli/redact/lib/matchers.js
const TYPE_REGEX = 'regex'
const TYPE_URL = 'url'
const TYPE_PATH = 'path'

const NPM_SECRET = {
  type: TYPE_REGEX,
  pattern: /\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi,
  replacement: `[REDACTED_NPM_SECRET]`,
}

const AUTH_HEADER = {
  type: TYPE_REGEX,
  pattern: /\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi,
  replacement: `[REDACTED_AUTH_HEADER]`,
}

const JSON_WEB_TOKEN = {
  type: TYPE_REGEX,
  pattern: /\b[A-Za-z0-9-_]{10,}(?!\.\d+\.)\.[A-Za-z0-9-_]{3,}\.[A-Za-z0-9-_]{20,}\b/gi,
  replacement: `[REDACTED_JSON_WEB_TOKEN]`,
}

const UUID = {
  type: TYPE_REGEX,
  pattern: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,
  replacement: `[REDACTED_UUID]`,
}

const URL_MATCHER = {
  type: TYPE_REGEX,
  pattern: /(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi,
  replacement: '[REDACTED_URL]',
}

const DEEP_HEADER_AUTHORIZATION = {
  type: TYPE_PATH,
  predicate: ({ path }) => path.endsWith('.headers.authorization'),
  replacement: '[REDACTED_HEADER_AUTHORIZATION]',
}

const DEEP_HEADER_SET_COOKIE = {
  type: TYPE_PATH,
  predicate: ({ path }) => path.endsWith('.headers.set-cookie'),
  replacement: '[REDACTED_HEADER_SET_COOKIE]',
}

const DEEP_HEADER_COOKIE = {
  type: TYPE_PATH,
  predicate: ({ path }) => path.endsWith('.headers.cookie'),
  replacement: '[REDACTED_HEADER_COOKIE]',
}

const REWRITE_REQUEST = {
  type: TYPE_PATH,
  predicate: ({ path }) => path.endsWith('.request'),
  replacement: (input) => ({
    method: input?.method,
    path: input?.path,
    headers: input?.headers,
    url: input?.url,
  }),
}

const REWRITE_RESPONSE = {
  type: TYPE_PATH,
  predicate: ({ path }) => path.endsWith('.response'),
  replacement: (input) => ({
    data: input?.data,
    status: input?.status,
    headers: input?.headers,
  }),
}

module.exports = {
  TYPE_REGEX,
  TYPE_URL,
  TYPE_PATH,
  NPM_SECRET,
  AUTH_HEADER,
  JSON_WEB_TOKEN,
  UUID,
  URL_MATCHER,
  DEEP_HEADER_AUTHORIZATION,
  DEEP_HEADER_SET_COOKIE,
  DEEP_HEADER_COOKIE,
  REWRITE_REQUEST,
  REWRITE_RESPONSE,
}