wowapi

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0

README

wowapi

CI

A domain-neutral, reusable enterprise backend framework ("platform kernel") in Go.

wowapi is a modular-monolith framework you consume as a versioned Go dependency (github.com/qatoolist/wowapi). It gives a product team a production-grade spine — multi-tenant PostgreSQL with row-level security, deny-by-default authorization, a transactional outbox, a job runner and scheduler, HTTP primitives, configuration, observability, and a set of compliance/evidence primitives — behind a small module SDK. Product domains (a housing society, a school, a clinic…) plug in their resources, permissions, routes, workflows, events, jobs, seeds, and migrations without touching kernel code.

Status: pre-1.0 (v0.1.0). The public surface (kernel / module / app / adapters / testkit / migrations + cmd/wowapi) may still make breaking changes between minor versions. See Versioning.


Table of contents


What it is & what problem it solves

Enterprise backends repeatedly re-implement the same unglamorous, easy-to-get-wrong plumbing: tenant isolation, authorization, audit, idempotency, background jobs, outbox/eventing, config, migrations, and the tests that prove they're safe. Getting any of these subtly wrong is a security or data-integrity incident.

wowapi implements that plumbing once, domain-neutrally, with the safe defaults baked in (deny-by-default authz, forced RLS, fail-closed tenancy, append-only audit, transactional outbox), and exposes it through a small SDK so product teams write only their domain logic. The kernel carries no product concepts; a product is a separate repo that depends on the framework and registers modules.

The reference domain used while designing it was a housing-society product, but nothing society-specific lives in the core — it is a general enterprise backend kernel.

Who should use it

  • Product teams building a multi-tenant, PostgreSQL-backed enterprise backend in Go who want a vetted, secure spine instead of hand-rolling tenancy/authz/audit/jobs.
  • Teams that value safe-by-default security and compliance-grade evidence (audit trails, gap-free numbering, retention/legal-hold, immutable artifacts) out of the box.
  • Engineers comfortable with Go, PostgreSQL, and a modular-monolith deployment (one api + worker + migrate binary set per product, one database).

It is not a micro-framework, an ORM, or a frontend framework, and it is not (yet) a stable 1.0 API.

Highlights

Everything below is implemented and tested in this repo (see the User Guide for depth):

  • Multi-tenant PostgreSQL with Row-Level Security — the runtime connects as a non-superuser role, RLS is FORCEd, and app_tenant_id() is fail-closed. Cross-tenant work runs under a separate platform role.
  • Deny-by-default authorization — RBAC (scope-covering role assignments) → ReBAC (relationships) → ABAC (deny-first policies), plus machine-principal scopes, step-up/MFA hooks, and an opt-in decision cache. Enforced per request at the route gate.
  • Module SDK — register resources, permissions, routes, seeds, migrations, jobs, event handlers, workflows, and more through a capability-scoped module.Context. Inter-module access via declared ports.
  • Async platform — transactional outbox (event iff business commit) + relay, at-least-once job runner with retries/backoff/DLQ, and a leader-safe fixed-interval scheduler.
  • Compliance/evidence primitives — durable field-level audit with hash-chaining, gap-free per-tenant sequence allocator, generalized legal hold + DSR (export/erasure) engine, bulk-operation framework, and immutable versioned artifacts.
  • HTTP primitives — router with route metadata, RFC 9457 problem details, idempotency, ETag, keyset pagination, an injection-proof filter/sort DSL, and a fixed security-middleware chain.
  • Config, observability, ops — layered config with secretref:// secrets + fingerprint drift, Prometheus metrics + OpenTelemetry tracing adapters, rate limiting, and a container-first local stack.
  • A real regression gatemake ci + make ci-container (DB/integration tests forced to run), a migration reversibility drill, boundary lint, fuzz targets, and perf budgets.

Architecture at a glance

