Documentation
¶
Overview ¶
Package outboxtypes holds the NEUTRAL writer-tx outbox payload value types shared across the Clean-Architecture boundary between the use-case layer (internal/service, which defines the emitter ports) and the CQRS Repository port aggregator (internal/repo/kaname, whose Writer surface also emits them).
Why a dedicated leaf package: internal/repo/kaname/iface.go (the Repository/Reader/Writer ports) exposes EmitAuditEvent / EmitFGARelationWrite / EmitFGARelationDelete in terms of these payloads. If the payloads lived in internal/service (the use-case layer), the repo-ports package would import the use-case package it is a dependency OF — an inverted layer edge that is "one refactor away from an import cycle" (repo/kaname → service → repo/kaname). Hoisting the payloads into this stdlib-only leaf package lets BOTH sides reference a neutral type without either importing the other.
This package imports ONLY the standard library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEvent ¶
type AuditEvent struct {
// EventType — canonical `iam.<resource>.<action>` taxonomy value.
EventType string
// TenantAccountID — Account scope for per-account audit queries; "" → NULL.
TenantAccountID string
// Payload — the event_payload jsonb body (the use-case decides key names —
// actor / subject_id / reason / token_jti / …).
Payload map[string]any
}
AuditEvent — payload for a durable kaname.audit_outbox compliance row. The repo adapter generates the id (evt_<22-char>), marshals Payload to the event_payload jsonb, and inserts it with status='pending'. EventType must satisfy the audit_outbox_event_type CHECK (`^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$`).
Payload carries the compliance dimensions (actor / subject / resource / key domain fields). It MUST NOT contain secret material (no tokens, no key PEM, no client_secret) — see acceptance 5.2-36.
type InviteMailIntent ¶ added in v0.5.0
type InviteMailIntent struct {
// UserID — строка приглашения; ключ партиции порядка очереди.
UserID string
// AccountID — аккаунт, куда приглашён человек (атрибуция письма).
AccountID string
// To — адрес получателя.
To string
// LoginURL — адрес страницы входа; пусто ⇒ подставит отправитель из
// своей настройки.
LoginURL string
// Limit — ограничение частоты на адрес.
Limit InviteMailRateLimit
}
InviteMailIntent — намерение отправить письмо приглашения, ставящееся в очередь `kaname.invite_mail_outbox` ТОЙ ЖЕ транзакцией, что и мутация, его породившая. Несёт ограничение частоты: писатель списывает окно адресата ПЕРЕД постановкой в очередь, и сверхнормативное намерение в очередь не попадает — это и есть единственный путь письма, и ограничитель стоит на нём по построению, а не по дисциплине вызывающего.
type InviteMailRateLimit ¶ added in v0.5.0
InviteMailRateLimit — ограничение частоты писем НА АДРЕС за окно (приёмка ID-MAIL-1, Р14/Р22, MAIL-25): не больше MaxPerWindow писем одному адресу за Window. Обе величины положительны; значения, означающего «без ограничения», у ограничения нет — писатель отвергает непозитивные, а не читает их как «сколько угодно».
type RelationTuple ¶
RelationTuple — {User, Relation, Object} triple for kaname.fga_outbox grant/revoke writes.