Per-app end-user table for the v1.1.8 users::* SDK. Distinct from admin_users (control-plane operators) — same Argon2id password hash shape but everything else (uniqueness scope, ownership, lifecycle) independent. - Uniqueness on (app_id, lower(email)) — case-insensitive within an app; same email may exist across two apps. - AppUserRepository trait + Postgres impl; every method takes app_id explicitly so cross-app reads are unmistakable at the call site (matches v1.1.3 cross-app discipline). - Public AppUserRow never includes the password hash; the credentials shape is its own struct returned only by the login lookup. - Cursor-based list keyed on (created_at, id). - Reserved a timing-flat dummy Argon2id PHC constant in auth.rs for the upcoming login path so the bad-email and good-email branches share wall-clock cost. - Added AppUserId + InvitationId id types in shared::ids. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
84 lines
3.0 KiB
Rust
84 lines
3.0 KiB
Rust
//! Cross-cutting types used by every PiCloud crate.
|
|
//!
|
|
//! Keep this crate small. If something only one core needs, it belongs in
|
|
//! that core's crate. Things here must be genuinely shared (IDs, the Script
|
|
//! entity, error roots, transport DTOs).
|
|
|
|
pub mod app;
|
|
pub mod auth;
|
|
pub mod crypto;
|
|
pub mod dead_letters;
|
|
pub mod docs;
|
|
pub mod email;
|
|
pub mod error;
|
|
pub mod events;
|
|
pub mod exec_summary;
|
|
pub mod execution_log;
|
|
pub mod files;
|
|
pub mod http;
|
|
pub mod ids;
|
|
pub mod inbox;
|
|
pub mod kv;
|
|
pub mod log_sink;
|
|
pub mod modules;
|
|
pub mod outbox_writer;
|
|
pub mod pubsub;
|
|
pub mod realtime;
|
|
pub mod realtime_authority;
|
|
pub mod route;
|
|
pub mod sandbox;
|
|
pub mod script;
|
|
pub mod sdk_cx;
|
|
pub mod secrets;
|
|
pub mod services;
|
|
pub mod subscriber_token;
|
|
pub mod trigger_event;
|
|
pub mod validator;
|
|
pub mod version;
|
|
|
|
pub use app::{App, AppDomain, DomainShape};
|
|
pub use auth::{AppRole, InstanceRole, Principal, Scope, UserId};
|
|
pub use crypto::{decrypt, encrypt, CryptoError, EncryptResult, MasterKey, MasterKeyError};
|
|
pub use dead_letters::{DeadLetterError, DeadLetterId, DeadLetterService, NoopDeadLetterService};
|
|
pub use docs::{DocId, DocRow, DocsError, DocsListPage, DocsService, NoopDocsService};
|
|
pub use email::{EmailError, EmailService, NoopEmailService, OutboundEmail};
|
|
pub use error::Error;
|
|
pub use events::{EmitError, NoopEventEmitter, ServiceEvent, ServiceEventEmitter};
|
|
pub use exec_summary::ExecResponseSummary;
|
|
pub use execution_log::{ExecutionLog, ExecutionStatus};
|
|
pub use files::{
|
|
validate_collection as validate_files_collection, FileMeta, FileUpdate, FilesError,
|
|
FilesListPage, FilesService, NewFile, NoopFilesService,
|
|
};
|
|
pub use http::{HttpError, HttpRequest, HttpResponse, HttpService, NoopHttpService};
|
|
pub use ids::{
|
|
AdminUserId, ApiKeyId, AppId, AppUserId, ExecutionId, InvitationId, RequestId, ScriptId,
|
|
TriggerId,
|
|
};
|
|
pub use inbox::{
|
|
InboxDeliveryOutcome, InboxFailureKind, InboxResolver, InboxResult, NoopInboxResolver,
|
|
};
|
|
pub use kv::{KvError, KvListPage, KvService, NoopKvService};
|
|
pub use log_sink::{ExecutionLogSink, LogSinkError};
|
|
pub use modules::{ModuleScript, ModuleSource, ModuleSourceError, NoopModuleSource};
|
|
pub use outbox_writer::{HttpDispatchPayload, NewHttpOutbox, OutboxWriter, OutboxWriterError};
|
|
pub use pubsub::{
|
|
topic_matches, validate_topic_pattern, NoopPubsubService, PubsubError, PubsubService,
|
|
};
|
|
pub use realtime::{BroadcasterError, NoopRealtimeBroadcaster, RealtimeBroadcaster, RealtimeEvent};
|
|
pub use realtime_authority::{DenyAllRealtimeAuthority, RealtimeAuthority, SubscribeDenied};
|
|
pub use route::{DispatchMode, HostKind, PathKind, Route};
|
|
pub use sandbox::ScriptSandbox;
|
|
pub use script::{Script, ScriptKind};
|
|
pub use sdk_cx::SdkCallCx;
|
|
pub use secrets::{
|
|
validate_secret_name, NoopSecretsService, SecretsError, SecretsListPage, SecretsService,
|
|
SECRET_NAME_MAX_BYTES,
|
|
};
|
|
pub use services::Services;
|
|
pub use trigger_event::{
|
|
DeadLetterEventDetail, DocsEventOp, FilesEventOp, KvEventOp, TriggerEvent,
|
|
};
|
|
pub use validator::{ScriptValidator, ValidatedScript, ValidationError};
|
|
pub use version::{API_VERSION, PRODUCT_VERSION, SDK_VERSION, WIRE_VERSION};
|