A modular monolith. Hexagonal boundaries only at the edges (HTTP, DB, object storage, providers). One database per product; tenant isolation via tenant_id + RLS, applied with SET LOCAL app.tenant_id per transaction.

                         ┌──────────────────────────────────────────────┐
   HTTP request ───────▶ │  api (thin main over wowapi/app)             │
                         │   httpx chain: RequestID → Recover → Trace →  │
                         │   metrics → SecureHeaders → CORS → BodyLimit →│
                         │   Timeout → [AuthN → tenant → AuthZ gate] →   │
                         │   module handler                              │
                         └───────────────┬──────────────────────────────┘
                                         │ module.Context (capability-scoped)
        ┌────────────────────────────────┼────────────────────────────────┐
        ▼                                 ▼                                 ▼
  ┌───────────┐                   ┌───────────────┐                 ┌──────────────┐
  │  modules  │  register into →  │  kernel        │  services      │  adapters    │
  │ (product) │                   │  authz, outbox,│                │ prometheus,  │
  │           │                   │  jobs, audit,  │                │ otel,        │
  │           │                   │  retention,…   │                │ secrets,…    │
  └───────────┘                   └──────┬────────┘                 └──────────────┘
                                         │ TxManager (SET LOCAL role + app.tenant_id)
                                         ▼
                                ┌──────────────────┐   worker (relay + job runner + scheduler)
                                │  PostgreSQL + RLS │◀──  migrate (goose migrations)
                                └──────────────────┘

Import law (enforced by make lint-boundaries): kernelmodule/app ← product modules; adapters depend on kernel ports; modules reach the kernel only through module.Context. Full explanation: Concepts & Architecture.

Repository layout

This is the framework repo. (A product repo scaffolded by wowapi init looks different — see Getting Started.)

