Skip to main content

Crate puerto_core

Crate puerto_core 

Source
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 the Authenticator’s business. The adapters are puerto-auth’s and puerto-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
Mail (ADR-0020): the message a project sends and the ports that send it. A project’s {Mail}Mailer port takes its own typed data; its implementation renders the templates into an Email and hands it to a Mailer. The SMTP adapter is puerto-mail’s, the sent log puerto-sqlx’s.
pagination
repository_error