Skip to content

fix(dev): give every dev stack an encryption key; admin test 403 (#2336) - #2344

Merged
cjimti merged 1 commit into
mainfrom
fix/2336-nightly-encryption-key-admin-403
Oct 27, 2026
Merged

cjimti merged 1 commit into
mainfrom
fix/2336-nightly-encryption-key-admin-403

Conversation

@cjimti

@cjimti cjimti commented Oct 27, 2026

Copy link
Copy Markdown
Member

dev/start.sh and test/e2e/admin_api_test.go, two bugs that failed the E2E Nightly (run 40508799934):

  1. A checkout with no .env (every CI runner) started the dev stack with field encryption off (pkg/platform/platform.go buildFieldEncryptor 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.go storable, epcollect.ErrCannotSeal) and all four TestIssue2179_* criteria failed. 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 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 (as docs/knowledge/admin-api.md already states); 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.

Run against a fresh make dev with no .env present: make acceptance ISSUE=2179 (4 pass), ISSUE=2121 and ISSUE=2242 (10 pass, their replicas now take the key from the environment), make dev-smoke, make preverify, and go test -tags=integration ./test/e2e/ -run TestAdminAPI_AuthEnforcement (4 subtests pass).

Closes #2336

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

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.81%. Comparing base (c0eb937) to head (7b3b069).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cjimti
cjimti merged commit 36f5e29 into main Oct 27, 2026
12 checks passed
@cjimti
cjimti deleted the fix/2336-nightly-encryption-key-admin-403 branch October 27, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E Nightly is failing

1 participant