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

create_app([vault, inbox, dataset])

The FastAPI application: one route per method, the hooks, and a token check.

serve(args)

Run the API until stopped: amoorion api.

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 .env and the default inbox.

Parameters:
Return type:

FastAPI

amoorion.api.base.serve(args)[source]

Run the API until stopped: amoorion api.

Parameters:

args (Namespace)

Return type:

None