redac---n 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +323 -2
  3. package/THIRD_PARTY_NOTICES.md +59 -0
  4. package/dist/aho.d.ts +25 -0
  5. package/dist/aho.js +116 -0
  6. package/dist/base64.d.ts +10 -0
  7. package/dist/base64.js +29 -0
  8. package/dist/bip39-data.d.ts +2 -0
  9. package/dist/bip39-data.js +2 -0
  10. package/dist/cache.d.ts +14 -0
  11. package/dist/cache.js +40 -0
  12. package/dist/calls.d.ts +64 -0
  13. package/dist/calls.js +269 -0
  14. package/dist/charlm-data.d.ts +2 -0
  15. package/dist/charlm-data.js +3 -0
  16. package/dist/charlm.d.ts +7 -0
  17. package/dist/charlm.js +65 -0
  18. package/dist/checksums.d.ts +10 -0
  19. package/dist/checksums.js +98 -0
  20. package/dist/commands.d.ts +72 -0
  21. package/dist/commands.js +787 -0
  22. package/dist/context.d.ts +98 -0
  23. package/dist/context.js +469 -0
  24. package/dist/encoded.d.ts +11 -0
  25. package/dist/encoded.js +336 -0
  26. package/dist/environment.d.ts +10 -0
  27. package/dist/environment.js +62 -0
  28. package/dist/formats-data.d.ts +2 -0
  29. package/dist/formats-data.js +405 -0
  30. package/dist/formats.d.ts +5 -0
  31. package/dist/formats.js +470 -0
  32. package/dist/hmac.d.ts +3 -0
  33. package/dist/hmac.js +87 -0
  34. package/dist/index.d.ts +101 -0
  35. package/dist/index.js +488 -0
  36. package/dist/json.d.ts +82 -0
  37. package/dist/json.js +392 -0
  38. package/dist/known.d.ts +34 -0
  39. package/dist/known.js +340 -0
  40. package/dist/lines.d.ts +28 -0
  41. package/dist/lines.js +69 -0
  42. package/dist/lookup.d.ts +5 -0
  43. package/dist/lookup.js +7 -0
  44. package/dist/model-data.d.ts +3 -0
  45. package/dist/model-data.js +4 -0
  46. package/dist/model.d.ts +2 -0
  47. package/dist/model.js +19 -0
  48. package/dist/named.d.ts +20 -0
  49. package/dist/named.js +3257 -0
  50. package/dist/names.d.ts +106 -0
  51. package/dist/names.js +1517 -0
  52. package/dist/normalize.d.ts +25 -0
  53. package/dist/normalize.js +529 -0
  54. package/dist/pem.d.ts +32 -0
  55. package/dist/pem.js +269 -0
  56. package/dist/policy.d.ts +3 -0
  57. package/dist/policy.js +470 -0
  58. package/dist/public.d.ts +44 -0
  59. package/dist/public.js +362 -0
  60. package/dist/publickeys.d.ts +41 -0
  61. package/dist/publickeys.js +232 -0
  62. package/dist/random.d.ts +29 -0
  63. package/dist/random.js +165 -0
  64. package/dist/repeats.d.ts +21 -0
  65. package/dist/repeats.js +80 -0
  66. package/dist/rules.d.ts +42 -0
  67. package/dist/rules.js +58 -0
  68. package/dist/runs.d.ts +10 -0
  69. package/dist/runs.js +36 -0
  70. package/dist/secretfile.d.ts +52 -0
  71. package/dist/secretfile.js +722 -0
  72. package/dist/shell.d.ts +127 -0
  73. package/dist/shell.js +703 -0
  74. package/dist/spans.d.ts +61 -0
  75. package/dist/spans.js +287 -0
  76. package/dist/sql.d.ts +20 -0
  77. package/dist/sql.js +66 -0
  78. package/dist/stream.d.ts +46 -0
  79. package/dist/stream.js +150 -0
  80. package/dist/structure.d.ts +24 -0
  81. package/dist/structure.js +1625 -0
  82. package/dist/syntax.d.ts +156 -0
  83. package/dist/syntax.js +446 -0
  84. package/dist/transcript.d.ts +30 -0
  85. package/dist/transcript.js +713 -0
  86. package/dist/types.d.ts +81 -0
  87. package/dist/types.js +1 -0
  88. package/dist/unnamed.d.ts +59 -0
  89. package/dist/unnamed.js +939 -0
  90. package/dist/urls.d.ts +70 -0
  91. package/dist/urls.js +303 -0
  92. package/dist/values.d.ts +178 -0
  93. package/dist/values.js +1621 -0
  94. package/dist/yaml.d.ts +40 -0
  95. package/dist/yaml.js +174 -0
  96. package/docs/creddata.svg +318 -0
  97. package/docs/guessing.md +139 -0
  98. package/docs/holdout.svg +85 -0
  99. package/docs/layers.md +80 -0
  100. package/docs/models.svg +81 -0
  101. package/docs/real-text.svg +112 -0
  102. package/package.json +57 -5
