Repository navigation
fix(dev): give every dev stack an encryption key; admin test 403 (#2336) - #2344
Merged
Merged
Conversation
dev/start.sh and test/e2e/admin_api_test.go, two bugs: 1. A checkout with no .env (every CI runner) started the dev stack with field encryption off, so every form with a sensitive field answered its GET 500 and all four TestIssue2179_* criteria failed the E2E Nightly. dev/start.sh now sets a fixed dev ENCRYPTION_KEY when .env and the shell set none, and records it in dev/.dev-ports.env; issue2179DevKey reads it from the environment `make acceptance` loads instead of from .env. 2. TestAdminAPI_AuthEnforcement expected 401 for a valid non-admin key after #2337 made the admin API answer 403; the subtest is now analyst_key_returns_403. Comments in issue_2121_test.go and issue_2228_test.go that described the old key source and the old status are corrected. Closes #2336
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2344 +/- ##
=======================================
Coverage 94.80% 94.81%
=======================================
Files 1443 1443
Lines 117111 117111
=======================================
+ Hits 111032 111034 +2
+ Misses 6059 6057 -2
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
dev/start.sh and test/e2e/admin_api_test.go, two bugs that failed the E2E Nightly (run 40508799934):
pkg/platform/platform.gobuildFieldEncryptor reads only ENCRYPTION_KEY), so every form with a sensitive field answered its GET 500 "the form's spec is not one this platform renders" (internal/endpoint/eprun/form.gostorable,epcollect.ErrCannotSeal) and all fourTestIssue2179_*criteria failed.dev/start.shnow sets a fixed dev ENCRYPTION_KEY when .env and the shell set none, and records it indev/.dev-ports.env;issue2179DevKeyreads it from the environmentmake acceptanceloads instead of from .env.TestAdminAPI_AuthEnforcementexpected 401 for a valid non-admin key after Portal: a signed-in non-admin who opens Knowledge > Changesets is stuck in a sign-in loop (admin API answers 401 instead of 403) #2337 made the admin API answer 403 (asdocs/knowledge/admin-api.mdalready states); the subtest is nowanalyst_key_returns_403.Comments in
issue_2121_test.goandissue_2228_test.gothat described the old key source and the old status are corrected.Run against a fresh
make devwith no .env present:make acceptance ISSUE=2179(4 pass),ISSUE=2121andISSUE=2242(10 pass, their replicas now take the key from the environment),make dev-smoke,make preverify, andgo test -tags=integration ./test/e2e/ -run TestAdminAPI_AuthEnforcement(4 subtests pass).Closes #2336