`/mcp` — `email_send`, `slack_post`, `delegate` — authenticated with `authenticate`, which accepts only `full`. Nothing hands it a token today, so this cost nothing yet; the moment something did, the only credential that worked would have been an owner's session, held by an agent runtime. `SCOPE_AGENT_DOOR` is that credential's narrow form. `full` still works, so the UI and every human caller are unaffected, and the route now names what it accepts rather than accepting everything by default. The test that matters is not that each scope opens its own route: it is that holding one grants nothing the other has. Both tokens live where an agent can read them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
20 lines
625 B
Rust
20 lines
625 B
Rust
//! Authentication for Clawmates (spec §16: SSO + RBAC).
|
|
//!
|
|
//! `local` mode: argon2id password hashes and opaque bearer tokens whose
|
|
//! SHA-256 hashes are stored in `auth_sessions`. This is the zero-dependency
|
|
//! appliance mode for air-gapped installs; OIDC SSO shares the same session
|
|
//! storage and `AuthedUser` output.
|
|
|
|
mod bootstrap;
|
|
mod jwt;
|
|
mod service;
|
|
mod token;
|
|
|
|
pub use bootstrap::bootstrap_owner;
|
|
pub use jwt::{ExternalClaims, JwtError, JwtVerifier};
|
|
pub use service::{
|
|
AuthError, AuthService, AuthedUser, SCOPE_AGENT_DOOR, SCOPE_FULL, SCOPE_SKILLS_READ,
|
|
SESSION_TTL,
|
|
};
|
|
pub use token::SessionToken;
|