@@ -0,0 +1,106 @@
1
+ /** Every spelling of "password" (PASSWORD_LANGUAGES), and those of languages other than English. */
2
+ export declare const PASSWORD_SPELLINGS: string[];
3
+ export declare const FOREIGN_PASSWORD_SPELLINGS: string[];
4
+ /** The words of a name in upper case: `clientSecret` → CLIENT, SECRET; `x-api-key` → X, API, KEY. */
5
+ export declare function words(name: string): string[];
6
+ /**
7
+ * Whether a name names a session or its ID, whoever's session it is: `INSTAGRAM_SESSION_ID`, `LINKEDIN_SESSION`,
8
+ * `tiktokSessionId`; not a terminal's or a desktop's (LOCAL_SESSION_OWNERS). Read so only in a secret file, which says
9
+ * its values are secrets: elsewhere a session's ID under another's name is as often a checkout's or an agent's
10
+ * (`CHECKOUT_SESSION_ID`, `CLAUDE_SESSION_ID`), and only the names isSessionIdName knows are credentials.
11
+ */
12
+ export declare function namesSession(name: string): boolean;
13
+ /**
14
+ * Whether a name's value may be a login, `user:password` or `user/password` (spans.ts loginPassword): by a word of
15
+ * LOGIN_WORDS, or Bundler's name for a host.
16
+ */
17
+ export declare function namesLogin(name: string): boolean;
18
+ /** File names' extensions, so a file name that holds a credential word (`has_key_spec.rb`) isn't one; never a qualifier (`.prod`, `.old`, `.value`, `.test`). */
19
+ export declare const FILE_EXTENSION: RegExp;
20
+ export declare const VENDOR_CLIENTS: Set<string>;
21
+ /** Whether a name's value is a password: its last word names one (`DB_PASSWORD`, `adminpasswd`, `DB_WACHTWOORD`, `REDISPASS`, `mot_de_passe`). */
22
+ export declare function isPasswordName(name: string): boolean;
23
+ /**
24
+ * Whether a name's value may be an ordinary word and still be its secret: a password's, a PIN's, a pre-shared key's
25
+ * or a seed phrase's (`DB_PASSWORD=sunshine`, `pin: 4821`, `mnemonic: …`).
26
+ */
27
+ export declare function takesAnyWord(name: string): boolean;
28
+ /** Whether a name says its value is a password or a PIN, by any of its words (`DB_PASSWORD_HINT`, `PGPASSWORD`, `admin-pin`, `door_code`). */
29
+ export declare function namesPasswordOrPin(name: string): boolean;
30
+ /** A vendor's name alone, which holds that vendor's key: `deepgram`, `NGROK` (VENDORS). */
31
+ export declare function isVendorName(name: string): boolean;
32
+ /** A vendor's SDK or client by its name: `algoliasearch`, `Mailgun`, `TWILIO`, `twilio.Client` (a vendor's name, then a client word or nothing; not `imgurian`). */
33
+ export declare function isVendorClient(name: string): boolean;
34
+ /**
35
+ * A credential's word somewhere in a name, as a regex source for the readers' cheap prefilters (named.ts `NAME`,
36
+ * setter calls): every word CREDENTIAL_WORDS and CREDENTIAL_SUFFIX know, in lower case, so a word added there reaches
37
+ * them all; `sess` and `private` for `session_id` and `vapidPrivate`; and "password" as other languages spell it in a
38
+ * name, accents and all (`db_jelszó`, `DB_HASŁO`, `contraseña`), which CREDENTIAL_WORDS holds folded. A prefilter only:
39
+ * whether `pin` in `pinValue` or `spinner` is a credential's word is isCredentialName's (the readers' `i` flag leaves
40
+ * no way to tell a camel-case hump from a lower-case letter here).
41
+ */
42
+ export declare const CREDENTIAL_WORD: string;
43
+ /**
44
+ * A PIN's name: `PIN` among its words (`pin`, `door_pin`, `PIN_CODE`, `pinCode`, `pin_input`, `user_pin_value`; not a
45
+ * GPIO's or a certificate's pin, a setting about PINs, `PIN_TIMEOUT_MS`, `Pin-Priority`, nor a key or a secret a PIN
46
+ * qualifies, `PIN_ENCRYPTION_KEY`, whose own word decides), `PINCODE`, `PASSCODE` (not `PASSCODE_API_KEY`), or a code
47
+ * named for what it opens (`alarm_code`). namesPasswordOrPin, the name readers and the prose readers all ask this one.
48
+ */
49
+ export declare function isPinName(name: string): boolean;
50
+ export type NameClass = "credential" | "hash" | "identifier" | "neutral" | "public";
51
+ /** What a name says, read once: its words, the meaningful ones, its last meaningful word (singular, undigited) and its class. */
52
+ export interface Name {
53
+ words: string[];
54
+ /** The words without the qualifiers and encodings after the meaningful one: `DB_PASSWORD_PROD_B64` → DB, PASSWORD. */
55
+ core: string[];
56
+ /** The last core word, singular and without a version: `API_KEYS2` → KEY. */
57
+ last: string;
58
+ class: NameClass;
59
+ }
60
+ /**
61
+ * What a name says about its value:
62
+ * - credential: `api_key`, `X-Auth-Token`, `password`
63
+ * - hash: `sha256`, `commit`, `etag`, `integrity`, `nonce`, `cursor` (random but not secret)
64
+ * - identifier: `user_id`, `bucket`, `url`, `sort_key`
65
+ * - public: `public_key`, `NEXT_PUBLIC_*`, `publishable_key`
66
+ * - neutral: anything else (`data`, `value`, `X-Lumen`)
67
+ */
68
+ export declare function readName(name: string): Name;
69
+ /**
70
+ * A name a setting has, by its last word: `HOSTNAME`, `TZ`, `APP_URL`, `TENANT_ID`, `SMTP_LOGIN`, `SSH_AUTH_SOCK`,
71
+ * `TOKEN_ENDPOINT`, `PASSWORD_POLICY`. (Glued to a setting's word or an owner's, `HOSTNAME`, `DBHOST`; not `PAID`,
72
+ * `MY_TOKEN_VALID`, whose last word merely ends like one.) Where the context says every value is a secret (a secret
73
+ * file, the caller's environment), this is what says one isn't.
74
+ */
75
+ export declare function isSettingName(name: string): boolean;
76
+ /** Whether a name's value is a credential. */
77
+ export declare function isCredentialName(name: string): boolean;
78
+ export declare function nameClass(name: string): NameClass;
79
+ export declare const isGenericName: (name: string) => boolean;
80
+ /** Words that make a bare `key`/`token` after them a credential's (`api key`, `client secret`), with QUALIFIER_WORDS (`old key`) and vendors' names (`stripe key`); as an alternation, for the sentences that name a credential (named.ts). */
81
+ export declare const CREDENTIAL_QUALIFIERS = "api|secret|access|private|auth|client|signing|encryption|master|app|license|licence|admin|root|bearer|session|refresh|service|deploy|personal|bot|webhook|account|user|integration|partner|consumer|shared|write|read|ingest|dev|prod|live|test|github|gitlab|aws|gcp|azure";
82
+ /** Words that end a name's phrase in prose: determiners, pronouns, verbs and prepositions (`Here is the token`). */
83
+ export declare const PHRASE_STOP: RegExp;
84
+ /**
85
+ * The words just before a name, up to `max` (`next page` in `next page token:`), for readPhrase: none that are a pair's
86
+ * value (`msg=hello token=…`, `id=web-portal secret=…` in a log line) or follow a quote, nor a word that continues a
87
+ * token (`portal` in `web-portal`).
88
+ */
89
+ export declare function phraseBefore(text: string, max: number): string[];
90
+ /**
91
+ * A bare generic name (`key`, `token`, `secret`, `id`, `hash`) read with the prose words before it: `public key`,
92
+ * `next page token`, `old key`, `the search-only key`. The phrase starts after the last determiner, verb or
93
+ * preposition ("Here is the token" names a token); one that reads as another name (two words, then one) gives its
94
+ * class, and a credential word after a word that qualifies no credential (`cache warm key`) is a neutral one.
95
+ */
96
+ export declare function readPhrase(before: string[], name: string): {
97
+ name: string;
98
+ class: NameClass;
99
+ };
100
+ /**
101
+ * Whether the name is a credential's, or a neutral name has a credential word that the word before doesn't rule out
102
+ * (`auth_header`, `api_key_header`; not `cache.key.prefix`, nor a file's name, `has_key.rb`).
103
+ */
104
+ export declare function mentionsCredential(name: string): boolean;
105
+ /** Whether any word of a name is a credential word that the word before doesn't rule out (`BASIC_AUTH`; not `CACHE_KEY`), whatever the name's class. */
106
+ export declare function hasCredentialWord(name: string): boolean;