Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

9 downloads

Install on DigitalOcean Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Daniel Quellhorst Changelog for this batch. 65ef78d 3 hours, 49 minutes ago History
exchange_profile.py · 1.2 KB · 26 lines
1"""site_exchange_profile -- this box's public exchange profile.
2
3Served by the core route GET /.well-known/dbbasic (object_server), which
4runs this object when it is installed and answers 404 when it is not. The
5profile is what a partner fetches before it trusts us: our domain, company
6name, exchange endpoint, the public keys (active and retired, with their key
7ids and the vouches that chain a rotation), the document types we accept and
8the DRON document version, signed by the active key. Public by design (a
9rule grants execute to everyone); it carries no secret. A box with no
10identity yet answers 404; one whose private key is missing answers 409
11naming what to do, rather than publishing a profile it cannot sign.
12"""
13
14import object_exchange
15import object_exchange_box as box
16
17
18def GET(request):
19 try:
20 return box.profile(box.base_dir())
21 except box.Refusal as refusal:
22 answer = refusal.answer()
23 return {"status": 404 if refusal.code == "not_configured" else answer["status"],
24 "error": answer["error"], "code": answer["code"]}
25 except object_exchange.ExchangeUnavailable as exc:
26 return {"status": 409, "code": "exchange_unavailable", "error": str(exc)}