Skip to main content

Crate systemprompt_users

Crate systemprompt_users 

Source
Expand description

§systemprompt-users

User management for the systemprompt.io AI governance platform. The crate provides:

  • 6-tier RBAC — typed UserRole and policy-aware promotion/demotion helpers in UserAdminService.
  • 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 BannedIpRepository with 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

FeatureDefaultEffect
nonen/aThe 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§

error
Typed error surface for the users crate.
jobs
Background jobs for the users domain.

Structs§

ApiKeyLimits
The limits an API key carries: an optional model allowlist, and a spend budget and request ceiling counted over request_window_seconds.
ApiKeyService
BanIpParams
BanIpWithMetadataParams
BannedIp
BannedIpRepository
CreateApiKeyParams
DeviceCertService
EnrollDeviceCertParams
EnrollDeviceCertServiceParams
IssueApiKeyParams
MergeResult
NewApiKey
PurgeCount
How many rows one purge table holds for a user.
SessionRepository
UpdateUserParams
User
UserActivity
UserAdminService
UserApiKey
UserCountBreakdown
UserDeviceCert
UserExport
UserRateLimitBucketRepository
UserRepository
UserService
UserSession
UserStats
UserWithSessions
UsersAiSessionProvider
UsersExtension
UsersRoleDirectory

Enums§

BanDuration
DemoteResult
PromoteResult
UserRole
UserStatus

Constants§

API_KEY_PREFIX
DEVICE_FINGERPRINT_FOREIGN_USER
MERGE_EXCLUDED_SECURITY_TABLES

Traits§

RoleProvider
UserProvider

Functions§

normalise_email