feat: scaffold bunyip-core/oci/oidc crates for the dunite rebuild #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-api-on-dunite"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Scaffold-only first step toward rebuilding
bunyip-apifrom an axum in-memory mock into a real actix-web SaaS backend that is the OIDC provider (mokosh-server and other relying parties become clients), built on the generic dunite kernel and mirroring themenkentreference consumer. No domain code is ported yet; the existing mock,bunyip-web, README, and.env.exampleare untouched and the app still builds and runs.Tracking: BUNYIP-26.
Why scaffold-only
Both sibling repos were actively mid-refactor while this was written, changing between edits:
dunite-corestill ships the full fat domain layer (slated for removal in steps 3/4);dunite-oidcis not yet generic-ized;dunite-ocialready is.menkent-domaintomenkent-coreand, per that crate's manifest, dropping the dunite dependency entirely ("Owned wholesale by menkent (no dunite dependency)").That last point contradicts the directive for Bunyip to consume dunite as a generic library. The consumption-boundary question (consume dunite vs own wholesale) is deliberately left open until upstream settles. Full context:
dev-docs/bunyip-on-dunite-scaffold.md.What this PR adds
crates/bunyip-{core,oci,oidc}skeletons mirroringmenkent-{core,oci,oidc}, added to the workspace.dunite-*wired as optional path deps behind adunitefeature (off by default), so the workspace compiles independently of upstream churn.cargo check -p bunyip-core -p bunyip-oci -p bunyip-oidcis green.menkent/api/migrationsintobunyip-api/migrations/(unpruned; the 6 a8n domain seeds are flagged for fill-time removal).postgres:16-alpinedev service (dev-bunyip-postgres-${USER}) incompose.dev.yml, ready for the actix backend.Not in this PR (fill steps)
Resolve the consume-vs-own decision, port the domain layer + verticals, convert
bunyip-apito the actix binary, prune migrations + add Bunyip's own seeds, generate dev OIDC keys, finish dev/prod build infra, retire the mock. Enumerated indev-docs/bunyip-on-dunite-scaffold.md.🤖 Generated with Claude Code
Sets up the structural skeleton for rebuilding bunyip-api as a real actix-web SaaS backend and OIDC provider on the generic dunite kernel (mirroring the menkent reference consumer), without porting any domain code yet. The existing axum mock, bunyip-web, README, and .env.example are untouched and the app still builds/runs. Why scaffold-only: both sibling repos are actively mid-refactor. dunite is on step 2/4 of a library-only refactor (dunite-core still ships fat domain code slated for removal in steps 3/4; dunite-oidc not yet generic-ized). menkent is renaming menkent-domain to menkent-core and, per that crate's manifest, dropping the dunite dependency entirely - which contradicts the directive for bunyip to consume dunite as a generic library. Resolve that consumption-boundary question once upstream settles. Full context in dev-docs/bunyip-on-dunite-scaffold.md. What this adds: empty crates/bunyip-{core,oci,oidc} mirroring menkent's layout, added to the workspace; dunite-* wired as optional path deps behind a `dunite` feature (off by default) so the workspace compiles independently of upstream churn (cargo check on the three crates is green); the 53 SQL migrations vendored from menkent/api/migrations into bunyip-api/migrations (unpruned - the 6 a8n domain seeds are flagged for fill-time removal); and an idle postgres:16-alpine dev service ready for the actix backend. #BUNYIP-26 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Ports menkent-core's domain layer (config, all models, repositories, business services, and domain middleware: auth extractors + auto-ban) into bunyip-core, and re-points the generic kernel pieces to consume dunite-core instead of owning them. This is the foundation for rebuilding bunyip-api as a real actix-web SaaS backend on the now-generic dunite crates. bunyip-core re-exports dunite-core's kernel under the original module names (errors, responses, validation, middleware::{request_id, security_headers}, services::{encryption, password, JwtConfig}) so the ported domain sources keep using crate::errors, crate::responses, crate::services::encryption, etc. unchanged. The kernel source files dunite provides were deleted; JwtService is kept locally and built on dunite-core's JwtConfig (the same type dunite-oci's OciTokenService consumes). Email Tera templates are vendored under crates/bunyip-core/templates for the compile-time include_str!. The kernel reconciliation was clean (dunite-core is the common ancestor of menkent-core's kernel): bunyip-core compiles with zero errors. bunyip-oci/oidc manifests updated to depend on the generic dunite-oci/dunite-oidc engines (their source ports are next). Domain branding (a8n.tools defaults: cache dirs, lifecycle-event URN, issuer examples) is NOT yet rebranded - that lands with the config pass. #BUNYIP-26 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Replaces the axum in-memory mock with the real actix-web binary, ported from menkent/api and wired to bunyip-core (domain) + bunyip-oci + bunyip-oidc, which build on the generic dunite crates. This completes the backend: the full workspace (core + oci + oidc + api) compiles. main.rs ports menkent's app assembly: config, pool, sqlx::migrate!, optional SETUP_DEFAULT_ADMIN seed, all service init (jwt/auth/email/encryption/stripe/forgejo/totp/webhook/OIDC-provider/auto-ban), CORS, background cleanup tasks, the primary HttpServer, and the conditional second OCI HttpServer (tokio::try_join). Routes mount the /v1 scope plus the root-level OIDC well-known/oauth2 routes from bunyip-oidc; the OCI server uses bunyip-oci's routes + WWW-Authenticate middleware. Because dunite-oci's BlobCache<S> is generic over a BlobStore, main.rs constructs BlobCache<OciBlobCacheRepository> and registers OciPullDailyCountRepository as the PullCounter (a divergence from menkent's concrete, pool-backed cache). Bunyip's /version update-check is preserved: the framework-agnostic UpdateChecker stays, with an actix handler/route mounted at GET /version. The axum mock modules and the bunyip-mocks dependency are removed; migrations/ (53 files) are retained. Test-fixture owner/repo strings ('a8n'/'rus') remain in #[cfg(test)] blocks (inert placeholders, do not ship). #BUNYIP-26 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>David referenced this pull request2026-05-30 20:29:38 +02:00