feat(services): sync domain verification loop from constructive-db#103
Merged
Conversation
Upstreams the services-module tables and function added in constructive-db#2283 (the verify->DNS->issue loop) plus their managed_domains foundation: - managed_domains: cert-bearing host/wildcard registry with independent verification_status / tls_status / cert_status - domain_verifications: entity-owned (owner_id) ownership-challenge table - domain_events: append-only lifecycle audit trail - services_private.domain_issue_challenge: domain:issue_challenge RLS/permission/FK wiring lives in the constructive-db introspection / metaschema-generators packages (no upstream counterpart) and is out of scope for this module sync.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…main tables The metaschema-modules test suite deploys the services module (it requires services_public.apis), so the new managed_domains/domain_verifications/ domain_events tables land in its test database. modules.test.ts counts FK constraint rows via an information_schema join keyed on constraint_name, so the added constraints shift constraintCount (325438->333050, 475461->483073). Regenerated via jest -u; matches CI's computed values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upstreams the
services-module SQL that landed in constructive-db#2283 (the domain verify → DNS → issue loop) intopackages/services, following the established "sync pgpm modules from constructive-db" pattern. The upstreamservicespackage was missing both the new tables and theirmanaged_domainsfoundation (from constructive-db#2256, which was never upstreamed), somanaged_domainsis included as a required prerequisite.Adds 4 objects (each with matching deploy/revert/verify triples +
pgpm.planentries) and regenerates the packagedsql/services--0.1.0.sql:services_public.managed_domains— cert-bearing host/wildcard registry, trackingverification_status/tls_status/cert_statusindependently (database-scoped,hostnamedomain,db_fkey → metaschema_public.database).services_public.domain_verifications— entity-owned (owner_id) ownership-challenge table; holds the public challenge token (DNS TXT value / HTTP-01 token — not a secret),FK → managed_domains ON DELETE CASCADE.services_public.domain_events— append-only lifecycle audit trail mirroringresource_events/cluster_events.services_private.domain_issue_challenge(uuid, text, uuid)— thedomain:issue_challengefunction: mints a challenge, supersedes prior outstanding challenges for the same(domain, method), resetsverification_status = pending, and emits achallenge_issuedevent.Scope notes
manage_domains) /owner_id → usersFK wiring is intentionally NOT here. In constructive-db those live in theintrospection/metaschema-generators/metaschemapackages (apply_metaschema_rls,provision_base_modules,initialize_permissions), which have no counterpart in this repo. This sync is limited to the rawservicesmodule DDL + function, matching how the other services tables live upstream.0.1.0/ packaged filenameservices--0.1.0.sql(the repo convention where packaged-sql version is decoupled from the lernapackage.jsonversion).services.control/package.json/Makefileare untouched. The only edit to an existing file besidespgpm.planis the regenerated packaged sql, which is purely additive.Validation
packages/servicesdeploys cleanly with the 4 new objects onconstructiveio/postgres-plus:18(the CI image).pnpm test(services):2 passed,12 snapshots passed— existing snapshots unchanged by the additions.Link to Devin session: https://app.devin.ai/sessions/87c0076b31854a7aac2c551a4e6d2cd0
Requested by: @pyramation