amoorion.api.base¶
API: POST /methods/<name> with the method’s params as the body,
POST /hooks/<name> for incoming webhooks (kept in the inbox), GET / for
what is there.
Method calls need Authorization: Bearer <api/token from the vault>; without
that secret in the vault every method call is refused. Hooks verify
themselves (see amoorion.hooks).
Functions
|
The FastAPI application: one route per method, the hooks, and a token check. |
|
Run the API until stopped: |
- amoorion.api.base.create_app(vault=None, inbox=None, dataset=None)[source]¶
The FastAPI application: one route per method, the hooks, and a token check.
Routes are made from
METHODS, so a new method needs nothing here. Whatever isn’t passed comes from the environment: the vault of.envand the default inbox.