Expand description
Puerto’s runtime core: the domain types every project generated by Puerto shares, whatever its entities and adapters — paged lists, the repository error, domain events with the ports their transports implement, and the mail ports, and the auth port.
No driver, no runtime, no I/O: a project’s domain layer depends on it (ADR-0017, ADR-0018).
Re-exports§
pub use auth::AuthError;pub use auth::Authenticator;pub use auth::Principal;pub use events::DecodeError;pub use events::DomainEvent;pub use events::EventEnvelope;pub use events::EventHandler;pub use events::HandlerOutcome;pub use pagination::DEFAULT_PAGE_LIMIT;pub use pagination::MAX_PAGE_LIMIT;pub use pagination::Page;pub use pagination::PageRequest;pub use repository_error::RepositoryError;
Modules§
- auth
- Auth (ADR-0021): who is calling and the port that says so. A route sees a
Principal, never a token; where the token was checked — an OIDC provider, a local session — is theAuthenticator’s business. The adapters arepuerto-auth’s andpuerto-sqlx’s, the HTTP side (BearerAuth,#[require_role])puerto-web’s. - events
- Domain events (ADR-0018): what a write records in the outbox, and the transport-neutral parts every transport shares — the envelope, the handler a consumer implements, the delivery policy and the ports the worker drives.
- Mail (ADR-0020): the message a project sends and the ports that send it. A project’s
{Mail}Mailerport takes its own typed data; its implementation renders the templates into anEmailand hands it to aMailer. The SMTP adapter ispuerto-mail’s, the sent logpuerto-sqlx’s. - pagination
- repository_
error