askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
exchange.py · 738 bytes · 17 lines
| 1 | """webhook_exchange -- the exchange endpoint: a partner's box delivers here. |
| 2 | |
| 3 | POST /webhooks/exchange, the core raw-body route: the exact bytes that |
| 4 | arrived are what object_exchange_box.inbound verifies and, once every check |
| 5 | passes, stores verbatim in exchange_inbox. Unauthenticated by nature (the |
| 6 | caller is another company's server, not a user), so authenticity is the |
| 7 | signatures against keys pinned for a connected partner; a public execute |
| 8 | rule lets the request reach this object and nothing else. The answer is the |
| 9 | signed receipt, or a refusal with a stable code; nothing from the request is |
| 10 | reflected back. |
| 11 | """ |
| 12 | |
| 13 | import object_exchange_box as box |
| 14 | |
| 15 | |
| 16 | def POST(request): |
| 17 | return box.inbound(box.base_dir(), request.get("_raw_body")) |