Documentation
¶
Overview ¶
Package ingest accepts inbound webhooks.
Rule: nothing about a payload's content may cause a rejection. A malformed body, an unknown provider and an unmapped event type are all recorded.
Index ¶
Constants ¶
View Source
const DefaultMaxBodyBytes int64 = 1 << 20
A resource limit, not content validation: a body that cannot be held cannot be recorded, and 413 is the only honest answer.
View Source
const DefaultTenant = "default"
DefaultTenant is the tenant an address without one belongs to, so a single tenant deployment needs no slug in its webhook URLs.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MaxBodyBytes int64
Verification Verification
Logger *slog.Logger
}
type Store ¶
type Store interface {
// Record returns the identifier the event was recorded under, which the
// database makes: nothing can know it before the row exists.
Record(ctx context.Context, req inbound.Request) (uuid.UUID, error)
// Tenant reports the tenant of a slug, and whether there is one. An
// address for a tenant that does not exist and a database that cannot
// answer are different failures and get different answers.
Tenant(ctx context.Context, slug string) (uuid.UUID, bool, error)
}
Store is what accepting a request needs: somewhere to record it and a way to resolve the tenant it was addressed to.
Click to show internal directories.
Click to hide internal directories.