test: integration harness for standalone→central migration#32
Merged
Conversation
…ation Self-contained multi-container harness under test/integration/ (does NOT touch the production docker-compose.yml). Phase 1: a Postgres-backed central serving HTTPS + a BoltDB local-accounts standalone that migrates into it over real cross-container TLS. - docker-compose.yml: postgres + central (TLS, cert SAN=central/localhost) + standalone-local (HTTP, trusts the internal CA via SSL_CERT_FILE). - certs/gen.sh: internal CA + central cert (generated certs are gitignored). - driver_test.go (//go:build integration): seeds the standalone, mints a token on the central, asserts the cleartext-http push is refused, runs preflight+commit over TLS, verifies the import landed, and logs the migrated user into the CENTRAL with her carried password hash — asserting roles, permissions, and the CARRIED audience. - Makefile (make up / test / down), README. Excluded from the normal build by the `integration` tag, so `go build/vet/test ./...` (the release gate) is unaffected. Verified green end-to-end locally. Phase 2 (planned): LDAP/AD nodes for same-AD (policy-only), different-AD (blocked) and a direct app. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…irect)
Extends the harness with two OpenLDAP directories and AD-backed standalones,
proving the AD half of the migration matrix end to end:
- ldap-corp (corp.local) + ldap-other (other.local): vanilla OpenLDAP seeded via
LDIF. SimpleAuth uses username_attr=uid, so User.SAMAccountName comes from `uid`
and no samba schema is needed; AD users are provisioned via login/JIT.
- standalone-ad (same AD as central) + standalone-addiff (different AD).
- ad_test.go (TestADMigrationScenarios):
* same-AD -> POLICY-ONLY migration (no record/password copied, local_users=0);
the AD user re-binds from the same AD on the central and resolves his role.
* different-AD -> blocked at preflight + commit refused (409).
* direct app -> an app registered straight on the central; AD user authenticates
directly (no migration).
Also: phase-1 driver now asserts the CARRIED source audience (not the target app
id), and the README/topology reflect the full topology.
All scenarios green; release gate (`go build/vet/test ./...`) unaffected (the
driver is behind the `integration` tag).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Self-contained multi-container integration harness under
test/integration/— does not touch the productiondocker-compose.yml. Exercises the v2.2 migration feature across real container boundaries (real TLS push, real cross-install HTTP) that the Go unit tests can't reach.Phase 1 (this PR, green)
postgres+central(Postgres, serves HTTPS) +standalone-local(BoltDB, local accounts) migrating in over TLS the standalone actually verifies (internal CA,SSL_CERT_FILE). The Go driver (//go:build integration, reusesinternal/migratetypes) seeds, mints a token, asserts the cleartext-http push is refused, runs preflight→commit, verifies the import landed, and logs the migrated user into the central with her carried hash — asserting roles, perms, and the carried audience.Excluded from
go build/vet/test ./...by theintegrationtag, so the release gate is unaffected.Phase 2 (incoming on this branch)
LDAP/AD nodes (vanilla OpenLDAP,
username_attr=uid) for same-AD (policy-only migration, AD re-bind on the central), different-AD (preflight blocks), central-not-on-AD (blocks), and a direct app.🤖 Generated with Claude Code