@foam-ai/node 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (64) hide show
  1. package/README.md +649 -0
  2. package/dist/before-send.d.ts +16 -0
  3. package/dist/before-send.js +41 -0
  4. package/dist/constants.d.ts +44 -0
  5. package/dist/constants.js +67 -0
  6. package/dist/endpoint.d.ts +2 -0
  7. package/dist/endpoint.js +11 -0
  8. package/dist/exporters.d.ts +33 -0
  9. package/dist/exporters.js +179 -0
  10. package/dist/index.d.ts +10 -0
  11. package/dist/index.js +28 -0
  12. package/dist/ingest.d.ts +12 -0
  13. package/dist/ingest.js +70 -0
  14. package/dist/init.d.ts +26 -0
  15. package/dist/init.js +169 -0
  16. package/dist/instrumentations.d.ts +4 -0
  17. package/dist/instrumentations.js +120 -0
  18. package/dist/library-versions.d.ts +1 -0
  19. package/dist/library-versions.js +59 -0
  20. package/dist/logs.d.ts +10 -0
  21. package/dist/logs.js +61 -0
  22. package/dist/metrics.d.ts +5 -0
  23. package/dist/metrics.js +29 -0
  24. package/dist/network-capture/collector.d.ts +27 -0
  25. package/dist/network-capture/collector.js +411 -0
  26. package/dist/network-capture/http.d.ts +5 -0
  27. package/dist/network-capture/http.js +221 -0
  28. package/dist/network-capture/index.d.ts +3 -0
  29. package/dist/network-capture/index.js +20 -0
  30. package/dist/network-capture/redact.d.ts +9 -0
  31. package/dist/network-capture/redact.js +401 -0
  32. package/dist/network-capture/support.d.ts +2 -0
  33. package/dist/network-capture/support.js +38 -0
  34. package/dist/network-capture/undici.d.ts +5 -0
  35. package/dist/network-capture/undici.js +177 -0
  36. package/dist/otlp.d.ts +8 -0
  37. package/dist/otlp.js +46 -0
  38. package/dist/propagation.d.ts +5 -0
  39. package/dist/propagation.js +47 -0
  40. package/dist/redaction-keys.d.ts +3 -0
  41. package/dist/redaction-keys.js +421 -0
  42. package/dist/redaction.d.ts +24 -0
  43. package/dist/redaction.js +270 -0
  44. package/dist/report.d.ts +9 -0
  45. package/dist/report.js +56 -0
  46. package/dist/resource.d.ts +3 -0
  47. package/dist/resource.js +24 -0
  48. package/dist/state.d.ts +26 -0
  49. package/dist/state.js +61 -0
  50. package/dist/traces.d.ts +1 -0
  51. package/dist/traces.js +21 -0
  52. package/dist/utils.d.ts +4 -0
  53. package/dist/utils.js +20 -0
  54. package/package.json +47 -19
  55. package/dist/node/src/capture-exception.d.ts +0 -9
  56. package/dist/node/src/capture-exception.js +0 -31
  57. package/dist/node/src/index.d.ts +0 -9
  58. package/dist/node/src/index.js +0 -12
  59. package/dist/node/src/init.d.ts +0 -27
  60. package/dist/node/src/init.js +0 -203
  61. package/dist/shared/constants.d.ts +0 -1
  62. package/dist/shared/constants.js +0 -4
  63. package/dist/shared/util.d.ts +0 -9
  64. package/dist/shared/util.js +0 -21
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.injectTraceContext = injectTraceContext;
4
+ exports.extractTraceContext = extractTraceContext;
5
+ exports.setBaggage = setBaggage;
6
+ exports.getBaggage = getBaggage;
7
+ const node_async_hooks_1 = require("node:async_hooks");
8
+ const api_1 = require("@opentelemetry/api");
9
+ const core_1 = require("@opentelemetry/core");
10
+ const utils_js_1 = require("./utils.js");
11
+ const state_js_1 = require("./state.js");
12
+ // pcga11: Below are some definitios you may find helpful to understand this file.
13
+ // CompositePropagator is a local propagator used on custom transports (Kafka, SQS, Redis, WebSocket)
14
+ // An "injector/extractor" turns the context into headers and vice versa for distributed tracing
15
+ // Carrier is the headers object can be kafka message, queue payload or any other transport headers
16
+ // Context.active() returns the process' context. Think of it like a local RAM for this request in this Node process. Another service, process or even another Kafka in the same service will have a different context.active().
17
+ const propagator = new core_1.CompositePropagator({
18
+ propagators: [new core_1.W3CTraceContextPropagator(), new core_1.W3CBaggagePropagator()],
19
+ });
20
+ const baggageStorage = new node_async_hooks_1.AsyncLocalStorage();
21
+ function contextWithBaggage() {
22
+ const entries = Object.fromEntries(api_1.propagation.getBaggage(api_1.context.active())?.getAllEntries() ?? []);
23
+ for (const [key, value] of baggageStorage.getStore() ?? []) {
24
+ entries[key] = { value };
25
+ }
26
+ const baggage = api_1.propagation.createBaggage(entries);
27
+ return api_1.propagation.setBaggage(api_1.context.active(), baggage);
28
+ }
29
+ function injectTraceContext(carrier) {
30
+ (0, utils_js_1.safely)(() => {
31
+ propagator.inject(contextWithBaggage(), carrier, api_1.defaultTextMapSetter);
32
+ });
33
+ }
34
+ function extractTraceContext(carrier) {
35
+ return (0, utils_js_1.safely)(() => propagator.extract(api_1.context.active(), carrier, api_1.defaultTextMapGetter), api_1.context.active());
36
+ }
37
+ function setBaggage(key, value, callback) {
38
+ if ((0, state_js_1.getSignal)(state_js_1.Signals.baggage) === state_js_1.SignalSources.none)
39
+ return undefined;
40
+ const next = new Map(baggageStorage.getStore() ?? []);
41
+ next.set(key, value);
42
+ return baggageStorage.run(next, callback);
43
+ }
44
+ function getBaggage(key) {
45
+ return (0, utils_js_1.safely)(() => baggageStorage.getStore()?.get(key) ??
46
+ api_1.propagation.getBaggage(api_1.context.active())?.getEntry(key)?.value, undefined);
47
+ }
@@ -0,0 +1,3 @@
1
+ export declare const SENSITIVE_KEYS: readonly ["admin_password", "basic_auth_password", "confirm_password", "connection_password", "current_password", "database_password", "db_pass", "db_password", "ftp_password", "http_password", "keystore_password", "master_password", "mail_password", "mysql_pwd", "new_password", "old_password", "pass", "passcode", "passphrase", "passwd", "password", "password_confirmation", "postgres_password", "pwd", "redis_password", "root_password", "smtp_password", "user_password", "access_token_secret", "activation_token", "access_token", "api_token", "assertion", "auth", "auth_token", "authentication_token", "authorization", "authorization_code", "bearer", "bearer_token", "bot_token", "ci_job_token", "client_assertion", "client_secret", "credential", "credentials", "deploy_token", "email_verification_token", "id_token", "identity_token", "invite_token", "jwt", "jwt_token", "magic_link_token", "oauth_token", "oauth2_token", "oauth_token_secret", "password_reset_token", "personal_access_token", "registration_token", "request_token", "refresh_token", "reset_token", "saml_assertion", "saml_response", "secret_token", "security_token", "service_token", "sso_token", "token", "unsubscribe_token", "verification_token", "access_key", "access_key_id", "api_key", "api_secret", "amqp_url", "apikey", "app_key", "app_secret", "application_key", "application_secret", "aws_access_key_id", "aws_secret_access_key", "consumer_key", "consumer_secret", "broker_url", "connection_string", "connection_uri", "credential_blob", "decryption_key", "database_url", "database_connection_string", "db_url", "dsn", "encryption_key", "gcp_service_account_key", "google_application_credentials", "key", "key_password", "key_store_password", "keystore", "license_key", "mnemonic", "mongodb_uri", "kube_config", "kubeconfig", "pem", "private_key", "privatekey", "proxy_authorization", "redis_url", "redis_uri", "rabbitmq_url", "secret", "secret_access_key", "secret_key", "seed_phrase", "service_account_json", "service_account_key", "shared_secret", "signature", "signing_key", "signing_secret", "ssh_private_key", "smtp_url", "tls_private_key", "wallet_private_key", "wallet_seed", "webhook_secret", "www_authenticate", "_csrf", "_csrf_token", "_session", "_xsrf", "aiohttp_session", "anti_forgery_token", "backup_code", "backup_codes", "connect.sid", "cookie", "csrf", "csrf_token", "csrftoken", "django_session", "hotp", "laravel_session", "mfa", "mfa_code", "otp", "phpsessid", "pin", "recovery_code", "recovery_codes", "remember_token", "session", "session_id", "session_key", "session_token", "sessionid", "set_cookie", "setcookie", "sid", "symfony", "totp", "user_session", "x_csrf_token", "x_csrftoken", "x_xsrf_token", "xsrf", "xsrf_token", "account_number", "bank_account", "card", "card_number", "credit_card", "credit_card_number", "cvc", "cvv", "date_of_birth", "dob", "driver_license", "drivers_license", "iban", "ip_address", "national_id", "passport_number", "remote_addr", "routing_number", "sort_code", "ssn", "tax_id", "x_forwarded_for", "x_real_ip", "algolia_admin_api_key", "anthropic_api_key", "artifactory_api_key", "airtable_api_key", "azure_api_key", "buildkite_agent_token", "circle_token", "cohere_api_key", "cloudflare_api_token", "consul_http_token", "datadog_api_key", "datadog_app_key", "discord_bot_token", "docker_password", "docker_config_json", "digitalocean_token", "firebase_service_account", "gemini_api_key", "github_token", "gitlab_token", "google_api_key", "groq_api_key", "honeycomb_api_key", "huggingface_token", "heroku_api_key", "jfrog_access_token", "linear_api_key", "mapbox_access_token", "new_relic_license_key", "nomad_token", "notion_token", "npm_token", "openai_api_key", "pagerduty_routing_key", "pypi_token", "sentry_auth_token", "sentry_dsn", "sendgrid_api_key", "shopify_access_token", "shopify_api_secret", "slack_app_token", "slack_bot_token", "slack_signing_secret", "stripe_secret_key", "stripe_webhook_secret", "supabase_service_role_key", "telegram_bot_token", "terraform_cloud_token", "twilio_auth_token", "vault_token", "vercel_oidc_token", "x_api_key", "x_auth_token"];
2
+ export declare const SENSITIVE_HTTP_HEADERS: readonly ["authentication_info", "authorization", "cf_access_authenticated_user_email", "cf_access_jwt_assertion", "cookie", "grpcgateway_authorization", "impersonate_group", "impersonate_user", "jenkins_crumb", "job_token", "ocp_apim_subscription_key", "private_token", "proxy_authenticate", "proxy_authentication_info", "proxy_authorization", "set_cookie", "stripe_signature", "www_authenticate", "x_access_token", "x_algolia_api_key", "x_amz_credential", "x_amz_security_token", "x_amz_signature", "x_amzn_oidc_accesstoken", "x_amzn_oidc_data", "x_amzn_oidc_identity", "x_api_key", "x_asana_request_token", "x_aws_ec2_metadata_token", "x_auth_request_access_token", "x_auth_request_email", "x_auth_request_groups", "x_auth_request_preferred_username", "x_auth_request_user", "x_auth_token", "x_box_signature_primary", "x_box_signature_secondary", "x_cf_access_jwt_assertion", "x_csrf_token", "x_circle_token", "x_consul_token", "x_credential_identifier", "x_datadog_api_key", "x_discord_signature_ed25519", "x_docusign_signature_1", "x_dropbox_signature", "x_elastic_client_authentication", "x_firebase_appcheck", "x_forwarded_access_token", "x_forwarded_email", "x_forwarded_for", "x_forwarded_user", "x_functions_key", "x_github_token", "x_gitlab_token", "x_goog_api_key", "x_goog_firebase_installations_auth", "x_goog_iap_jwt_assertion", "x_hub_signature", "x_hub_signature_256", "x_honeycomb_api_key", "x_honeycomb_team", "x_intercom_hmac", "x_jwt_assertion", "x_linear_signature", "x_mailgun_signature", "x_master_key", "x_meili_api_key", "x_ms_client_principal", "x_ms_token_aad_access_token", "x_ms_token_aad_id_token", "x_ms_token_aad_refresh_token", "x_nf_client_connection_ip", "x_nomad_token", "x_npm_token", "x_original_authorization", "x_real_ip", "x_remote_email", "x_remote_groups", "x_remote_user", "x_pagerduty_signature", "x_parse_rest_api_key", "x_sendgrid_event_webhook_signature", "x_session_token", "x_shopify_hmac_sha256", "x_signature", "x_signature_ed25519", "x_slack_signature", "x_sonarqube_passcode", "x_squarespace_hmacsha256_signature", "x_twilio_signature", "x_typesense_api_key", "x_userinfo", "x_vault_token", "x_vercel_oidc_token", "x_webhook_signature", "x_webhook_secret", "x_wix_webhook_signature", "x_xsrf_token", "x_zendesk_webhook_signature"];
3
+ export declare const SENSITIVE_QUERY_KEYS: readonly ["access_token", "api_key", "api_secret", "api_token", "apikey", "assertion", "auth", "auth_token", "authorization", "authorization_code", "bearer_token", "client_assertion", "client_secret", "code", "code_verifier", "credential", "hmac", "id_token", "invite_token", "jwt", "key", "magic_link_token", "oauth_token_secret", "otp", "password_reset_token", "password", "policy", "pin", "refresh_token", "reset_token", "saml_response", "secret", "secret_key", "session", "session_id", "session_token", "sig", "signature", "token", "token_secret", "unsubscribe_token", "verification_token", "x_amz_credential", "x_amz_security_token", "x_amz_signature", "x_goog_credential", "x_goog_signature"];
@@ -0,0 +1,421 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SENSITIVE_QUERY_KEYS = exports.SENSITIVE_HTTP_HEADERS = exports.SENSITIVE_KEYS = void 0;
4
+ const PASSWORD_KEYS = [
5
+ "admin_password",
6
+ "basic_auth_password",
7
+ "confirm_password",
8
+ "connection_password",
9
+ "current_password",
10
+ "database_password",
11
+ "db_pass",
12
+ "db_password",
13
+ "ftp_password",
14
+ "http_password",
15
+ "keystore_password",
16
+ "master_password",
17
+ "mail_password",
18
+ "mysql_pwd",
19
+ "new_password",
20
+ "old_password",
21
+ "pass",
22
+ "passcode",
23
+ "passphrase",
24
+ "passwd",
25
+ "password",
26
+ "password_confirmation",
27
+ "postgres_password",
28
+ "pwd",
29
+ "redis_password",
30
+ "root_password",
31
+ "smtp_password",
32
+ "user_password",
33
+ ];
34
+ const TOKEN_KEYS = [
35
+ "access_token_secret",
36
+ "activation_token",
37
+ "access_token",
38
+ "api_token",
39
+ "assertion",
40
+ "auth",
41
+ "auth_token",
42
+ "authentication_token",
43
+ "authorization",
44
+ "authorization_code",
45
+ "bearer",
46
+ "bearer_token",
47
+ "bot_token",
48
+ "ci_job_token",
49
+ "client_assertion",
50
+ "client_secret",
51
+ "credential",
52
+ "credentials",
53
+ "deploy_token",
54
+ "email_verification_token",
55
+ "id_token",
56
+ "identity_token",
57
+ "invite_token",
58
+ "jwt",
59
+ "jwt_token",
60
+ "magic_link_token",
61
+ "oauth_token",
62
+ "oauth2_token",
63
+ "oauth_token_secret",
64
+ "password_reset_token",
65
+ "personal_access_token",
66
+ "registration_token",
67
+ "request_token",
68
+ "refresh_token",
69
+ "reset_token",
70
+ "saml_assertion",
71
+ "saml_response",
72
+ "secret_token",
73
+ "security_token",
74
+ "service_token",
75
+ "sso_token",
76
+ "token",
77
+ "unsubscribe_token",
78
+ "verification_token",
79
+ ];
80
+ const KEY_MATERIAL_KEYS = [
81
+ "access_key",
82
+ "access_key_id",
83
+ "api_key",
84
+ "api_secret",
85
+ "amqp_url",
86
+ "apikey",
87
+ "app_key",
88
+ "app_secret",
89
+ "application_key",
90
+ "application_secret",
91
+ "aws_access_key_id",
92
+ "aws_secret_access_key",
93
+ "consumer_key",
94
+ "consumer_secret",
95
+ "broker_url",
96
+ "connection_string",
97
+ "connection_uri",
98
+ "credential_blob",
99
+ "decryption_key",
100
+ "database_url",
101
+ "database_connection_string",
102
+ "db_url",
103
+ "dsn",
104
+ "encryption_key",
105
+ "gcp_service_account_key",
106
+ "google_application_credentials",
107
+ "key",
108
+ "key_password",
109
+ "key_store_password",
110
+ "keystore",
111
+ "license_key",
112
+ "mnemonic",
113
+ "mongodb_uri",
114
+ "kube_config",
115
+ "kubeconfig",
116
+ "pem",
117
+ "private_key",
118
+ "privatekey",
119
+ "proxy_authorization",
120
+ "redis_url",
121
+ "redis_uri",
122
+ "rabbitmq_url",
123
+ "secret",
124
+ "secret_access_key",
125
+ "secret_key",
126
+ "seed_phrase",
127
+ "service_account_json",
128
+ "service_account_key",
129
+ "shared_secret",
130
+ "signature",
131
+ "signing_key",
132
+ "signing_secret",
133
+ "ssh_private_key",
134
+ "smtp_url",
135
+ "tls_private_key",
136
+ "wallet_private_key",
137
+ "wallet_seed",
138
+ "webhook_secret",
139
+ "www_authenticate",
140
+ ];
141
+ const SESSION_KEYS = [
142
+ "_csrf",
143
+ "_csrf_token",
144
+ "_session",
145
+ "_xsrf",
146
+ "aiohttp_session",
147
+ "anti_forgery_token",
148
+ "backup_code",
149
+ "backup_codes",
150
+ "connect.sid",
151
+ "cookie",
152
+ "csrf",
153
+ "csrf_token",
154
+ "csrftoken",
155
+ "django_session",
156
+ "hotp",
157
+ "laravel_session",
158
+ "mfa",
159
+ "mfa_code",
160
+ "otp",
161
+ "phpsessid",
162
+ "pin",
163
+ "recovery_code",
164
+ "recovery_codes",
165
+ "remember_token",
166
+ "session",
167
+ "session_id",
168
+ "session_key",
169
+ "session_token",
170
+ "sessionid",
171
+ "set_cookie",
172
+ "setcookie",
173
+ "sid",
174
+ "symfony",
175
+ "totp",
176
+ "user_session",
177
+ "x_csrf_token",
178
+ "x_csrftoken",
179
+ "x_xsrf_token",
180
+ "xsrf",
181
+ "xsrf_token",
182
+ ];
183
+ const PERSONAL_AND_FINANCIAL_KEYS = [
184
+ "account_number",
185
+ "bank_account",
186
+ "card",
187
+ "card_number",
188
+ "credit_card",
189
+ "credit_card_number",
190
+ "cvc",
191
+ "cvv",
192
+ "date_of_birth",
193
+ "dob",
194
+ "driver_license",
195
+ "drivers_license",
196
+ "iban",
197
+ "ip_address",
198
+ "national_id",
199
+ "passport_number",
200
+ "remote_addr",
201
+ "routing_number",
202
+ "sort_code",
203
+ "ssn",
204
+ "tax_id",
205
+ "x_forwarded_for",
206
+ "x_real_ip",
207
+ ];
208
+ const PROVIDER_KEYS = [
209
+ "algolia_admin_api_key",
210
+ "anthropic_api_key",
211
+ "artifactory_api_key",
212
+ "airtable_api_key",
213
+ "azure_api_key",
214
+ "buildkite_agent_token",
215
+ "circle_token",
216
+ "cohere_api_key",
217
+ "cloudflare_api_token",
218
+ "consul_http_token",
219
+ "datadog_api_key",
220
+ "datadog_app_key",
221
+ "discord_bot_token",
222
+ "docker_password",
223
+ "docker_config_json",
224
+ "digitalocean_token",
225
+ "firebase_service_account",
226
+ "gemini_api_key",
227
+ "github_token",
228
+ "gitlab_token",
229
+ "google_api_key",
230
+ "groq_api_key",
231
+ "honeycomb_api_key",
232
+ "huggingface_token",
233
+ "heroku_api_key",
234
+ "jfrog_access_token",
235
+ "linear_api_key",
236
+ "mapbox_access_token",
237
+ "new_relic_license_key",
238
+ "nomad_token",
239
+ "notion_token",
240
+ "npm_token",
241
+ "openai_api_key",
242
+ "pagerduty_routing_key",
243
+ "pypi_token",
244
+ "sentry_auth_token",
245
+ "sentry_dsn",
246
+ "sendgrid_api_key",
247
+ "shopify_access_token",
248
+ "shopify_api_secret",
249
+ "slack_app_token",
250
+ "slack_bot_token",
251
+ "slack_signing_secret",
252
+ "stripe_secret_key",
253
+ "stripe_webhook_secret",
254
+ "supabase_service_role_key",
255
+ "telegram_bot_token",
256
+ "terraform_cloud_token",
257
+ "twilio_auth_token",
258
+ "vault_token",
259
+ "vercel_oidc_token",
260
+ "x_api_key",
261
+ "x_auth_token",
262
+ ];
263
+ exports.SENSITIVE_KEYS = [
264
+ ...PASSWORD_KEYS,
265
+ ...TOKEN_KEYS,
266
+ ...KEY_MATERIAL_KEYS,
267
+ ...SESSION_KEYS,
268
+ ...PERSONAL_AND_FINANCIAL_KEYS,
269
+ ...PROVIDER_KEYS,
270
+ ];
271
+ exports.SENSITIVE_HTTP_HEADERS = [
272
+ "authentication_info",
273
+ "authorization",
274
+ "cf_access_authenticated_user_email",
275
+ "cf_access_jwt_assertion",
276
+ "cookie",
277
+ "grpcgateway_authorization",
278
+ "impersonate_group",
279
+ "impersonate_user",
280
+ "jenkins_crumb",
281
+ "job_token",
282
+ "ocp_apim_subscription_key",
283
+ "private_token",
284
+ "proxy_authenticate",
285
+ "proxy_authentication_info",
286
+ "proxy_authorization",
287
+ "set_cookie",
288
+ "stripe_signature",
289
+ "www_authenticate",
290
+ "x_access_token",
291
+ "x_algolia_api_key",
292
+ "x_amz_credential",
293
+ "x_amz_security_token",
294
+ "x_amz_signature",
295
+ "x_amzn_oidc_accesstoken",
296
+ "x_amzn_oidc_data",
297
+ "x_amzn_oidc_identity",
298
+ "x_api_key",
299
+ "x_asana_request_token",
300
+ "x_aws_ec2_metadata_token",
301
+ "x_auth_request_access_token",
302
+ "x_auth_request_email",
303
+ "x_auth_request_groups",
304
+ "x_auth_request_preferred_username",
305
+ "x_auth_request_user",
306
+ "x_auth_token",
307
+ "x_box_signature_primary",
308
+ "x_box_signature_secondary",
309
+ "x_cf_access_jwt_assertion",
310
+ "x_csrf_token",
311
+ "x_circle_token",
312
+ "x_consul_token",
313
+ "x_credential_identifier",
314
+ "x_datadog_api_key",
315
+ "x_discord_signature_ed25519",
316
+ "x_docusign_signature_1",
317
+ "x_dropbox_signature",
318
+ "x_elastic_client_authentication",
319
+ "x_firebase_appcheck",
320
+ "x_forwarded_access_token",
321
+ "x_forwarded_email",
322
+ "x_forwarded_for",
323
+ "x_forwarded_user",
324
+ "x_functions_key",
325
+ "x_github_token",
326
+ "x_gitlab_token",
327
+ "x_goog_api_key",
328
+ "x_goog_firebase_installations_auth",
329
+ "x_goog_iap_jwt_assertion",
330
+ "x_hub_signature",
331
+ "x_hub_signature_256",
332
+ "x_honeycomb_api_key",
333
+ "x_honeycomb_team",
334
+ "x_intercom_hmac",
335
+ "x_jwt_assertion",
336
+ "x_linear_signature",
337
+ "x_mailgun_signature",
338
+ "x_master_key",
339
+ "x_meili_api_key",
340
+ "x_ms_client_principal",
341
+ "x_ms_token_aad_access_token",
342
+ "x_ms_token_aad_id_token",
343
+ "x_ms_token_aad_refresh_token",
344
+ "x_nf_client_connection_ip",
345
+ "x_nomad_token",
346
+ "x_npm_token",
347
+ "x_original_authorization",
348
+ "x_real_ip",
349
+ "x_remote_email",
350
+ "x_remote_groups",
351
+ "x_remote_user",
352
+ "x_pagerduty_signature",
353
+ "x_parse_rest_api_key",
354
+ "x_sendgrid_event_webhook_signature",
355
+ "x_session_token",
356
+ "x_shopify_hmac_sha256",
357
+ "x_signature",
358
+ "x_signature_ed25519",
359
+ "x_slack_signature",
360
+ "x_sonarqube_passcode",
361
+ "x_squarespace_hmacsha256_signature",
362
+ "x_twilio_signature",
363
+ "x_typesense_api_key",
364
+ "x_userinfo",
365
+ "x_vault_token",
366
+ "x_vercel_oidc_token",
367
+ "x_webhook_signature",
368
+ "x_webhook_secret",
369
+ "x_wix_webhook_signature",
370
+ "x_xsrf_token",
371
+ "x_zendesk_webhook_signature",
372
+ ];
373
+ exports.SENSITIVE_QUERY_KEYS = [
374
+ "access_token",
375
+ "api_key",
376
+ "api_secret",
377
+ "api_token",
378
+ "apikey",
379
+ "assertion",
380
+ "auth",
381
+ "auth_token",
382
+ "authorization",
383
+ "authorization_code",
384
+ "bearer_token",
385
+ "client_assertion",
386
+ "client_secret",
387
+ "code",
388
+ "code_verifier",
389
+ "credential",
390
+ "hmac",
391
+ "id_token",
392
+ "invite_token",
393
+ "jwt",
394
+ "key",
395
+ "magic_link_token",
396
+ "oauth_token_secret",
397
+ "otp",
398
+ "password_reset_token",
399
+ "password",
400
+ "policy",
401
+ "pin",
402
+ "refresh_token",
403
+ "reset_token",
404
+ "saml_response",
405
+ "secret",
406
+ "secret_key",
407
+ "session",
408
+ "session_id",
409
+ "session_token",
410
+ "sig",
411
+ "signature",
412
+ "token",
413
+ "token_secret",
414
+ "unsubscribe_token",
415
+ "verification_token",
416
+ "x_amz_credential",
417
+ "x_amz_security_token",
418
+ "x_amz_signature",
419
+ "x_goog_credential",
420
+ "x_goog_signature",
421
+ ];
@@ -0,0 +1,24 @@
1
+ export interface RedactOptions {
2
+ readonly secrets?: readonly string[];
3
+ readonly pii?: readonly string[];
4
+ }
5
+ export interface RedactionConfig {
6
+ readonly secretKeys: ReadonlySet<string>;
7
+ readonly piiKeys: ReadonlySet<string>;
8
+ }
9
+ export type KeyMatchKind = "floor" | "pii" | "secret";
10
+ export declare function setActiveRedactionConfig(config: RedactionConfig): void;
11
+ export declare function getActiveRedactionConfig(): RedactionConfig;
12
+ export declare function normalizeKey(key: string): string;
13
+ export declare function isFloorKey(key: string): boolean;
14
+ export declare function isSensitiveQueryKey(key: string): boolean;
15
+ export declare function keyMatch(key: string, config?: RedactionConfig): KeyMatchKind | undefined;
16
+ export declare function tailMask(value: unknown): string;
17
+ export declare function maskForMatch(kind: KeyMatchKind, value: unknown): string;
18
+ export declare function redactQueryPairs(query: string, config?: RedactionConfig): string;
19
+ export declare function redactUrlLike(text: string, config?: RedactionConfig): string;
20
+ export declare function redactString(text: string, config?: RedactionConfig): string;
21
+ export declare function redactDeep(value: unknown, config?: RedactionConfig): unknown;
22
+ export declare function redactAttributeValue(key: string, value: unknown, config?: RedactionConfig): unknown;
23
+ export declare function redactAttributesCopy(attributes: Readonly<Record<string, unknown>>, config?: RedactionConfig): Record<string, unknown>;
24
+ export declare function resolveRedactionConfig(redact: unknown): RedactionConfig;