Expand description
§systemprompt-users
User management for the systemprompt.io AI governance platform. The crate provides:
- 6-tier RBAC — typed
UserRoleand policy-aware promotion/demotion helpers inUserAdminService. - Sessions — lifecycle management for browser, API, and anonymous sessions including bulk-end and recent-activity queries.
- API keys — issuance, hashing, and verification via
ApiKeyService. - Device certificates — enrollment and rotation via
DeviceCertService. - IP bans — typed
BannedIpRepositorywith metadata-aware queries. - Rate-limit buckets —
UserRateLimitBucketRepository, the replica-shared counters behind the global per-user HTTP throttle. - Cleanup job — purges anonymous users past the retention window.
§Feature flags
| Feature | Default | Effect |
|---|---|---|
| none | n/a | The crate exposes a single feature surface; all modules are compiled unconditionally. The [package.metadata.docs.rs] all-features = true setting is retained so future feature additions automatically appear in published docs. |
§Layering
systemprompt-users is a domain crate. It depends downward on
systemprompt-database, systemprompt-extension, systemprompt-models,
systemprompt-traits, systemprompt-provider-contracts, and
systemprompt-identifiers.
Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.
Re-exports§
pub use error::Result;pub use error::UserError;pub use error::UserResult;
Modules§
Structs§
- ApiKey
Limits - The limits an API key carries: an optional model allowlist, and a spend
budget and request ceiling counted over
request_window_seconds. - ApiKey
Service - Archive
Outcome - The credentials an archive revoked.
- Archive
Params - Who archives a user, why, and whether the archive is under legal hold.
- Archive
State - A user’s archive fields.
archived_atisNonefor a row deleted before archiving existed, which is restorable but never purged automatically. - BanIp
Params - BanIp
With Metadata Params - Banned
Ip - Banned
IpRepository - Create
ApiKey Params - Device
Cert Service - Enroll
Device Cert Params - Enroll
Device Cert Service Params - Issue
ApiKey Params - Merge
Result - NewApi
Key - Purge
Count - How many rows one purge table holds for a user.
- Session
Repository - Update
User Params - User
- User
Activity - User
Admin Service - User
ApiKey - User
Count Breakdown - User
Device Cert - User
Export - User
Rate Limit Bucket Repository - User
Repository - User
Service - User
Session - User
Stats - User
With Sessions - Users
AiSession Provider - Users
Extension - Users
Role Directory