aauth-person-server
An AAuth Person Server (draft-hardt-oauth-aauth-protocol-11, three-party) you can run instead of building one. It speaks for your people when agents want to act for them:
- it verifies each agent by its HTTP Message Signature and agent token, from agent providers you trust;
- it puts each mission an agent proposes to whoever decides for the person, then issues person tokens and auth tokens under it;
- it weighs each auth token request against the mission's budget: what fits is issued at once and spent, and what does not goes back to the approver;
- it turns whatever needs a human into an approval, which you deliver however you reach people.
It is a Rust port of @introspection-sdk/person-server; an agent cannot tell the two apart.
use ;
let ps = new?;
// Any framework: hand it an http::Request<Bytes>, get an http::Response<Bytes>.
let response = ps.handle.await;
// When the approver answers, under the tenant it was asked under:
ps.decide.await?;
You implement Directory, which says who you speak for and who decides for them. Hooks is optional and reports approvals, decisions and issued tokens. The default Store is in memory; for more than one process or a restart, put a database behind it. Every Store call is scoped by the AAuth tenant the agent names, or by the server's default tenant when it names none ("default" unless Config::default_tenant sets another; Config::require_tenant refuses such a request), so one Person Server can serve many organisations. To run it on hyper, see examples/server.rs. Each flag defaults to an environment variable (--help lists them); the signing key, subject secret and admin token come from the environment only (PS_SIGNING_KEY, PS_SUBJECT_SECRET, PS_ADMIN_TOKEN), since anything on the host can read a process's arguments:
PS_ADMIN_TOKEN=secret
The crate documentation covers the fixed policy, the routes, and what to put in front of it in production.
License
Apache-2.0