snulbug 0.1.1__py3-none-any.whl
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.
- snulbug/__init__.py +588 -0
- snulbug/__main__.py +3 -0
- snulbug/auth_recipes.py +715 -0
- snulbug/builtin_presets/mcp/auth-required.snulbug/README.md +6 -0
- snulbug/builtin_presets/mcp/auth-required.snulbug/fixtures/authenticated.json +8 -0
- snulbug/builtin_presets/mcp/auth-required.snulbug/fixtures/missing-token.json +6 -0
- snulbug/builtin_presets/mcp/auth-required.snulbug/manifest.json +28 -0
- snulbug/builtin_presets/mcp/auth-required.snulbug/policy.lua +34 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/README.md +10 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/fixtures/missing-token.json +8 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/fixtures/safe-tool.json +9 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/fixtures/unsafe-tool.json +9 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/manifest.json +49 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/policy.lua +50 -0
- snulbug/builtin_presets/mcp/local-dev-safe.snulbug/snapshots/empty.json +3 -0
- snulbug/builtin_presets/mcp/no-shell-tools.snulbug/README.md +10 -0
- snulbug/builtin_presets/mcp/no-shell-tools.snulbug/fixtures/missing-token.json +8 -0
- snulbug/builtin_presets/mcp/no-shell-tools.snulbug/fixtures/safe-tool.json +9 -0
- snulbug/builtin_presets/mcp/no-shell-tools.snulbug/fixtures/shell-tool.json +9 -0
- snulbug/builtin_presets/mcp/no-shell-tools.snulbug/manifest.json +39 -0
- snulbug/builtin_presets/mcp/no-shell-tools.snulbug/policy.lua +66 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/README.md +19 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/fixtures/absolute-path.json +9 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/fixtures/allowed-path.json +9 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/fixtures/traversal-path.json +9 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/fixtures/unsafe-tool.json +9 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/manifest.json +50 -0
- snulbug/builtin_presets/mcp/project-path-allowlist.snulbug/policy.lua +120 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/README.md +11 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/fixtures/missing-token.json +8 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/fixtures/safe-tool.json +9 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/fixtures/tools-list.json +9 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/fixtures/write-method.json +9 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/manifest.json +58 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/policy.lua +82 -0
- snulbug/builtin_presets/mcp/read-only-local-dev.snulbug/snapshots/empty.json +3 -0
- snulbug/builtin_presets/mcp/tool-allowlist.snulbug/README.md +6 -0
- snulbug/builtin_presets/mcp/tool-allowlist.snulbug/fixtures/safe-tool.json +8 -0
- snulbug/builtin_presets/mcp/tool-allowlist.snulbug/fixtures/tools-list.json +8 -0
- snulbug/builtin_presets/mcp/tool-allowlist.snulbug/fixtures/unsafe-tool.json +8 -0
- snulbug/builtin_presets/mcp/tool-allowlist.snulbug/manifest.json +37 -0
- snulbug/builtin_presets/mcp/tool-allowlist.snulbug/policy.lua +22 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/README.md +12 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/fixtures/batch-request.json +9 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/fixtures/missing-token.json +8 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/fixtures/safe-tool.json +9 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/fixtures/unsafe-tool.json +9 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/manifest.json +60 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/policy.lua +70 -0
- snulbug/builtin_presets/mcp/tunnel-safe.snulbug/snapshots/empty.json +3 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/README.md +31 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/fixtures/allowed-read.json +9 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/fixtures/missing-token.json +8 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/fixtures/secret-path.json +9 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/fixtures/traversal-path.json +9 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/fixtures/unsafe-tool.json +9 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/manifest.json +64 -0
- snulbug/builtin_presets/mcp/workspace-firewall.snulbug/policy.lua +121 -0
- snulbug/bundle.py +684 -0
- snulbug/cli/__init__.py +1 -0
- snulbug/cli/common.py +18 -0
- snulbug/cli/evidence.py +269 -0
- snulbug/cli/fabric.py +1070 -0
- snulbug/cli/policy.py +315 -0
- snulbug/cli/rich_reports.py +630 -0
- snulbug/cli/rich_share.py +271 -0
- snulbug/cli/schemas.py +189 -0
- snulbug/cli/share.py +1700 -0
- snulbug/cli_helpers.py +147 -0
- snulbug/cloudflare_access.py +375 -0
- snulbug/codespaces.py +643 -0
- snulbug/config.py +1317 -0
- snulbug/confirm.py +220 -0
- snulbug/control_events.py +82 -0
- snulbug/controller.py +1574 -0
- snulbug/credentials.py +252 -0
- snulbug/discovery.py +958 -0
- snulbug/events.py +580 -0
- snulbug/fabric.py +2691 -0
- snulbug/fabric_control.py +518 -0
- snulbug/fabric_members.py +557 -0
- snulbug/fabric_runtime.py +657 -0
- snulbug/gateway_templates.py +89 -0
- snulbug/guide.py +337 -0
- snulbug/impact.py +436 -0
- snulbug/inspection.py +394 -0
- snulbug/lab.py +1031 -0
- snulbug/learn.py +773 -0
- snulbug/leases.py +716 -0
- snulbug/manifests.py +122 -0
- snulbug/mcp_auth.py +1586 -0
- snulbug/mcp_policy_bundles.py +100 -0
- snulbug/mcp_schema_policy.py +1055 -0
- snulbug/mcp_schemas.py +761 -0
- snulbug/mcp_tools.py +401 -0
- snulbug/middleware.py +689 -0
- snulbug/policy_activation.py +210 -0
- snulbug/policy_review.py +315 -0
- snulbug/presets.py +861 -0
- snulbug/promotion.py +345 -0
- snulbug/proxy.py +3863 -0
- snulbug/py.typed +1 -0
- snulbug/quickstart.py +541 -0
- snulbug/recorder.py +225 -0
- snulbug/redaction.py +302 -0
- snulbug/response_policy.py +327 -0
- snulbug/runtime.py +2649 -0
- snulbug/sarif.py +293 -0
- snulbug/scaffolds.py +507 -0
- snulbug/schema_policy.py +466 -0
- snulbug/share.py +7736 -0
- snulbug/share_session.py +258 -0
- snulbug/simulator.py +273 -0
- snulbug/state.py +430 -0
- snulbug/tool_risk.py +326 -0
- snulbug/tunnel.py +1776 -0
- snulbug-0.1.1.dist-info/METADATA +449 -0
- snulbug-0.1.1.dist-info/RECORD +121 -0
- snulbug-0.1.1.dist-info/WHEEL +4 -0
- snulbug-0.1.1.dist-info/entry_points.txt +2 -0
- snulbug-0.1.1.dist-info/licenses/LICENSE +21 -0
snulbug/__init__.py
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
"""Local-dev MCP policy proxy and programmable Lua ASGI policy layer."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.1.1"
|
|
4
|
+
|
|
5
|
+
from .auth_recipes import (
|
|
6
|
+
AUTH_RECIPE_PROVIDERS,
|
|
7
|
+
format_mcp_auth_init_report,
|
|
8
|
+
format_mcp_auth_recipe_report,
|
|
9
|
+
generate_mcp_auth_init,
|
|
10
|
+
generate_mcp_auth_recipe,
|
|
11
|
+
)
|
|
12
|
+
from .bundle import (
|
|
13
|
+
LIFECYCLE_STATES,
|
|
14
|
+
bundle_lifecycle_digest,
|
|
15
|
+
inspect_bundle_lifecycle,
|
|
16
|
+
pack_bundle,
|
|
17
|
+
promote_bundle_lifecycle,
|
|
18
|
+
sign_bundle_lifecycle,
|
|
19
|
+
test_bundle,
|
|
20
|
+
validate_bundle,
|
|
21
|
+
verify_bundle_lifecycle,
|
|
22
|
+
)
|
|
23
|
+
from .cloudflare_access import CloudflareAccessConfig, evaluate_cloudflare_access
|
|
24
|
+
from .codespaces import (
|
|
25
|
+
DEFAULT_CODESPACE_ATTACH_DIR,
|
|
26
|
+
DEFAULT_CODESPACE_DEMO_HOST,
|
|
27
|
+
DEFAULT_CODESPACE_DEMO_NAME,
|
|
28
|
+
DEFAULT_CODESPACE_DEMO_PATH,
|
|
29
|
+
DEFAULT_CODESPACE_DEMO_PORT,
|
|
30
|
+
DEFAULT_CODESPACE_DISCOVERY_ENV,
|
|
31
|
+
DEFAULT_CODESPACE_HOST,
|
|
32
|
+
DEFAULT_CODESPACE_PORT,
|
|
33
|
+
DEFAULT_CODESPACE_TOOL_PREFIX,
|
|
34
|
+
DEFAULT_CODESPACE_UPSTREAM_NAME,
|
|
35
|
+
codespace_forwarded_url,
|
|
36
|
+
create_codespace_demo_server,
|
|
37
|
+
format_codespace_attach_report,
|
|
38
|
+
format_codespace_demo_report,
|
|
39
|
+
prepare_codespace_attach,
|
|
40
|
+
prepare_codespace_demo,
|
|
41
|
+
serve_codespace_demo,
|
|
42
|
+
smoke_check_codespace_upstream,
|
|
43
|
+
)
|
|
44
|
+
from .config import (
|
|
45
|
+
default_event_sink_configs,
|
|
46
|
+
format_event_sinks_toml,
|
|
47
|
+
load_mcp_fabric_config,
|
|
48
|
+
load_mcp_proxy_config,
|
|
49
|
+
normalize_mcp_auth_config,
|
|
50
|
+
write_sample_config,
|
|
51
|
+
)
|
|
52
|
+
from .confirm import ConfirmationBroker
|
|
53
|
+
from .control_events import (
|
|
54
|
+
CONTROL_EVENT_SCHEMA,
|
|
55
|
+
EVENT_DISCOVERY_DEGRADED,
|
|
56
|
+
EVENT_DISCOVERY_RECOVERED,
|
|
57
|
+
EVENT_MANIFEST_CHANGED,
|
|
58
|
+
EVENT_POLICY_CHANGED,
|
|
59
|
+
EVENT_RELOAD_FAILED,
|
|
60
|
+
EVENT_RELOAD_RECOVERED,
|
|
61
|
+
EVENT_ROUTE_CHANGED,
|
|
62
|
+
EVENT_UPSTREAM_DEGRADED,
|
|
63
|
+
EVENT_UPSTREAM_RECOVERED,
|
|
64
|
+
EVENT_UPSTREAM_UNHEALTHY,
|
|
65
|
+
make_control_event,
|
|
66
|
+
)
|
|
67
|
+
from .controller import (
|
|
68
|
+
FabricControllerStatusServer,
|
|
69
|
+
format_fabric_controller_report,
|
|
70
|
+
format_fabric_run_report,
|
|
71
|
+
reconcile_fabric_controller,
|
|
72
|
+
run_fabric_controller,
|
|
73
|
+
run_fabric_data_plane,
|
|
74
|
+
)
|
|
75
|
+
from .discovery import discovery_provider_types, register_discovery_provider
|
|
76
|
+
from .events import (
|
|
77
|
+
ConsoleEventSink,
|
|
78
|
+
EventDispatcher,
|
|
79
|
+
JsonlEventSink,
|
|
80
|
+
WebhookDeliveryResult,
|
|
81
|
+
WebhookEventSink,
|
|
82
|
+
WebhookSink,
|
|
83
|
+
build_event_dispatcher,
|
|
84
|
+
deliver_webhook_event,
|
|
85
|
+
event_names,
|
|
86
|
+
format_decision_console_line,
|
|
87
|
+
normalize_event_sink_configs,
|
|
88
|
+
prepare_webhook_payload,
|
|
89
|
+
)
|
|
90
|
+
from .fabric import (
|
|
91
|
+
annotate_topology_audit,
|
|
92
|
+
build_fabric_audit_metadata,
|
|
93
|
+
discover_fabric_upstreams,
|
|
94
|
+
doctor_fabric,
|
|
95
|
+
fabric_status,
|
|
96
|
+
format_fabric_conformance_report,
|
|
97
|
+
format_fabric_discovery_report,
|
|
98
|
+
format_fabric_doctor_report,
|
|
99
|
+
format_fabric_learn_report,
|
|
100
|
+
format_fabric_status_report,
|
|
101
|
+
generate_fabric_conformance_pack,
|
|
102
|
+
learn_fabric_profile,
|
|
103
|
+
run_fabric_conformance_pack,
|
|
104
|
+
)
|
|
105
|
+
from .fabric_control import (
|
|
106
|
+
FABRIC_CONTROL_ACTION_TYPES,
|
|
107
|
+
FABRIC_CONTROL_STATE_SCHEMA,
|
|
108
|
+
clear_fabric_control_actions,
|
|
109
|
+
format_fabric_control_report,
|
|
110
|
+
issue_fabric_control_action,
|
|
111
|
+
load_fabric_control_state,
|
|
112
|
+
summarize_fabric_control_state,
|
|
113
|
+
)
|
|
114
|
+
from .fabric_members import (
|
|
115
|
+
DEFAULT_FABRIC_MEMBER_REGISTRY,
|
|
116
|
+
DEFAULT_FABRIC_MEMBER_REGISTRY_KEY,
|
|
117
|
+
DEFAULT_FABRIC_MEMBER_TTL_SECONDS,
|
|
118
|
+
FABRIC_MEMBER_REGISTRY_SCHEMA,
|
|
119
|
+
FABRIC_MEMBER_ROLES,
|
|
120
|
+
FABRIC_MEMBER_STATUSES,
|
|
121
|
+
active_fabric_members,
|
|
122
|
+
format_fabric_member_report,
|
|
123
|
+
heartbeat_fabric_member,
|
|
124
|
+
load_fabric_member_registry,
|
|
125
|
+
member_upstreams,
|
|
126
|
+
register_fabric_member,
|
|
127
|
+
summarize_fabric_members,
|
|
128
|
+
unregister_fabric_member,
|
|
129
|
+
)
|
|
130
|
+
from .fabric_runtime import (
|
|
131
|
+
DEFAULT_FABRIC_RUNTIME_LEASE_TTL_SECONDS,
|
|
132
|
+
DEFAULT_FABRIC_RUNTIME_STATE,
|
|
133
|
+
DEFAULT_FABRIC_RUNTIME_STATE_KEY,
|
|
134
|
+
FABRIC_RUNTIME_LEASE_SCHEMA,
|
|
135
|
+
FABRIC_RUNTIME_STATE_SCHEMA,
|
|
136
|
+
FabricRuntimeStateStore,
|
|
137
|
+
MemoryFabricRuntimeStateStore,
|
|
138
|
+
PolicyFabricRuntimeStateStore,
|
|
139
|
+
clear_fabric_runtime_status,
|
|
140
|
+
format_fabric_runtime_report,
|
|
141
|
+
load_fabric_runtime_status,
|
|
142
|
+
open_fabric_runtime_state_store,
|
|
143
|
+
)
|
|
144
|
+
from .gateway_templates import GatewayTemplate, render_gateway_toml
|
|
145
|
+
from .guide import MCP_GUIDE_WORKFLOWS, build_mcp_guide, format_mcp_guide
|
|
146
|
+
from .impact import analyze_mcp_impact, format_mcp_impact_report
|
|
147
|
+
from .inspection import format_mcp_inspection_report, inspect_mcp_log
|
|
148
|
+
from .lab import format_mcp_auth_lab_report, run_mcp_auth_lab, run_mcp_lab
|
|
149
|
+
from .learn import amend_mcp_policy, learn_mcp_policy
|
|
150
|
+
from .leases import LeasePolicyConfig, create_lease, list_leases, revoke_lease
|
|
151
|
+
from .manifests import load_manifest, manifest_digest, sign_upstream_manifest, verify_upstream_manifest, write_manifest
|
|
152
|
+
from .mcp_auth import (
|
|
153
|
+
OAuthDecision,
|
|
154
|
+
OAuthResourceConfig,
|
|
155
|
+
RemoteIssuerMetadataCache,
|
|
156
|
+
RemoteJwksCache,
|
|
157
|
+
TokenIntrospectionCache,
|
|
158
|
+
auth_runtime_snapshot,
|
|
159
|
+
auth_runtime_summary,
|
|
160
|
+
evaluate_oauth_request,
|
|
161
|
+
oauth_bearer_challenge,
|
|
162
|
+
oauth_resource_metadata_url,
|
|
163
|
+
protected_resource_metadata,
|
|
164
|
+
verify_jwt,
|
|
165
|
+
verify_token,
|
|
166
|
+
)
|
|
167
|
+
from .mcp_schema_policy import (
|
|
168
|
+
DEFAULT_SCHEMA_POLICY_ALLOWED_PATHS,
|
|
169
|
+
MCP_SCHEMA_POLICY_SCHEMA,
|
|
170
|
+
SCHEMA_POLICY_HIGH_RISK_ACTIONS,
|
|
171
|
+
SchemaPolicyOptions,
|
|
172
|
+
format_mcp_schema_policy_report,
|
|
173
|
+
generate_mcp_schema_policy,
|
|
174
|
+
score_mcp_schema_catalog,
|
|
175
|
+
)
|
|
176
|
+
from .mcp_schemas import (
|
|
177
|
+
DEFAULT_MCP_PROTOCOL_VERSION,
|
|
178
|
+
MCP_SCHEMA_CATALOG_SCHEMA,
|
|
179
|
+
MCP_SCHEMA_DIFF_SCHEMA,
|
|
180
|
+
build_mcp_schema_catalog,
|
|
181
|
+
diff_mcp_schema_catalogs,
|
|
182
|
+
discover_mcp_schemas,
|
|
183
|
+
fetch_mcp_jsonrpc,
|
|
184
|
+
fetch_mcp_schema_responses,
|
|
185
|
+
format_mcp_schema_catalog_report,
|
|
186
|
+
format_mcp_schema_diff_report,
|
|
187
|
+
normalize_mcp_schema_methods,
|
|
188
|
+
parse_mcp_schema_headers,
|
|
189
|
+
stable_schema_digest,
|
|
190
|
+
)
|
|
191
|
+
from .mcp_tools import (
|
|
192
|
+
MCP_TOOL_DIFF_SCHEMA,
|
|
193
|
+
MCP_TOOL_SNAPSHOT_SCHEMA,
|
|
194
|
+
build_mcp_tool_snapshot,
|
|
195
|
+
diff_mcp_tool_snapshots,
|
|
196
|
+
fetch_mcp_tools_list,
|
|
197
|
+
format_mcp_tool_diff_report,
|
|
198
|
+
format_mcp_tool_snapshot_report,
|
|
199
|
+
mcp_tool_digest,
|
|
200
|
+
parse_mcp_tool_headers,
|
|
201
|
+
snapshot_mcp_tools,
|
|
202
|
+
)
|
|
203
|
+
from .middleware import LuaConfig, LuaMiddleware
|
|
204
|
+
from .policy_activation import POLICY_ACTIVATION_MODES, reconcile_policy_activation
|
|
205
|
+
from .presets import McpPolicyOptions, copy_builtin_preset, generate_mcp_preset, list_builtin_presets
|
|
206
|
+
from .promotion import compare_decisions, diff_policies, format_policy_diff_report
|
|
207
|
+
from .proxy import (
|
|
208
|
+
FabricConfigReloadMiddleware,
|
|
209
|
+
FacadeHealthPolicy,
|
|
210
|
+
FacadeUpstream,
|
|
211
|
+
ManagedHolepunchBridge,
|
|
212
|
+
ManagedStdioMcpClient,
|
|
213
|
+
McpFacadeProxyApp,
|
|
214
|
+
ReverseProxyApp,
|
|
215
|
+
create_proxy_application,
|
|
216
|
+
proxy_config_run_kwargs,
|
|
217
|
+
run_mcp_proxy_config,
|
|
218
|
+
run_proxy,
|
|
219
|
+
)
|
|
220
|
+
from .quickstart import create_mcp_quickstart
|
|
221
|
+
from .recorder import append_record, load_record_log, record_audit_event, record_policy_request, replay_record_log
|
|
222
|
+
from .redaction import RedactionConfig, append_audit_event, build_audit_event, redact_secrets
|
|
223
|
+
from .response_policy import ResponsePolicyConfig
|
|
224
|
+
from .runtime import LuaDecisionError, LuaDecisionTrace, LuaRuntimeError
|
|
225
|
+
from .sarif import sarif_for_policy_diff, sarif_for_schema_diff, sarif_for_share_doctor
|
|
226
|
+
from .scaffolds import (
|
|
227
|
+
GeneratedArtifact,
|
|
228
|
+
GeneratedClient,
|
|
229
|
+
GeneratedCommand,
|
|
230
|
+
GeneratedEnv,
|
|
231
|
+
GeneratedLog,
|
|
232
|
+
GeneratedSession,
|
|
233
|
+
ScaffoldFile,
|
|
234
|
+
ScaffoldPlan,
|
|
235
|
+
format_scaffold_report,
|
|
236
|
+
format_session_report,
|
|
237
|
+
json_scaffold_file,
|
|
238
|
+
session_result,
|
|
239
|
+
session_summary,
|
|
240
|
+
write_scaffold,
|
|
241
|
+
)
|
|
242
|
+
from .schema_policy import SchemaPolicyConfig
|
|
243
|
+
from .share import (
|
|
244
|
+
activate_mcp_share_policy,
|
|
245
|
+
amend_mcp_share_policy,
|
|
246
|
+
attach_mcp_share_member,
|
|
247
|
+
close_mcp_share,
|
|
248
|
+
create_mcp_share,
|
|
249
|
+
doctor_mcp_share,
|
|
250
|
+
doctor_mcp_share_auth,
|
|
251
|
+
format_share_auth_conformance_report,
|
|
252
|
+
format_share_auth_doctor_report,
|
|
253
|
+
format_share_doctor_report,
|
|
254
|
+
format_share_report,
|
|
255
|
+
format_share_status_report,
|
|
256
|
+
generate_auth_conformance_pack,
|
|
257
|
+
load_mcp_share,
|
|
258
|
+
load_share_contract,
|
|
259
|
+
promote_mcp_share_policy,
|
|
260
|
+
run_auth_conformance_pack,
|
|
261
|
+
run_mcp_share,
|
|
262
|
+
share_client_config,
|
|
263
|
+
share_contract,
|
|
264
|
+
share_contract_runtime_metadata,
|
|
265
|
+
share_report,
|
|
266
|
+
share_status,
|
|
267
|
+
)
|
|
268
|
+
from .share_session import (
|
|
269
|
+
SHARE_SESSION_MODEL_PATH,
|
|
270
|
+
SHARE_SESSION_MODEL_TYPE,
|
|
271
|
+
build_share_session_model,
|
|
272
|
+
load_share_session_model,
|
|
273
|
+
share_session_model_path,
|
|
274
|
+
update_share_session_model,
|
|
275
|
+
write_share_session_model,
|
|
276
|
+
)
|
|
277
|
+
from .simulator import simulate_policy
|
|
278
|
+
from .state import (
|
|
279
|
+
BoundedPolicyState,
|
|
280
|
+
MemoryStateStore,
|
|
281
|
+
RedisStateStore,
|
|
282
|
+
SnapshotStateStore,
|
|
283
|
+
SQLiteStateStore,
|
|
284
|
+
StateLimits,
|
|
285
|
+
)
|
|
286
|
+
from .tool_risk import classify_mcp_tool, classify_mcp_tool_risks
|
|
287
|
+
from .tunnel import (
|
|
288
|
+
TUNNEL_PROVIDERS,
|
|
289
|
+
TunnelAuditConfig,
|
|
290
|
+
build_tunnel_audit_metadata,
|
|
291
|
+
display_tunnel_public_endpoint,
|
|
292
|
+
doctor_tunnel,
|
|
293
|
+
format_tunnel_doctor_report,
|
|
294
|
+
format_tunnel_init_report,
|
|
295
|
+
init_tunnel_provider,
|
|
296
|
+
parse_tunnel_headers,
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
__all__ = [
|
|
300
|
+
"BoundedPolicyState",
|
|
301
|
+
"CloudflareAccessConfig",
|
|
302
|
+
"ConsoleEventSink",
|
|
303
|
+
"ConfirmationBroker",
|
|
304
|
+
"CONTROL_EVENT_SCHEMA",
|
|
305
|
+
"AUTH_RECIPE_PROVIDERS",
|
|
306
|
+
"DEFAULT_FABRIC_MEMBER_REGISTRY",
|
|
307
|
+
"DEFAULT_FABRIC_MEMBER_REGISTRY_KEY",
|
|
308
|
+
"DEFAULT_FABRIC_MEMBER_TTL_SECONDS",
|
|
309
|
+
"DEFAULT_CODESPACE_ATTACH_DIR",
|
|
310
|
+
"DEFAULT_CODESPACE_DEMO_HOST",
|
|
311
|
+
"DEFAULT_CODESPACE_DEMO_NAME",
|
|
312
|
+
"DEFAULT_CODESPACE_DEMO_PATH",
|
|
313
|
+
"DEFAULT_CODESPACE_DEMO_PORT",
|
|
314
|
+
"DEFAULT_CODESPACE_DISCOVERY_ENV",
|
|
315
|
+
"DEFAULT_CODESPACE_HOST",
|
|
316
|
+
"DEFAULT_CODESPACE_PORT",
|
|
317
|
+
"DEFAULT_CODESPACE_TOOL_PREFIX",
|
|
318
|
+
"DEFAULT_CODESPACE_UPSTREAM_NAME",
|
|
319
|
+
"DEFAULT_FABRIC_RUNTIME_LEASE_TTL_SECONDS",
|
|
320
|
+
"DEFAULT_FABRIC_RUNTIME_STATE",
|
|
321
|
+
"DEFAULT_FABRIC_RUNTIME_STATE_KEY",
|
|
322
|
+
"DEFAULT_MCP_PROTOCOL_VERSION",
|
|
323
|
+
"DEFAULT_SCHEMA_POLICY_ALLOWED_PATHS",
|
|
324
|
+
"EVENT_DISCOVERY_DEGRADED",
|
|
325
|
+
"EVENT_DISCOVERY_RECOVERED",
|
|
326
|
+
"EVENT_MANIFEST_CHANGED",
|
|
327
|
+
"EVENT_POLICY_CHANGED",
|
|
328
|
+
"EVENT_RELOAD_FAILED",
|
|
329
|
+
"EVENT_RELOAD_RECOVERED",
|
|
330
|
+
"EVENT_ROUTE_CHANGED",
|
|
331
|
+
"EVENT_UPSTREAM_DEGRADED",
|
|
332
|
+
"EVENT_UPSTREAM_RECOVERED",
|
|
333
|
+
"EVENT_UPSTREAM_UNHEALTHY",
|
|
334
|
+
"EventDispatcher",
|
|
335
|
+
"FABRIC_CONTROL_ACTION_TYPES",
|
|
336
|
+
"FABRIC_CONTROL_STATE_SCHEMA",
|
|
337
|
+
"FABRIC_MEMBER_REGISTRY_SCHEMA",
|
|
338
|
+
"FABRIC_MEMBER_ROLES",
|
|
339
|
+
"FABRIC_MEMBER_STATUSES",
|
|
340
|
+
"FABRIC_RUNTIME_LEASE_SCHEMA",
|
|
341
|
+
"FABRIC_RUNTIME_STATE_SCHEMA",
|
|
342
|
+
"FacadeHealthPolicy",
|
|
343
|
+
"LuaConfig",
|
|
344
|
+
"LuaDecisionError",
|
|
345
|
+
"LuaDecisionTrace",
|
|
346
|
+
"LuaMiddleware",
|
|
347
|
+
"LuaRuntimeError",
|
|
348
|
+
"LeasePolicyConfig",
|
|
349
|
+
"LIFECYCLE_STATES",
|
|
350
|
+
"MemoryFabricRuntimeStateStore",
|
|
351
|
+
"MemoryStateStore",
|
|
352
|
+
"McpPolicyOptions",
|
|
353
|
+
"FacadeUpstream",
|
|
354
|
+
"FabricConfigReloadMiddleware",
|
|
355
|
+
"FabricControllerStatusServer",
|
|
356
|
+
"FabricRuntimeStateStore",
|
|
357
|
+
"GatewayTemplate",
|
|
358
|
+
"GeneratedArtifact",
|
|
359
|
+
"GeneratedClient",
|
|
360
|
+
"GeneratedCommand",
|
|
361
|
+
"GeneratedEnv",
|
|
362
|
+
"GeneratedLog",
|
|
363
|
+
"GeneratedSession",
|
|
364
|
+
"JsonlEventSink",
|
|
365
|
+
"ManagedHolepunchBridge",
|
|
366
|
+
"ManagedStdioMcpClient",
|
|
367
|
+
"MCP_GUIDE_WORKFLOWS",
|
|
368
|
+
"MCP_SCHEMA_CATALOG_SCHEMA",
|
|
369
|
+
"MCP_SCHEMA_DIFF_SCHEMA",
|
|
370
|
+
"MCP_SCHEMA_POLICY_SCHEMA",
|
|
371
|
+
"MCP_TOOL_DIFF_SCHEMA",
|
|
372
|
+
"MCP_TOOL_SNAPSHOT_SCHEMA",
|
|
373
|
+
"McpFacadeProxyApp",
|
|
374
|
+
"OAuthDecision",
|
|
375
|
+
"OAuthResourceConfig",
|
|
376
|
+
"PolicyFabricRuntimeStateStore",
|
|
377
|
+
"POLICY_ACTIVATION_MODES",
|
|
378
|
+
"RedisStateStore",
|
|
379
|
+
"RedactionConfig",
|
|
380
|
+
"RemoteIssuerMetadataCache",
|
|
381
|
+
"RemoteJwksCache",
|
|
382
|
+
"ResponsePolicyConfig",
|
|
383
|
+
"ReverseProxyApp",
|
|
384
|
+
"SCHEMA_POLICY_HIGH_RISK_ACTIONS",
|
|
385
|
+
"ScaffoldFile",
|
|
386
|
+
"ScaffoldPlan",
|
|
387
|
+
"SchemaPolicyConfig",
|
|
388
|
+
"SchemaPolicyOptions",
|
|
389
|
+
"SQLiteStateStore",
|
|
390
|
+
"SnapshotStateStore",
|
|
391
|
+
"StateLimits",
|
|
392
|
+
"TUNNEL_PROVIDERS",
|
|
393
|
+
"TunnelAuditConfig",
|
|
394
|
+
"__version__",
|
|
395
|
+
"WebhookDeliveryResult",
|
|
396
|
+
"WebhookEventSink",
|
|
397
|
+
"WebhookSink",
|
|
398
|
+
"active_fabric_members",
|
|
399
|
+
"append_audit_event",
|
|
400
|
+
"append_record",
|
|
401
|
+
"amend_mcp_policy",
|
|
402
|
+
"amend_mcp_share_policy",
|
|
403
|
+
"analyze_mcp_impact",
|
|
404
|
+
"annotate_topology_audit",
|
|
405
|
+
"activate_mcp_share_policy",
|
|
406
|
+
"attach_mcp_share_member",
|
|
407
|
+
"auth_runtime_snapshot",
|
|
408
|
+
"auth_runtime_summary",
|
|
409
|
+
"build_audit_event",
|
|
410
|
+
"build_event_dispatcher",
|
|
411
|
+
"build_fabric_audit_metadata",
|
|
412
|
+
"build_mcp_schema_catalog",
|
|
413
|
+
"build_mcp_tool_snapshot",
|
|
414
|
+
"build_share_session_model",
|
|
415
|
+
"build_tunnel_audit_metadata",
|
|
416
|
+
"bundle_lifecycle_digest",
|
|
417
|
+
"clear_fabric_control_actions",
|
|
418
|
+
"clear_fabric_runtime_status",
|
|
419
|
+
"close_mcp_share",
|
|
420
|
+
"compare_decisions",
|
|
421
|
+
"classify_mcp_tool",
|
|
422
|
+
"classify_mcp_tool_risks",
|
|
423
|
+
"copy_builtin_preset",
|
|
424
|
+
"codespace_forwarded_url",
|
|
425
|
+
"create_lease",
|
|
426
|
+
"create_codespace_demo_server",
|
|
427
|
+
"create_mcp_quickstart",
|
|
428
|
+
"create_mcp_share",
|
|
429
|
+
"create_proxy_application",
|
|
430
|
+
"proxy_config_run_kwargs",
|
|
431
|
+
"diff_mcp_schema_catalogs",
|
|
432
|
+
"diff_mcp_tool_snapshots",
|
|
433
|
+
"diff_policies",
|
|
434
|
+
"build_mcp_guide",
|
|
435
|
+
"deliver_webhook_event",
|
|
436
|
+
"default_event_sink_configs",
|
|
437
|
+
"discovery_provider_types",
|
|
438
|
+
"discover_fabric_upstreams",
|
|
439
|
+
"discover_mcp_schemas",
|
|
440
|
+
"display_tunnel_public_endpoint",
|
|
441
|
+
"doctor_tunnel",
|
|
442
|
+
"doctor_fabric",
|
|
443
|
+
"doctor_mcp_share",
|
|
444
|
+
"doctor_mcp_share_auth",
|
|
445
|
+
"evaluate_cloudflare_access",
|
|
446
|
+
"evaluate_oauth_request",
|
|
447
|
+
"event_names",
|
|
448
|
+
"fabric_status",
|
|
449
|
+
"fetch_mcp_jsonrpc",
|
|
450
|
+
"fetch_mcp_schema_responses",
|
|
451
|
+
"fetch_mcp_tools_list",
|
|
452
|
+
"format_fabric_conformance_report",
|
|
453
|
+
"format_fabric_discovery_report",
|
|
454
|
+
"format_fabric_doctor_report",
|
|
455
|
+
"format_fabric_controller_report",
|
|
456
|
+
"format_fabric_run_report",
|
|
457
|
+
"format_fabric_learn_report",
|
|
458
|
+
"format_fabric_control_report",
|
|
459
|
+
"format_fabric_member_report",
|
|
460
|
+
"format_fabric_runtime_report",
|
|
461
|
+
"format_fabric_status_report",
|
|
462
|
+
"format_decision_console_line",
|
|
463
|
+
"format_codespace_attach_report",
|
|
464
|
+
"format_codespace_demo_report",
|
|
465
|
+
"format_mcp_inspection_report",
|
|
466
|
+
"format_mcp_impact_report",
|
|
467
|
+
"format_mcp_guide",
|
|
468
|
+
"format_mcp_schema_catalog_report",
|
|
469
|
+
"format_mcp_schema_diff_report",
|
|
470
|
+
"format_mcp_schema_policy_report",
|
|
471
|
+
"format_mcp_tool_diff_report",
|
|
472
|
+
"format_mcp_tool_snapshot_report",
|
|
473
|
+
"format_policy_diff_report",
|
|
474
|
+
"format_mcp_auth_lab_report",
|
|
475
|
+
"format_mcp_auth_init_report",
|
|
476
|
+
"format_mcp_auth_recipe_report",
|
|
477
|
+
"format_event_sinks_toml",
|
|
478
|
+
"format_scaffold_report",
|
|
479
|
+
"format_session_report",
|
|
480
|
+
"format_share_auth_conformance_report",
|
|
481
|
+
"format_share_auth_doctor_report",
|
|
482
|
+
"format_share_doctor_report",
|
|
483
|
+
"format_share_report",
|
|
484
|
+
"format_share_status_report",
|
|
485
|
+
"format_tunnel_doctor_report",
|
|
486
|
+
"format_tunnel_init_report",
|
|
487
|
+
"generate_fabric_conformance_pack",
|
|
488
|
+
"generate_auth_conformance_pack",
|
|
489
|
+
"generate_mcp_preset",
|
|
490
|
+
"generate_mcp_auth_init",
|
|
491
|
+
"generate_mcp_auth_recipe",
|
|
492
|
+
"generate_mcp_schema_policy",
|
|
493
|
+
"heartbeat_fabric_member",
|
|
494
|
+
"inspect_mcp_log",
|
|
495
|
+
"inspect_bundle_lifecycle",
|
|
496
|
+
"init_tunnel_provider",
|
|
497
|
+
"issue_fabric_control_action",
|
|
498
|
+
"json_scaffold_file",
|
|
499
|
+
"learn_mcp_policy",
|
|
500
|
+
"learn_fabric_profile",
|
|
501
|
+
"load_fabric_control_state",
|
|
502
|
+
"load_fabric_member_registry",
|
|
503
|
+
"load_fabric_runtime_status",
|
|
504
|
+
"load_mcp_proxy_config",
|
|
505
|
+
"load_mcp_fabric_config",
|
|
506
|
+
"load_mcp_share",
|
|
507
|
+
"load_share_contract",
|
|
508
|
+
"load_share_session_model",
|
|
509
|
+
"load_manifest",
|
|
510
|
+
"load_record_log",
|
|
511
|
+
"manifest_digest",
|
|
512
|
+
"make_control_event",
|
|
513
|
+
"mcp_tool_digest",
|
|
514
|
+
"member_upstreams",
|
|
515
|
+
"list_builtin_presets",
|
|
516
|
+
"list_leases",
|
|
517
|
+
"open_fabric_runtime_state_store",
|
|
518
|
+
"pack_bundle",
|
|
519
|
+
"parse_mcp_schema_headers",
|
|
520
|
+
"parse_mcp_tool_headers",
|
|
521
|
+
"parse_tunnel_headers",
|
|
522
|
+
"prepare_codespace_attach",
|
|
523
|
+
"prepare_codespace_demo",
|
|
524
|
+
"record_audit_event",
|
|
525
|
+
"record_policy_request",
|
|
526
|
+
"reconcile_fabric_controller",
|
|
527
|
+
"reconcile_policy_activation",
|
|
528
|
+
"register_fabric_member",
|
|
529
|
+
"register_discovery_provider",
|
|
530
|
+
"redact_secrets",
|
|
531
|
+
"render_gateway_toml",
|
|
532
|
+
"replay_record_log",
|
|
533
|
+
"revoke_lease",
|
|
534
|
+
"run_mcp_auth_lab",
|
|
535
|
+
"run_auth_conformance_pack",
|
|
536
|
+
"run_mcp_lab",
|
|
537
|
+
"serve_codespace_demo",
|
|
538
|
+
"run_fabric_controller",
|
|
539
|
+
"run_fabric_conformance_pack",
|
|
540
|
+
"run_fabric_data_plane",
|
|
541
|
+
"run_mcp_proxy_config",
|
|
542
|
+
"run_mcp_share",
|
|
543
|
+
"run_proxy",
|
|
544
|
+
"sarif_for_policy_diff",
|
|
545
|
+
"sarif_for_schema_diff",
|
|
546
|
+
"sarif_for_share_doctor",
|
|
547
|
+
"score_mcp_schema_catalog",
|
|
548
|
+
"share_client_config",
|
|
549
|
+
"share_contract",
|
|
550
|
+
"share_contract_runtime_metadata",
|
|
551
|
+
"share_report",
|
|
552
|
+
"SHARE_SESSION_MODEL_PATH",
|
|
553
|
+
"SHARE_SESSION_MODEL_TYPE",
|
|
554
|
+
"share_status",
|
|
555
|
+
"share_session_model_path",
|
|
556
|
+
"session_result",
|
|
557
|
+
"session_summary",
|
|
558
|
+
"simulate_policy",
|
|
559
|
+
"smoke_check_codespace_upstream",
|
|
560
|
+
"snapshot_mcp_tools",
|
|
561
|
+
"normalize_mcp_auth_config",
|
|
562
|
+
"normalize_mcp_schema_methods",
|
|
563
|
+
"normalize_event_sink_configs",
|
|
564
|
+
"oauth_bearer_challenge",
|
|
565
|
+
"oauth_resource_metadata_url",
|
|
566
|
+
"promote_bundle_lifecycle",
|
|
567
|
+
"promote_mcp_share_policy",
|
|
568
|
+
"prepare_webhook_payload",
|
|
569
|
+
"protected_resource_metadata",
|
|
570
|
+
"sign_bundle_lifecycle",
|
|
571
|
+
"sign_upstream_manifest",
|
|
572
|
+
"summarize_fabric_control_state",
|
|
573
|
+
"summarize_fabric_members",
|
|
574
|
+
"stable_schema_digest",
|
|
575
|
+
"TokenIntrospectionCache",
|
|
576
|
+
"test_bundle",
|
|
577
|
+
"unregister_fabric_member",
|
|
578
|
+
"update_share_session_model",
|
|
579
|
+
"validate_bundle",
|
|
580
|
+
"verify_bundle_lifecycle",
|
|
581
|
+
"verify_jwt",
|
|
582
|
+
"verify_token",
|
|
583
|
+
"verify_upstream_manifest",
|
|
584
|
+
"write_scaffold",
|
|
585
|
+
"write_manifest",
|
|
586
|
+
"write_sample_config",
|
|
587
|
+
"write_share_session_model",
|
|
588
|
+
]
|
snulbug/__main__.py
ADDED