Path What it is
kernel/ The platform services (authz, database, httpx, outbox, jobs, audit, retention, sequence, bulk, artifact, config, observability, …). Public API.
module/ The product-facing SDK contract: module.Module + module.Context. Public API.
app/ The composition root: kernel.New + App.Boot + StartWorker. Public API.
adapters/ Vendor bindings behind kernel ports (metrics/prometheus, tracing/otel, secrets/*).
testkit/ Public test harness: isolated per-test DBs, fixtures, RunModuleContract.
migrations/ Embedded goose SQL migrations (00001…), kernel-owned.
internal/ CLI (internal/cli), the wowapi command wiring, neutral fixture modules, tools.
cmd/wowapi/ The wowapi CLI entry point.
deployments/ compose.yaml (local stack) + reference/ (nginx + smoke).
docs/ blueprint (design), user-guide, operations, implementation (decisions/evidence), working (contributor standards).
Makefile Developer + CI targets (see Command reference).

Prerequisites

  • Go 1.26+ (go version). The module targets go 1.26.
  • Docker + Docker Compose — for the local stack (PostgreSQL, MinIO, Mailpit, Jaeger) and the authoritative container gate. make up / make ci-container need it.
  • PostgreSQL 16 — provided by the compose stack; a local psql client is optional (make db-shell).
  • Optional: golangci-lint (installed by make tools; falls back to go vet if absent).

Quick start A — build a product on wowapi

You consume wowapi from a separate product repository. The wowapi CLI scaffolds it.

1. Get the wowapi CLI. Either install a published version:

go install github.com/qatoolist/wowapi/cmd/wowapi@latest   # or @vX.Y.Z once tagged

…or build it from a clone of this repo (works even if no version is published yet):

git clone https://github.com/qatoolist/wowapi && cd wowapi
go build -o bin/wowapi ./cmd/wowapi     # then use ./bin/wowapi

2. Scaffold a product repo:

wowapi init myapp --module github.com/acme/myapp   # creates ./myapp/ and scaffolds inside it
cd myapp
# scaffolds: go.mod, Makefile, cmd/{api,worker,migrate}, configs/{base,local}.yaml,
#            internal/{wire,appcfg}, tools/configcheck, README.md, .gitignore
go mod tidy

3. Start a database and set the env vars the local overlay expects (configs/local.yaml references secretref://env/DATABASE_URL, secretref://env/MIGRATE_URL, and secretref://env/PLATFORM_URL — all three are required; api/worker fail closed without platform_dsn):

export APP_ENV=local
export DATABASE_URL="postgres://app_rt:secret@localhost:5432/myapp?sslmode=disable"
export MIGRATE_URL="postgres://app_migrate:secret@localhost:5432/myapp?sslmode=disable"
export PLATFORM_URL="postgres://app_platform:secret@localhost:5432/myapp?sslmode=disable"

4. Validate config, migrate, run:

wowapi config validate --env local     # delegates to your tools/configcheck; exit 0 = OK
make migrate-up                        # go run ./cmd/migrate up
make build                             # builds bin/{api,worker,migrate}
go run ./cmd/api                       # listens on :8080 (config http.addr)
# in another shell:
go run ./cmd/worker                    # outbox relay + job runner + scheduler

Expected: the api logs a startup line with the config fingerprint and listening addr=:8080. GET /healthz returns 200; GET /readyz returns readiness + the config fingerprint.

5. Add your first module:

wowapi new-module --name widgets                       # scaffolds internal/modules/widgets/
wowapi gen crud --module internal/modules/widgets --resource widget --fields "title:string,count:int"

Register it in internal/wire/modules.go, then re-run make build. Full walkthrough: Building & extending modules.

Quick start B — work on the framework repo

git clone https://github.com/qatoolist/wowapi && cd wowapi
make setup                  # install host tools + go mod download
make up                     # start postgres + minio + mailpit + jaeger + toolbox
make migrate                # apply kernel migrations to the local DB
make ci                     # host CI: vet, boundary lint, unit, race, perf budgets, build (golangci-lint = make lint-new / hosted CI)
make ci-container           # AUTHORITATIVE gate: runs `make ci` in the toolbox with DB tests FORCED

make ci-container is the gate that must pass before anything ships (it forces DB/integration tests to run — a green host suite can hide skipped DB tests). See Testing & the regression gate.

Core concepts

Concept One-liner Learn more
Kernel / Module / App Kernel = services; Module = your domain plugged in via Register; App = composition root that boots them architecture
Tenant + RLS Every tenant-scoped row is isolated by tenant_id + forced RLS; the runtime binds the tenant per transaction architecture, database
Actor & authorization Users/machines act as an Actor; RouteMeta declares the permission; the gate enforces deny-by-default per request auth
TxManager / TenantDB Do work in the caller's tenant transaction so business + kernel writes commit atomically database
Outbox / Jobs / Scheduler Events are written iff the business tx commits; jobs are at-least-once; the scheduler is leader-safe architecture
secretref config Config is layered; secrets are secretref://env/VAR references, never plaintext configuration

Command reference

wowapi CLI (wowapi help, or per-command wowapi <cmd> -h):

Command Purpose
wowapi version Print CLI version + check the go.mod dependency version
wowapi init [<name>] --module <path> Scaffold a product repo (with <name>, creates ./<name>/; otherwise scaffolds into .)
wowapi new-module --name <name> Scaffold a module package implementing module.Module
wowapi gen crud --module <dir> --resource <name> --fields <...> Generate CRUD scaffolding for a resource
wowapi migrate create --name <n> Create the next-numbered migration file
wowapi config validate|print|doctor|schema|diff Validate/inspect config (delegates to product tools/configcheck)
wowapi seed validate Validate a module's seed bundle
wowapi openapi merge [fragments...] Merge OpenAPI fragments into one document
wowapi lint boundaries Import-law + vocabulary boundary lint
wowapi deploy render --env <env> Render deployment manifests (compose/env)
wowapi dlq <jobs|events> <list|inspect|replay|discard> Inspect/operate the dead-letter queues (needs DATABASE_URL)

Make targets (framework repo)make help lists all. The essentials:

Target Purpose
make up / make down / make reset Start / stop / wipe the local stack
make migrate Apply kernel migrations to the local DB
make ci Host CI (vet, boundary lint, unit, race, perf budgets, build; golangci-lint = make lint-new)
make ci-container Authoritative gate (DB tests forced)
make test-integration / make test-security / make test-fuzz Focused suites
make shell / make db-shell Toolbox shell / psql

Full reference: CLI reference.

Configuration & environment

Config is layered: compiled defaults ← configs/base.yamlconfigs/<env>.yamlWOWAPI__* env vars ← secret references. Secrets are secretref://env/<VAR> (or a cloud provider ref) — never plaintext; config.Secret is compiler-redacted.

Key environment variables:

Variable Used by Purpose
APP_ENV product api/worker/migrate Selects the configs/<env>.yaml overlay
DATABASE_URL api/worker (db.dsn), local tooling Runtime DSN (role app_rt)
MIGRATE_URL migrate (db.migrate_dsn) Migration DSN (role app_migrate)
WOWAPI__* config loader Env override for any config key (e.g. WOWAPI__LOG__LEVEL=debug)
WOWAPI_TEST_DSN / DATABASE_URL testkit DB for integration tests
WOWAPI_REQUIRE_DB=1 tests / ci-container Makes DB tests fail instead of skip
OTEL_EXPORTER_OTLP_ENDPOINT otel tracing adapter Collector endpoint (e.g. http://jaeger:4318)

Details + samples: Configuration.

Testing & the regression gate

  • Unit (make test-unit) — no external services.
  • Integration (make test-integration) — real PostgreSQL via testkit (isolated per-test DBs).
  • Contract (make test-contract) — module contract + external-consumer suite.
  • Security (make test-security) — RLS isolation, deny-by-default, redaction, unsafe-config.
  • Fuzz (make test-fuzz) — the filter DSL parser + cursor decoder.
  • Authoritative gate (make ci-container) — runs everything in the toolbox with WOWAPI_REQUIRE_DB=1, so DB tests must run. This is the release gate.

A green host suite can be hollow if DB tests silently skip — always trust make ci-container. Full guide: Testing.

Documentation map

You want to… Read
Understand and start using it User GuideGetting Started
Understand the design & concepts Concepts & Architecture, Blueprint
Configure it Configuration
Build/extend a module Modules
Handle DB & migrations Database & Migrations
Do auth / validation / errors Auth, Validation & Errors
Test & regress Testing
Build & deploy Build & Deploy, Deployment checklist
Troubleshoot Troubleshooting & FAQ
Contribute to the framework Working-capability layer
See design decisions / traceability Decisions, Evidence

Versioning & stability

  • Semantic-ish, pre-1.0. Current: v0.1.0. Per CHANGELOG.md (Keep a Changelog), the public surface may make breaking changes between minor versions until 1.0.
  • Product pinning. A product pins an exact wowapi version in its go.mod. The module contract-test suite (testkit.RunModuleContract) is the upgrade tripwire: run it in CI against a new framework version before upgrading.
  • Migrations are additive + reversible — every migration ships an Up and a Down; the reversibility drill runs in ci-container.

Known limitations & assumptions

Documented honestly rather than hidden:

  • Published version tagsgo install …@vX.Y.Z assumes the version is tagged/published on the module proxy; if not, build the CLI from a clone (Quick start A, step 1).
  • One PostgreSQL database per product, modular monolith — not a microservice mesh.
  • Read-replica routing for authz reads is a deployment seam (point WithTenantRO at a replica), not turnkey. Cross-process trace propagation through outbox events/job payloads is a documented follow-up.
  • Deferred/fail-closed features (documented, not bugs): workflow vote/min-approval/self-approval are fail-closed at definition validation; gen crud emits honest TODO handler stubs to fill in.
  • A product must provide its OIDC Authenticator (the generated api wires a fail-closed DenyAllAuthenticator until you do), object-storage adapter (if using documents), and secret provider for non-env secrets.

Contributing

Framework contributors follow the working-capability layer: best practices, coding conventions & skills map, the working persona, and the mandatory Independent Review & Quality Gate before anything ships. Run the mechanical checks with sh miscellaneous/review_gate.sh (add --full for make ci-container). Every design deviation is recorded in decisions.md before the code.

FAQ

Is this an ORM / web framework / microservice toolkit? No. It's a domain-neutral backend kernel + module SDK for a modular monolith. You write SQL (parameterized) and HTTP handlers; it gives you tenancy, authz, audit, jobs, config, and safe primitives.

Do I fork wowapi to build my product? No — you go get it as a dependency in your own repo and register modules. wowapi init scaffolds that repo.

Why one database + RLS instead of a DB per tenant? Simplicity and correctness: RLS FORCE + a fail-closed app_tenant_id() makes cross-tenant leakage impossible even on a coding mistake, without the operational cost of N databases.

How do I know an upgrade is safe? Pin the version, run testkit.RunModuleContract and your suite in CI against the new version. See Versioning.

Where do secrets go? Never in config files. Config holds secretref://env/VAR references; the value comes from the environment (or a cloud secret provider). See Configuration.

A DB test "skipped" — is that OK? In local runs a DB test skips without a DSN. The authoritative gate (make ci-container, WOWAPI_REQUIRE_DB=1) makes them fail instead, so nothing hides.

More: Troubleshooting & FAQ.

License

Licensed under the Apache License 2.0 — see LICENSE and NOTICE. Apache-2.0 is a permissive license with an explicit patent grant, suitable for adopting wowapi as a dependency in commercial and open-source products alike.

Directories

Path Synopsis
adapters
auth/pgprincipal
Package pgprincipal implements auth.PrincipalStore over Postgres: it resolves the framework user id from an IdP subject on the global identity spine and validates an acting capacity within the token's tenant.
Package pgprincipal implements auth.PrincipalStore over Postgres: it resolves the framework user id from an IdP subject on the global identity spine and validates an acting capacity within the token's tenant.
metrics/prometheus
Package prometheus implements the observability.Metrics port using the Prometheus Go client.
Package prometheus implements the observability.Metrics port using the Prometheus Go client.
secrets/envprovider
Package envprovider implements secrets.Provider for the "env" scheme: references of the form "secretref://env/<VAR>" are resolved from the process environment.
Package envprovider implements secrets.Provider for the "env" scheme: references of the form "secretref://env/<VAR>" are resolved from the process environment.
storage/s3
Package s3 is the framework's production object-storage adapter: the storage.Adapter port (kernel/storage) implemented against S3-compatible endpoints (AWS S3, MinIO) with the minio-go SDK.
Package s3 is the framework's production object-storage adapter: the storage.Adapter port (kernel/storage) implemented against S3-compatible endpoints (AWS S3, MinIO) with the minio-go SDK.
tracing/otel
Package otel adapts OpenTelemetry to the wowapi observability.Tracer port (roadmap O1).
Package otel adapts OpenTelemetry to the wowapi observability.Tracer port (roadmap O1).
Package app is wowapi's composition root helpers.
Package app is wowapi's composition root helpers.
cmd
wowapi command
Command wowapi is the installable framework CLI:
Command wowapi is the installable framework CLI:
internal
buildinfo
Package buildinfo reports the CLI/framework version and inspects a consuming repo's go.mod for the wowapi requirement (version-mismatch warning, D-0008).
Package buildinfo reports the CLI/framework version and inspects a consuming repo's go.mod for the wowapi requirement (version-mismatch warning, D-0008).
cli
apikey_cmd.go — wowapi apikey: issue, list, rotate, and revoke machine API keys / service principals (roadmap S1/CA-3).
apikey_cmd.go — wowapi apikey: issue, list, rotate, and revoke machine API keys / service principals (roadmap S1/CA-3).
testmodules/requests
Package requests is a domain-neutral private fixture module used by the wowapi module-contract test suite (blueprint 08 §2, 11 §4).
Package requests is a domain-neutral private fixture module used by the wowapi module-contract test suite (blueprint 08 §2, 11 §4).
tools/benchbudget command
benchbudget enforces performance budgets against go test -bench output.
benchbudget enforces performance budgets against go test -bench output.
tools/migrate command
Command migrate applies the kernel migrations to the database named by DATABASE_URL — the framework repo's local/CI migration runner behind `make migrate`.
Command migrate applies the kernel migrations to the database named by DATABASE_URL — the framework repo's local/CI migration runner behind `make migrate`.
Package kernel is wowapi's infrastructure composition root: it owns the database pool, the transaction manager, and the kernel services (the authz evaluator, and later outbox/jobs/documents/…).
Package kernel is wowapi's infrastructure composition root: it owns the database pool, the transaction manager, and the kernel services (the authz evaluator, and later outbox/jobs/documents/…).
apikey
Package apikey provides machine authentication (roadmap S1): issuable, scoped, rotatable, revocable, expirable API keys / service principals so non-human callers authenticate without a user token.
Package apikey provides machine authentication (roadmap S1): issuable, scoped, rotatable, revocable, expirable API keys / service principals so non-human callers authenticate without a user token.
artifact
Package artifact is the snapshot/artifact pipeline (roadmap E4): it turns a product-rendered dataset into an IMMUTABLE, versioned artifact — content plus its sha256, a structured sidecar, and the template version/effective date it was produced under.
Package artifact is the snapshot/artifact pipeline (roadmap E4): it turns a product-rendered dataset into an IMMUTABLE, versioned artifact — content plus its sha256, a structured sidecar, and the template version/effective date it was produced under.
audit
Package audit is the durable, append-only, field-level audit trail (roadmap E1): a standardized record of who changed what — entity, field, before/after, actor, capacity, impersonator, request id — written INSIDE the business transaction so an audit row commits iff the change does.
Package audit is the durable, append-only, field-level audit trail (roadmap E1): a standardized record of who changed what — entity, field, before/after, actor, capacity, impersonator, request id — written INSIDE the business transaction so an audit row commits iff the change does.
auth
Package auth is wowapi's authentication kernel: it verifies OIDC/JWT bearer tokens against an injectable KeySource (JWKS-over-HTTPS in production, a local signer in tests) and maps validated claims onto an authz.Actor after the app resolves the framework user id and active capacity (D-0037, 01 §3).
Package auth is wowapi's authentication kernel: it verifies OIDC/JWT bearer tokens against an injectable KeySource (JWKS-over-HTTPS in production, a local signer in tests) and maps validated claims onto an authz.Actor after the app resolves the framework user id and active capacity (D-0037, 01 §3).
authz
Package authz is wowapi's authorization kernel: a deny-by-default evaluator that layers RBAC (role→permission assignments), ReBAC (relationship-derived grants), and ABAC (attribute policies, deny-first) exactly as specified in blueprint 01 §3.
Package authz is wowapi's authorization kernel: a deny-by-default evaluator that layers RBAC (role→permission assignments), ReBAC (relationship-derived grants), and ABAC (attribute policies, deny-first) exactly as specified in blueprint 01 §3.
bulk
Package bulk is the chunked bulk-operation framework (roadmap E6): start a set of items, process them in caller-sized chunks with per-item isolation, record a partial-failure ledger, and resume after an interruption.
Package bulk is the chunked bulk-operation framework (roadmap E6): start a set of items, process them in caller-sized chunks with per-item isolation, record a partial-failure ledger, and resume after an interruption.
config
Package config defines wowapi's typed configuration contracts: the framework-owned Framework struct, the Secret type with structural redaction, and the ModuleView through which modules receive their namespaced configuration.
Package config defines wowapi's typed configuration contracts: the framework-owned Framework struct, the Secret type with structural redaction, and the ModuleView through which modules receive their namespaced configuration.
database
Package database is wowapi's persistence kernel: the pgx pool, the TxManager that is the ONLY door to tenant data, and the RLS session plumbing (SET LOCAL app.tenant_id inside a transaction, never on a pooled connection).
Package database is wowapi's persistence kernel: the pgx pool, the TxManager that is the ONLY door to tenant data, and the RLS session plumbing (SET LOCAL app.tenant_id inside a transaction, never on a pooled connection).
document
Package document is wowapi's document / file framework: modules register document CLASSES (the policy envelope for a kind of file — allowed MIME types, a size ceiling, a default sensitivity, and an optional retention window); the service manages metadata rows, presigned upload sessions, immutable versioned file pointers, authorized presigned downloads, explicit access grants, and a retention sweep.
Package document is wowapi's document / file framework: modules register document CLASSES (the policy envelope for a kind of file — allowed MIME types, a size ceiling, a default sensitivity, and an optional retention window); the service manages metadata rows, presigned upload sessions, immutable versioned file pointers, authorized presigned downloads, explicit access grants, and a retention sweep.
errors
Package errors is wowapi's error taxonomy: a closed set of Kinds that map deterministically to HTTP status codes and stable machine codes, plus the structured Error type carried across every layer.
Package errors is wowapi's error taxonomy: a closed set of Kinds that map deterministically to HTTP status codes and stable machine codes, plus the structured Error type carried across every layer.
filtering
Package filtering is wowapi's allowlist-driven filter/sort builder — the mechanism behind docs/blueprint/05 §2, "Pagination / filtering / sorting (allowlist-driven; SQL injection impossible by construction)".
Package filtering is wowapi's allowlist-driven filter/sort builder — the mechanism behind docs/blueprint/05 §2, "Pagination / filtering / sorting (allowlist-driven; SQL injection impossible by construction)".
httpclient
Package httpclient builds SSRF-safe *http.Client instances for outbound calls to user-configurable destinations (webhook targets, integration callbacks, …).
Package httpclient builds SSRF-safe *http.Client instances for outbound calls to user-configurable destinations (webhook targets, integration callbacks, …).
httpx
Package httpx is wowapi's HTTP toolbox: response envelopes, the RFC 9457 problem-details error writer, strict JSON decoding, metadata-enforced route registration, and the request helpers module handlers compose.
Package httpx is wowapi's HTTP toolbox: response envelopes, the RFC 9457 problem-details error writer, strict JSON decoding, metadata-enforced route registration, and the request helpers module handlers compose.
i18n
Package i18n is wowapi's cross-cutting message-catalog and locale-negotiation kernel.
Package i18n is wowapi's cross-cutting message-catalog and locale-negotiation kernel.
integration
Package integration is wowapi's external-provider framework: modules register a Provider ADAPTER per provider key (a payment gateway, an SMS gateway, an identity source, …); per-tenant/platform rows in integration_providers hold the non-secret config plus a credential REFERENCE (never plaintext); and the kernel resolves an adapter + its config + its resolved credential on demand and aggregates provider health for readiness.
Package integration is wowapi's external-provider framework: modules register a Provider ADAPTER per provider key (a payment gateway, an SMS gateway, an identity source, …); per-tenant/platform rows in integration_providers hold the non-secret config plus a credential REFERENCE (never plaintext); and the kernel resolves an adapter + its config + its resolved credential on demand and aggregates provider health for readiness.
jobs
Package jobs is wowapi's Postgres-backed job runner (D-0047 — a focused queue behind the framework interfaces, NOT River).
Package jobs is wowapi's Postgres-backed job runner (D-0047 — a focused queue behind the framework interfaces, NOT River).
lifecycle
Package lifecycle is wowapi's STATIC provider/lifecycle manifest (backlog B9).
Package lifecycle is wowapi's STATIC provider/lifecycle manifest (backlog B9).
logging
Package logging provides process-wide structured logging for wowapi processes.
Package logging provides process-wide structured logging for wowapi processes.
mfa
Package mfa provides reusable, standards-compliant multi-factor-authentication factor primitives: TOTP (RFC 6238) and HOTP (RFC 4226) code generation and verification, numeric one-time-passcode (OTP) generation with salted constant-time hashing, pure challenge-policy helpers (TTL + attempt-limit enforcement), and delivery-port interfaces for out-of-band code senders (SMS/email) with test/log adapters.
Package mfa provides reusable, standards-compliant multi-factor-authentication factor primitives: TOTP (RFC 6238) and HOTP (RFC 4226) code generation and verification, numeric one-time-passcode (OTP) generation with salted constant-time hashing, pure challenge-policy helpers (TTL + attempt-limit enforcement), and delivery-port interfaces for out-of-band code senders (SMS/email) with test/log adapters.
model
Package model defines wowapi's base model primitives: embeddable structs for identity, tenancy, audit, versioning, temporal validity, and status; plus kernel-wide value objects for money, references, and time ranges.
Package model defines wowapi's base model primitives: embeddable structs for identity, tenancy, audit, versioning, temporal validity, and status; plus kernel-wide value objects for money, references, and time ranges.
notify
Package notify is wowapi's notification framework: modules register template keys with an allowlisted variable set and required channels (Registry); Send writes a notifications row + one notification_deliveries row per resolved channel inside the caller's tenant business transaction (atomicity with the business write); and SendPending is the async worker step that claims queued deliveries, calls channel-specific senders, and advances delivery status — dead-lettering after maxAttempts.
Package notify is wowapi's notification framework: modules register template keys with an allowlisted variable set and required channels (Registry); Send writes a notifications row + one notification_deliveries row per resolved channel inside the caller's tenant business transaction (atomicity with the business write); and SendPending is the async worker step that claims queued deliveries, calls channel-specific senders, and advances delivery status — dead-lettering after maxAttempts.
observability
Package observability is wowapi's observability port: the Metrics interface (RED signals + generic counters and gauges) and a no-op safe default.
Package observability is wowapi's observability port: the Metrics interface (RED signals + generic counters and gauges) and a no-op safe default.
outbox
Package outbox is wowapi's transactional outbox: modules write domain events into events_outbox in the SAME transaction as their business writes, so an event is emitted if and only if the write commits (no lost or phantom events).
Package outbox is wowapi's transactional outbox: modules write domain events into events_outbox in the SAME transaction as their business writes, so an event is emitted if and only if the write commits (no lost or phantom events).
pagination
Package pagination provides wowapi's page/cursor response envelopes and the opaque keyset cursor used for feed-style listing.
Package pagination provides wowapi's page/cursor response envelopes and the opaque keyset cursor used for feed-style listing.
policy
Package policy is wowapi's ABAC condition engine: it evaluates a policy's conditions against an attribute bag using a closed operator set.
Package policy is wowapi's ABAC condition engine: it evaluates a policy's conditions against an attribute bag using a closed operator set.
privileged
Package privileged is wowapi's scoped privileged-service surface: the sanctioned, audited way a module performs a valid tenant-scoped operation that requires PLATFORM privilege at the database, WITHOUT the module writing its own SECURITY DEFINER SQL and WITHOUT ever seeing a platform pool or raw SQL door (SEC-24 / SEC-13; GAP-006).
Package privileged is wowapi's scoped privileged-service surface: the sanctioned, audited way a module performs a valid tenant-scoped operation that requires PLATFORM privilege at the database, WITHOUT the module writing its own SECURITY DEFINER SQL and WITHOUT ever seeing a platform pool or raw SQL door (SEC-24 / SEC-13; GAP-006).
relationship
Package relationship is wowapi's ReBAC edge store: the tenant relationships graph (subject —rel_type→ object) plus the adapter that answers the authz kernel's relationship questions.
Package relationship is wowapi's ReBAC edge store: the tenant relationships graph (subject —rel_type→ object) plus the adapter that answers the authz kernel's relationship questions.
resource
Package resource is the kernel resource registry and the thin tenant mirror that lets kernel services (authz record-scope, comments, documents, workflow, relationships) address any module row uniformly.
Package resource is the kernel resource registry and the thin tenant mirror that lets kernel services (authz record-scope, comments, documents, workflow, relationships) address any module row uniformly.
retention
Package retention is the data-lifecycle layer (roadmap E2): a generalized legal hold over any entity (not just documents) and a Data Subject Request ledger (export/erasure) with a statutory-override reason.
Package retention is the data-lifecycle layer (roadmap E2): a generalized legal hold over any entity (not just documents) and a Data Subject Request ledger (export/erasure) with a statutory-override reason.
rules
Package rules is wowapi's rule/configuration engine: modules register rule points (a key, a RuleValueSchema'd value, a default, allowed scopes, and whether changes require approval); values are stored as versioned rows with temporal validity; and resolution picks the most specific active value for a (tenant, org, at) — org-ancestry → tenant → platform → code default.
Package rules is wowapi's rule/configuration engine: modules register rule points (a key, a RuleValueSchema'd value, a default, allowed scopes, and whether changes require approval); values are stored as versioned rows with temporal validity; and resolution picks the most specific active value for a (tenant, org, at) — org-ancestry → tenant → platform → code default.
secrets
Package secrets defines the secret-reference model and the provider port.
Package secrets defines the secret-reference model and the provider port.
seeds
Package seeds loads a module's declarative catalog seeds (permissions, roles, resource types, relationship types) from embedded YAML and syncs them idempotently into the global catalogs at boot.
Package seeds loads a module's declarative catalog seeds (permissions, roles, resource types, relationship types) from embedded YAML and syncs them idempotently into the global catalogs at boot.
sequence
Package sequence provides a gap-free, race-free per-tenant numbered-series allocator for statutory documents (receipts, vouchers, certificates) — the primitive that keeps products off MAX()+1 (roadmap E3).
Package sequence provides a gap-free, race-free per-tenant numbered-series allocator for statutory documents (receipts, vouchers, certificates) — the primitive that keeps products off MAX()+1 (roadmap E3).
storage
Package storage is the object-storage port for the document framework: the kernel never talks to S3/minio/GCS directly, it talks to an Adapter.
Package storage is the object-storage port for the document framework: the kernel never talks to S3/minio/GCS directly, it talks to an Adapter.
validation
Package validation wraps go-playground/validator/v10 and translates its FieldError slice into kernel/errors.FieldError values, producing a *errors.Error with Kind=KindValidation.
Package validation wraps go-playground/validator/v10 and translates its FieldError slice into kernel/errors.FieldError values, producing a *errors.Error with Kind=KindValidation.
webhook
Package webhook implements wowapi's webhook subsystem: inbound signature verification + replay protection + async processing, and outbound signed HTTP delivery with per-endpoint circuit breakers.
Package webhook implements wowapi's webhook subsystem: inbound signature verification + replay protection + async processing, and outbound signed HTTP delivery with per-endpoint circuit breakers.
workflow
Package workflow is wowapi's small custom Postgres-backed workflow engine: a closed-step-type approval/state-machine runtime that shares the caller's tenant transaction (RLS + outbox + audit) exactly as blueprint 02 §1 and decisions D-0051/D-0053 specify.
Package workflow is wowapi's small custom Postgres-backed workflow engine: a closed-step-type approval/state-machine runtime that shares the caller's tenant transaction (RLS + outbox + audit) exactly as blueprint 02 §1 and decisions D-0051/D-0053 specify.
Package migrations embeds the wowapi kernel SQL migrations and exposes them as an fs.FS for the migration runner (kernel/database.Migrate) and the wowapi CLI.
Package migrations embeds the wowapi kernel SQL migrations and exposes them as an fs.FS for the migration runner (kernel/database.Migrate) and the wowapi CLI.
Package module is wowapi's public module SDK: the contract a product module implements and the capability-scoped Context it registers against.
Package module is wowapi's public module SDK: the contract a product module implements and the capability-scoped Context it registers against.
Package testkit is wowapi's public integration-test harness: the one package permitted to compose everything (kernel, app, adapters, modules) so that both the framework and external product repositories can exercise their code against a real Postgres with the same fixtures, fakes, and assertions.
Package testkit is wowapi's public integration-test harness: the one package permitted to compose everything (kernel, app, adapters, modules) so that both the framework and external product repositories can exercise their code against a real Postgres with the same fixtures, fakes, and assertions.
fakes
Package fakes holds the deterministic test doubles wowapi injects through the same constructors production uses (08 §2): a manual-advance clock and a deterministic IDGen.
Package fakes holds the deterministic test doubles wowapi injects through the same constructors production uses (08 §2): a manual-advance clock and a deterministic IDGen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL