@ictechgy/context-guard 0.4.16 → 0.5.1

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.
@@ -29,6 +29,7 @@ IMPLEMENTATION_PAIRS = (('context_guard_cli.py', 'context-guard'),
29
29
  ('trim_command_output.py', 'context-guard-trim-output'))
30
30
 
31
31
  HELPER_PAIRS = (('hook_secret_patterns.py', 'lib/hook_secret_patterns.py'),
32
+ ('bash_reference_policy.py', 'bin/bash_reference_policy.py'),
32
33
  ('credential_policy.py', 'lib/credential_policy.py'),
33
34
  ('context_guard_commands.py', 'lib/context_guard_commands.py'),
34
35
  ('context_guard_command_manifest_loader.py',
@@ -89,6 +90,7 @@ DISPATCHER_SUBCOMMANDS = {'setup': ('context-guard-setup',),
89
90
  'scan': ('context-guard-diet', 'scan'),
90
91
  'trim-output': ('context-guard-trim-output',),
91
92
  'trim': ('context-guard-trim-output',),
93
+ 'reference': ('context-guard-trim-output', '--expand-bash-reference'),
92
94
  'sanitize-output': ('context-guard-sanitize-output',),
93
95
  'sanitize': ('context-guard-sanitize-output',),
94
96
  'filter': ('context-guard-filter',),
@@ -196,6 +198,7 @@ PLUGIN_ENTRYPOINTS = ('claude-read-symbol',
196
198
  'context-guard-trim-output')
197
199
 
198
200
  DISPATCHER_SMOKE_CASES = ({'entrypoint': 'context-guard', 'args': ['experiments', 'list', '--json'], 'mode': 'json'},
201
+ {'entrypoint': 'context-guard', 'args': ['reference', '--help'], 'mode': 'text'},
199
202
  {'entrypoint': 'context-guard', 'args': ['cost', '--help'], 'mode': 'text'},
200
203
  {'entrypoint': 'context-guard', 'args': ['route-advisor', '--help'], 'mode': 'text'},
201
204
  {'entrypoint': 'context-guard', 'args': ['cache-score', '--help'], 'mode': 'text'},
@@ -216,6 +219,7 @@ EXPECTED_COMMAND_PACK_FILES = ('plugins/context-guard/bin/claude-read-symbol',
216
219
  'plugins/context-guard/bin/claude-token-statusline',
217
220
  'plugins/context-guard/bin/claude-token-statusline-merged',
218
221
  'plugins/context-guard/bin/claude-trim-output',
222
+ 'plugins/context-guard/bin/bash_reference_policy.py',
219
223
  'plugins/context-guard/bin/context-guard',
220
224
  'plugins/context-guard/bin/context-guard-artifact',
221
225
  'plugins/context-guard/bin/context-guard-audit',
@@ -7,7 +7,9 @@ import re
7
7
  SECRET_KEY = (
8
8
  r"[A-Za-z0-9_.-]*(?:api[_-]?key|apikey|token|secret|password|passwd|pwd|"
9
9
  r"private[_-]?key|access[_-]?key|client[_-]?secret|credential|signature|sig|"
10
- r"ssh[_-]?key|pgp[_-]?private[_-]?key)[A-Za-z0-9_.-]*"
10
+ r"ssh[_-]?key|ssh[_-]?command|pgp[_-]?private[_-]?key)[A-Za-z0-9_.-]*"
11
+ r"|(?:pass|[A-Za-z0-9_.-]+[._-]pass)"
12
+ r"(?:[._-](?:v\d+|prod|production|dev|test|backup))?|smtp[_-]?pass"
11
13
  r"|(?:session(?:[_-]?(?:id|token))?|sessionid|sid|jsessionid|"
12
14
  r"csrf(?:[_-]?token)?|xsrf(?:[_-]?token)?)"
13
15
  r"|AWS_ACCESS_KEY_ID|AWS_SECRET_ACCESS_KEY|AWS_SESSION_TOKEN|"
@@ -34,6 +36,7 @@ EXACT_SENSITIVE_KEYS = frozenset(
34
36
  "client_secret",
35
37
  "cookie",
36
38
  "credential",
39
+ "credential_helper",
37
40
  "credentials",
38
41
  "csrf",
39
42
  "csrf_token",
@@ -41,6 +44,7 @@ EXACT_SENSITIVE_KEYS = frozenset(
41
44
  "id_token",
42
45
  "jsessionid",
43
46
  "jwt",
47
+ "pass",
44
48
  "password",
45
49
  "passwd",
46
50
  "private_key",
@@ -57,6 +61,9 @@ EXACT_SENSITIVE_KEYS = frozenset(
57
61
  "sid",
58
62
  "sig",
59
63
  "signature",
64
+ "smtp_pass",
65
+ "smtppass",
66
+ "ssh_command",
60
67
  "ssh_key",
61
68
  "sshkey",
62
69
  "token",
@@ -80,10 +87,11 @@ SENSITIVE_KEY_SUFFIXES = (
80
87
  "_secret",
81
88
  "_secret_key",
82
89
  "_session_token",
90
+ "_ssh_command",
83
91
  "_token",
84
92
  )
85
93
  SENSITIVE_KEY_QUALIFIER_RE = re.compile(
86
- r"(?:^|_)(?:api_?key|apikey|token|secret|password|passwd|pwd|"
94
+ r"(?:^|_)(?:api_?key|apikey|token|secret|password|passwd|pass|pwd|"
87
95
  r"private_key|access_key|client_secret|credential|signature|sig|"
88
96
  r"session_id|session_token)(?:_(?:v\d+|prod|production|dev|test|backup))?$"
89
97
  )