sendproof-core 0.1.0a1__tar.gz
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.
- sendproof_core-0.1.0a1/.gitignore +34 -0
- sendproof_core-0.1.0a1/LICENSE +21 -0
- sendproof_core-0.1.0a1/PKG-INFO +116 -0
- sendproof_core-0.1.0a1/README.md +73 -0
- sendproof_core-0.1.0a1/pyproject.toml +57 -0
- sendproof_core-0.1.0a1/src/sendproof_core/__init__.py +56 -0
- sendproof_core-0.1.0a1/src/sendproof_core/assets.py +71 -0
- sendproof_core-0.1.0a1/src/sendproof_core/capture.py +416 -0
- sendproof_core-0.1.0a1/src/sendproof_core/effects.py +79 -0
- sendproof_core-0.1.0a1/src/sendproof_core/identity.py +22 -0
- sendproof_core-0.1.0a1/src/sendproof_core/jsonsafe.py +103 -0
- sendproof_core-0.1.0a1/src/sendproof_core/limits.py +24 -0
- sendproof_core-0.1.0a1/src/sendproof_core/marker.py +131 -0
- sendproof_core-0.1.0a1/src/sendproof_core/options.py +129 -0
- sendproof_core-0.1.0a1/src/sendproof_core/protocol.py +132 -0
- sendproof_core-0.1.0a1/src/sendproof_core/provider.py +121 -0
- sendproof_core-0.1.0a1/src/sendproof_core/py.typed +0 -0
- sendproof_core-0.1.0a1/src/sendproof_core/redaction.py +88 -0
- sendproof_core-0.1.0a1/src/sendproof_core/scope.py +146 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/__init__.py +119 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/base.py +99 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/cassandra_hook.py +173 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/classify.py +153 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/classify_batch_two.py +397 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/cosmos_hook.py +214 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/dynamodb_hook.py +214 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/elasticsearch_hook.py +248 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/firestore_hook.py +459 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/guard.py +205 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/mongo_hook.py +1406 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/redis_hook.py +536 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/tables.py +1486 -0
- sendproof_core-0.1.0a1/src/sendproof_core/stores/versions.py +46 -0
- sendproof_core-0.1.0a1/src/sendproof_core/sync_engine.py +308 -0
- sendproof_core-0.1.0a1/src/sendproof_core/trace_store.py +92 -0
- sendproof_core-0.1.0a1/src/sendproof_core/txguard.py +237 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/action-bar.js +91 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/api.js +239 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/app.css +848 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/app.js +742 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/autofill.js +137 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/code-copy.js +71 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/code-picker.js +149 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/commands.js +197 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/components.js +77 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/context-bar.js +82 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/copy.js +92 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/coverage-popover.js +35 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/crumb-fit.js +80 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/deprecation.js +164 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/display-settings.js +175 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/doc-diff.js +209 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/docs-view.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/favicon.png +0 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/favicon.svg +1 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/field-help.js +52 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/field-modules.js +23 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/controls.js +179 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/dom.js +36 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/infer.js +71 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/lookup-source.js +63 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/lookup.js +285 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/render.js +496 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/select.js +175 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/validate.js +363 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/validation-formats.js +164 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/validation-references.js +68 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/fields/validation-values.js +137 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/generate-menu.js +44 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/generate.js +184 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/header-editor.js +777 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/headers.js +188 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/highlight.js +257 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/history-popover.js +24 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/i18n.js +253 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/icons.js +87 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/index.html +70 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/issues.js +187 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/json-view.js +166 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/lang-icons.js +62 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/layout.js +262 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/listbox.js +334 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ar-capture.js +366 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ar-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ar.js +561 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/cs-capture.js +442 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/cs-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/cs.js +689 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/da-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/da-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/da.js +522 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/de-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/de-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/de.js +519 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/el-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/el-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/el.js +520 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/en-capture.js +349 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/en-stores.js +95 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/en.js +522 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/es-capture.js +353 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/es-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/es.js +525 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fa-capture.js +348 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fa-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fa.js +521 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fi-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fi-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fi.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fr-capture.js +353 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fr-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/fr.js +525 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/he-capture.js +358 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/he-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/he.js +529 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/hi-capture.js +348 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/hi-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/hi.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/id-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/id-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/id.js +521 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/it-capture.js +361 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/it-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/it.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ja-capture.js +346 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ja-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ja.js +521 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ko-capture.js +346 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ko-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ko.js +522 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/nb-capture.js +349 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/nb-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/nb.js +521 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/nl-capture.js +355 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/nl-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/nl.js +520 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pl-capture.js +432 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pl-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pl.js +528 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pt-BR-capture.js +350 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pt-BR-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pt-BR.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pt-PT-capture.js +350 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pt-PT-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/pt-PT.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ru-capture.js +437 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ru-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/ru.js +624 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/sv-capture.js +349 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/sv-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/sv.js +518 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/th-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/th-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/th.js +521 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/tr-capture.js +348 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/tr-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/tr.js +521 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/uk-capture.js +442 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/uk-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/uk.js +630 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/vi-capture.js +346 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/vi-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/vi.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/zh-Hans-capture.js +347 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/zh-Hans-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/zh-Hans.js +523 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/zh-Hant-capture.js +346 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/zh-Hant-stores.js +116 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/locales/zh-Hant.js +522 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/manifest.json +866 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/markdown.js +39 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/model-view.js +182 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/navigation.js +233 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/operation-header.js +76 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/operations.js +7 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/overview-view.js +63 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/personas.js +59 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/popover.js +71 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/preview-false.js +108 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/request-editor.js +496 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/response-metadata.js +354 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/response-viewer.js +618 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-blocked.js +155 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-capture.js +25 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-database.js +185 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-effects.js +176 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-headers.js +106 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-logs.js +408 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/result-states.js +213 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/results.js +371 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/router.js +118 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/schema-model.js +336 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/schema-tree.js +344 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/schema.js +397 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/security.js +31 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/seeded-menu.js +69 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/settings.js +93 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/shortcuts-sheet.js +73 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/shortcuts.js +190 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/sidebar.js +289 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/signin.js +259 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/snippets.js +530 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/store-marks.js +47 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/stores.js +131 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/styles.css +971 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/toggletip.js +53 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/uuid.js +10 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/view.js +122 -0
- sendproof_core-0.1.0a1/src/sendproof_core/ui/views.css +653 -0
- sendproof_core-0.1.0a1/src/sendproof_core/workbench.py +310 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
.vs/
|
|
3
|
+
.idea/
|
|
4
|
+
**/bin/
|
|
5
|
+
# The Ruby binding's scripts (prepare, test, fixture) are source, not build output.
|
|
6
|
+
!adapters/ruby/bin/
|
|
7
|
+
**/obj/
|
|
8
|
+
**/node_modules/
|
|
9
|
+
artifacts/
|
|
10
|
+
TestResults/
|
|
11
|
+
*.user
|
|
12
|
+
*.db
|
|
13
|
+
*.db-shm
|
|
14
|
+
*.db-wal
|
|
15
|
+
*.nupkg
|
|
16
|
+
*.snupkg
|
|
17
|
+
__pycache__/
|
|
18
|
+
|
|
19
|
+
# Binding build output, local toolchains and dependency caches
|
|
20
|
+
**/target/
|
|
21
|
+
**/vendor/
|
|
22
|
+
**/.venv/
|
|
23
|
+
**/.gradle/
|
|
24
|
+
**/.gradle-home/
|
|
25
|
+
adapters/java/**/build/
|
|
26
|
+
adapters/java/build/
|
|
27
|
+
adapters/python/dist/
|
|
28
|
+
adapters/php/dist/
|
|
29
|
+
*.egg-info/
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.phpunit.cache/
|
|
32
|
+
|
|
33
|
+
# Demo cookie keys, kept beside the demo database
|
|
34
|
+
store-demo.keys/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sendproof contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sendproof-core
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Framework-neutral core of the Sendproof Python adapters: protocol, capture, trace store and embedded workbench UI.
|
|
5
|
+
Project-URL: Homepage, https://github.com/mprync/sendproof/tree/main/adapters/python/core
|
|
6
|
+
Project-URL: Repository, https://github.com/mprync/sendproof
|
|
7
|
+
Project-URL: Issues, https://github.com/mprync/sendproof/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/mprync/sendproof/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Sendproof contributors
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: api,api-testing,openapi,rollback,swagger,testing,workbench
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Provides-Extra: cassandra
|
|
27
|
+
Requires-Dist: cassandra-driver>=3.29; extra == 'cassandra'
|
|
28
|
+
Provides-Extra: cosmosdb
|
|
29
|
+
Requires-Dist: azure-cosmos<4.18,>=4.17; extra == 'cosmosdb'
|
|
30
|
+
Provides-Extra: dynamodb
|
|
31
|
+
Requires-Dist: boto3>=1.28; extra == 'dynamodb'
|
|
32
|
+
Provides-Extra: elasticsearch
|
|
33
|
+
Requires-Dist: elasticsearch<9,>=8; extra == 'elasticsearch'
|
|
34
|
+
Provides-Extra: firestore
|
|
35
|
+
Requires-Dist: google-cloud-firestore<2.35,>=2.34; extra == 'firestore'
|
|
36
|
+
Provides-Extra: mongodb
|
|
37
|
+
Requires-Dist: pymongo>=4.9; extra == 'mongodb'
|
|
38
|
+
Provides-Extra: opensearch
|
|
39
|
+
Requires-Dist: opensearch-py<3,>=2; extra == 'opensearch'
|
|
40
|
+
Provides-Extra: redis
|
|
41
|
+
Requires-Dist: redis>=5; extra == 'redis'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# sendproof-core
|
|
45
|
+
|
|
46
|
+
Framework-neutral core of the Sendproof Python adapters. Install a framework package such as
|
|
47
|
+
`sendproof-fastapi` rather than using this directly. Use it to:
|
|
48
|
+
|
|
49
|
+
- record effects from application code, and
|
|
50
|
+
- write an adapter for another framework or a data layer for another database library.
|
|
51
|
+
|
|
52
|
+
## Recording effects
|
|
53
|
+
|
|
54
|
+
Call these at the point where your application delivers an email, publishes a message or calls
|
|
55
|
+
another service. Each returns `True` when the request is a rollback preview and you must **skip**
|
|
56
|
+
the delivery. During an Observed Send they record the intent as `delivered: true` and return
|
|
57
|
+
`False`, so you still deliver.
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from sendproof_core import record_email
|
|
61
|
+
|
|
62
|
+
if not record_email("Welcome", sender, [to], [], "Welcome", "Hello!"):
|
|
63
|
+
mailer.send(...)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`record_http`, `record_job`, `record_message` and `record_effect` follow the conventional data
|
|
67
|
+
shapes in the protocol. Ordinary `logging` records from loggers that propagate to the root logger
|
|
68
|
+
are captured too (set the logger level to `INFO` or lower to see them).
|
|
69
|
+
|
|
70
|
+
## Data stores
|
|
71
|
+
|
|
72
|
+
`sendproof_core.stores` holds the write guard and the MongoDB, Redis, DynamoDB, Cassandra, Elasticsearch, OpenSearch, Cosmos DB and
|
|
73
|
+
Firestore hooks that the
|
|
74
|
+
framework packages accept as `data_stores`. Each hook imports its client library on first use, so
|
|
75
|
+
the core still needs none of them. See [Data stores in the Python binding](../data-stores.md).
|
|
76
|
+
|
|
77
|
+
## Capture limits
|
|
78
|
+
|
|
79
|
+
Logs 500, effects 100, changes 200, log properties 32, SQL parameters 64. Anything beyond a limit is
|
|
80
|
+
dropped and flagged with `logsTruncated`, `effectsTruncated` or `changesTruncated`. Unserializable
|
|
81
|
+
effect data is replaced by `null` and flagged. SQL parameters named like secrets show `[REDACTED]`,
|
|
82
|
+
and parameter values are hidden outside Development unless you opt in.
|
|
83
|
+
|
|
84
|
+
## Redaction
|
|
85
|
+
|
|
86
|
+
A name is secret when one of its words is `password`, `passwd`, `pwd`, `secret`, `token`, `hash`,
|
|
87
|
+
`salt`, `credential(s)` or `apikey`, when `key` follows `api`, `private`, `secret`, `access`,
|
|
88
|
+
`signing`, `encryption` or `client`, or when `key`, `data`, `id` or `token` follows `session`.
|
|
89
|
+
Secret-named SQL parameters, every value of a statement that names a secret (for example any
|
|
90
|
+
statement on Django's `django_session` table), and secret-named columns in change snapshots
|
|
91
|
+
(`key`, `before`, `after`) always show `[REDACTED]`. Records from the `sqlalchemy.engine` and
|
|
92
|
+
`django.db.backends` loggers are not captured, because they print bound values; the providers
|
|
93
|
+
record each statement themselves with redaction applied.
|
|
94
|
+
|
|
95
|
+
## Commit guard
|
|
96
|
+
|
|
97
|
+
While a preview runs, providers refuse SQL that would end its transaction (`COMMIT`, `END`,
|
|
98
|
+
`ROLLBACK` without `TO`, `SET autocommit`, the provider's own savepoint, and DDL that MySQL,
|
|
99
|
+
MariaDB and Oracle commit implicitly) and refuse switching the connection to autocommit. The
|
|
100
|
+
statement raises `PreviewRollbackError` before it reaches the database and the preview answers an
|
|
101
|
+
unconfirmed 500 (`sendproof_core.txguard`).
|
|
102
|
+
|
|
103
|
+
## Writing a data-layer provider
|
|
104
|
+
|
|
105
|
+
Subclass `PreviewProvider`. `begin(scope)` must be cheap and synchronous, store its state in
|
|
106
|
+
`scope.extensions`, and return a `PreviewSession` whose `rollback()` raises
|
|
107
|
+
`PreviewRollbackError` when it cannot confirm the rollback and whose `close()` releases everything,
|
|
108
|
+
partially acquired resources included. Raise `PreviewUnavailable` from `begin` when the
|
|
109
|
+
operation cannot be enrolled, for example when a connection autocommits. Never fabricate
|
|
110
|
+
before/after rows: report only what you observed.
|
|
111
|
+
|
|
112
|
+
## Writing a framework adapter
|
|
113
|
+
|
|
114
|
+
Use `Workbench` for discovery, assets, traces and envelopes, `protocol` for the request
|
|
115
|
+
rules, `Capture`/`RequestScope` for per-request state, and `TraceStore` for traces. The
|
|
116
|
+
[FastAPI adapter](../fastapi/src/sendproof_fastapi/middleware.py) is a complete example.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# sendproof-core
|
|
2
|
+
|
|
3
|
+
Framework-neutral core of the Sendproof Python adapters. Install a framework package such as
|
|
4
|
+
`sendproof-fastapi` rather than using this directly. Use it to:
|
|
5
|
+
|
|
6
|
+
- record effects from application code, and
|
|
7
|
+
- write an adapter for another framework or a data layer for another database library.
|
|
8
|
+
|
|
9
|
+
## Recording effects
|
|
10
|
+
|
|
11
|
+
Call these at the point where your application delivers an email, publishes a message or calls
|
|
12
|
+
another service. Each returns `True` when the request is a rollback preview and you must **skip**
|
|
13
|
+
the delivery. During an Observed Send they record the intent as `delivered: true` and return
|
|
14
|
+
`False`, so you still deliver.
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from sendproof_core import record_email
|
|
18
|
+
|
|
19
|
+
if not record_email("Welcome", sender, [to], [], "Welcome", "Hello!"):
|
|
20
|
+
mailer.send(...)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`record_http`, `record_job`, `record_message` and `record_effect` follow the conventional data
|
|
24
|
+
shapes in the protocol. Ordinary `logging` records from loggers that propagate to the root logger
|
|
25
|
+
are captured too (set the logger level to `INFO` or lower to see them).
|
|
26
|
+
|
|
27
|
+
## Data stores
|
|
28
|
+
|
|
29
|
+
`sendproof_core.stores` holds the write guard and the MongoDB, Redis, DynamoDB, Cassandra, Elasticsearch, OpenSearch, Cosmos DB and
|
|
30
|
+
Firestore hooks that the
|
|
31
|
+
framework packages accept as `data_stores`. Each hook imports its client library on first use, so
|
|
32
|
+
the core still needs none of them. See [Data stores in the Python binding](../data-stores.md).
|
|
33
|
+
|
|
34
|
+
## Capture limits
|
|
35
|
+
|
|
36
|
+
Logs 500, effects 100, changes 200, log properties 32, SQL parameters 64. Anything beyond a limit is
|
|
37
|
+
dropped and flagged with `logsTruncated`, `effectsTruncated` or `changesTruncated`. Unserializable
|
|
38
|
+
effect data is replaced by `null` and flagged. SQL parameters named like secrets show `[REDACTED]`,
|
|
39
|
+
and parameter values are hidden outside Development unless you opt in.
|
|
40
|
+
|
|
41
|
+
## Redaction
|
|
42
|
+
|
|
43
|
+
A name is secret when one of its words is `password`, `passwd`, `pwd`, `secret`, `token`, `hash`,
|
|
44
|
+
`salt`, `credential(s)` or `apikey`, when `key` follows `api`, `private`, `secret`, `access`,
|
|
45
|
+
`signing`, `encryption` or `client`, or when `key`, `data`, `id` or `token` follows `session`.
|
|
46
|
+
Secret-named SQL parameters, every value of a statement that names a secret (for example any
|
|
47
|
+
statement on Django's `django_session` table), and secret-named columns in change snapshots
|
|
48
|
+
(`key`, `before`, `after`) always show `[REDACTED]`. Records from the `sqlalchemy.engine` and
|
|
49
|
+
`django.db.backends` loggers are not captured, because they print bound values; the providers
|
|
50
|
+
record each statement themselves with redaction applied.
|
|
51
|
+
|
|
52
|
+
## Commit guard
|
|
53
|
+
|
|
54
|
+
While a preview runs, providers refuse SQL that would end its transaction (`COMMIT`, `END`,
|
|
55
|
+
`ROLLBACK` without `TO`, `SET autocommit`, the provider's own savepoint, and DDL that MySQL,
|
|
56
|
+
MariaDB and Oracle commit implicitly) and refuse switching the connection to autocommit. The
|
|
57
|
+
statement raises `PreviewRollbackError` before it reaches the database and the preview answers an
|
|
58
|
+
unconfirmed 500 (`sendproof_core.txguard`).
|
|
59
|
+
|
|
60
|
+
## Writing a data-layer provider
|
|
61
|
+
|
|
62
|
+
Subclass `PreviewProvider`. `begin(scope)` must be cheap and synchronous, store its state in
|
|
63
|
+
`scope.extensions`, and return a `PreviewSession` whose `rollback()` raises
|
|
64
|
+
`PreviewRollbackError` when it cannot confirm the rollback and whose `close()` releases everything,
|
|
65
|
+
partially acquired resources included. Raise `PreviewUnavailable` from `begin` when the
|
|
66
|
+
operation cannot be enrolled, for example when a connection autocommits. Never fabricate
|
|
67
|
+
before/after rows: report only what you observed.
|
|
68
|
+
|
|
69
|
+
## Writing a framework adapter
|
|
70
|
+
|
|
71
|
+
Use `Workbench` for discovery, assets, traces and envelopes, `protocol` for the request
|
|
72
|
+
rules, `Capture`/`RequestScope` for per-request state, and `TraceStore` for traces. The
|
|
73
|
+
[FastAPI adapter](../fastapi/src/sendproof_fastapi/middleware.py) is a complete example.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sendproof-core"
|
|
7
|
+
version = "0.1.0a1"
|
|
8
|
+
description = "Framework-neutral core of the Sendproof Python adapters: protocol, capture, trace store and embedded workbench UI."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Sendproof contributors" }]
|
|
14
|
+
keywords = ["swagger", "api-testing", "openapi", "testing", "api", "workbench", "rollback"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
+
"Topic :: Software Development :: Testing",
|
|
27
|
+
"Typing :: Typed",
|
|
28
|
+
]
|
|
29
|
+
dependencies = []
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
# Client libraries for the data-store hooks in sendproof_core.stores; the core imports each on first use.
|
|
33
|
+
redis = ["redis>=5"]
|
|
34
|
+
dynamodb = ["boto3>=1.28"]
|
|
35
|
+
mongodb = ["pymongo>=4.9"]
|
|
36
|
+
cassandra = ["cassandra-driver>=3.29"]
|
|
37
|
+
elasticsearch = ["elasticsearch>=8,<9"]
|
|
38
|
+
opensearch = ["opensearch-py>=2,<3"]
|
|
39
|
+
# The Cosmos DB and Firestore hooks reach into private internals, so each is pinned to the minor
|
|
40
|
+
# versions it was verified against (sendproof_core/stores/versions.py); registration refuses others.
|
|
41
|
+
cosmosdb = ["azure-cosmos>=4.17,<4.18"]
|
|
42
|
+
firestore = ["google-cloud-firestore>=2.34,<2.35"]
|
|
43
|
+
|
|
44
|
+
[tool.hatch.build.targets.wheel]
|
|
45
|
+
packages = ["src/sendproof_core"]
|
|
46
|
+
# The UI bundle is generated from the shared packer and is not tracked by git.
|
|
47
|
+
artifacts = ["src/sendproof_core/ui/**"]
|
|
48
|
+
|
|
49
|
+
[tool.hatch.build.targets.sdist]
|
|
50
|
+
include = ["src/sendproof_core", "README.md", "LICENSE"]
|
|
51
|
+
artifacts = ["src/sendproof_core/ui/**"]
|
|
52
|
+
|
|
53
|
+
[project.urls]
|
|
54
|
+
Homepage = "https://github.com/mprync/sendproof/tree/main/adapters/python/core"
|
|
55
|
+
Repository = "https://github.com/mprync/sendproof"
|
|
56
|
+
Issues = "https://github.com/mprync/sendproof/issues"
|
|
57
|
+
Changelog = "https://github.com/mprync/sendproof/blob/main/CHANGELOG.md"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""Framework-neutral core of the Sendproof Python adapters.
|
|
2
|
+
|
|
3
|
+
Applications normally import the framework package (``sendproof_fastapi``) and use this
|
|
4
|
+
module for the effect recording helpers::
|
|
5
|
+
|
|
6
|
+
from sendproof_core import record_email
|
|
7
|
+
|
|
8
|
+
if not record_email("Welcome", sender, [to], [], "Hello", "Welcome aboard"):
|
|
9
|
+
send_mail(...)
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from .effects import (
|
|
13
|
+
is_previewing,
|
|
14
|
+
record_effect,
|
|
15
|
+
record_email,
|
|
16
|
+
record_http,
|
|
17
|
+
record_job,
|
|
18
|
+
record_log,
|
|
19
|
+
record_message,
|
|
20
|
+
)
|
|
21
|
+
from .identity import Identity
|
|
22
|
+
from .options import AuthProvider, BenchOptions, OpenApiDocument
|
|
23
|
+
from .provider import (
|
|
24
|
+
PreviewChange,
|
|
25
|
+
PreviewObservation,
|
|
26
|
+
PreviewProvider,
|
|
27
|
+
PreviewRollbackError,
|
|
28
|
+
PreviewSession,
|
|
29
|
+
PreviewUnavailable,
|
|
30
|
+
)
|
|
31
|
+
from .scope import RequestScope, current_scope, detached
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
"detached",
|
|
35
|
+
"AuthProvider",
|
|
36
|
+
"BenchOptions",
|
|
37
|
+
"Identity",
|
|
38
|
+
"OpenApiDocument",
|
|
39
|
+
"PreviewChange",
|
|
40
|
+
"PreviewObservation",
|
|
41
|
+
"PreviewProvider",
|
|
42
|
+
"PreviewRollbackError",
|
|
43
|
+
"PreviewSession",
|
|
44
|
+
"PreviewUnavailable",
|
|
45
|
+
"RequestScope",
|
|
46
|
+
"current_scope",
|
|
47
|
+
"is_previewing",
|
|
48
|
+
"record_effect",
|
|
49
|
+
"record_email",
|
|
50
|
+
"record_http",
|
|
51
|
+
"record_job",
|
|
52
|
+
"record_log",
|
|
53
|
+
"record_message",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
__version__ = "0.1.0a1"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""The embedded workbench UI.
|
|
2
|
+
|
|
3
|
+
The files come from the shared packer (``node tools/pack-ui.mjs``). It writes a
|
|
4
|
+
``manifest.json`` with a SHA-256 for every file. This module serves only files listed there and
|
|
5
|
+
verifies each digest before first use, so an incomplete or edited bundle is never served.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import hashlib
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
from dataclasses import dataclass
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class Asset:
|
|
19
|
+
"""A verified file and its media type."""
|
|
20
|
+
|
|
21
|
+
content: bytes
|
|
22
|
+
content_type: str
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UiBundleError(RuntimeError):
|
|
26
|
+
"""The UI bundle is missing or fails verification."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class UiAssets:
|
|
30
|
+
"""Lazy, verified access to a packed UI directory."""
|
|
31
|
+
|
|
32
|
+
def __init__(self, directory: str | os.PathLike[str] | None = None) -> None:
|
|
33
|
+
configured = directory or os.environ.get("SENDPROOF_UI_DIR")
|
|
34
|
+
self._directory = Path(configured) if configured else Path(__file__).parent / "ui"
|
|
35
|
+
self._manifest: dict | None = None
|
|
36
|
+
self._cache: dict[str, Asset] = {}
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def version(self) -> str:
|
|
40
|
+
"""The bundle version recorded in the manifest."""
|
|
41
|
+
return str(self._load()["version"])
|
|
42
|
+
|
|
43
|
+
def get(self, path: str) -> Asset | None:
|
|
44
|
+
"""Return the asset at a manifest-relative path or ``None`` if it is not part of the bundle."""
|
|
45
|
+
files = self._load()["files"]
|
|
46
|
+
entry = files.get(path)
|
|
47
|
+
if entry is None:
|
|
48
|
+
return None
|
|
49
|
+
cached = self._cache.get(path)
|
|
50
|
+
if cached is not None:
|
|
51
|
+
return cached
|
|
52
|
+
content = (self._directory / path).read_bytes()
|
|
53
|
+
if hashlib.sha256(content).hexdigest() != entry["sha256"] or len(content) != entry["bytes"]:
|
|
54
|
+
raise UiBundleError(f"UI asset '{path}' does not match its manifest digest.")
|
|
55
|
+
asset = Asset(content, entry["contentType"])
|
|
56
|
+
self._cache[path] = asset
|
|
57
|
+
return asset
|
|
58
|
+
|
|
59
|
+
def _load(self) -> dict:
|
|
60
|
+
if self._manifest is None:
|
|
61
|
+
manifest = self._directory / "manifest.json"
|
|
62
|
+
if not manifest.is_file():
|
|
63
|
+
raise UiBundleError(
|
|
64
|
+
"The Sendproof UI bundle is not embedded. Run adapters/python/scripts/embed_ui.py "
|
|
65
|
+
"or set SENDPROOF_UI_DIR to a directory produced by tools/pack-ui.mjs."
|
|
66
|
+
)
|
|
67
|
+
data = json.loads(manifest.read_text("utf-8"))
|
|
68
|
+
if not isinstance(data.get("files"), dict) or "version" not in data:
|
|
69
|
+
raise UiBundleError("The UI manifest is malformed.")
|
|
70
|
+
self._manifest = data
|
|
71
|
+
return self._manifest
|