Lock bootstrap admin token until password is changed #6
Reference in New Issue
Block a user
Delete Branch "fix/helix-2-bootstrap-lock"
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?
Closes #2.
bootstrap=true. Mutating admin API other thanPOST /api/loginandPOST /api/users/me/passwordreturns 403 until a non-default password is stored. Reads stay allowed so the UI can prompt for a change. After change-password, default-password login fails (401) and leftover bootstrap tokens stay locked.ADMIN_PASSWORD(cannot be the well-known default); otherwise the process refuses to start. Development may boot with an empty password for bootstrap tests; CI/dev tests setADMIN_PASSWORDso they do not leave the default password as a working admin.127.0.0.1). Override withADMIN_HOST. Sample compose no longer publishes:81.JWT secret persist is unchanged. Proxy/nginx behavior is unchanged. Not merged.
Reviewed against #2.
Bootstrap claim + middleware lock, leftover bootstrap JWTs stay mutating-403 after change-password, production first-boot refuses without ADMIN_PASSWORD and rejects the well-known default, admin bind is loopback, compose no longer publishes :81. Tests actually cover the lock, not just login. CI green. Merging.
Nit for next time, not blocking:
testLoginPassword/testAdminPasswordlive inbootstrap.goand ship in the production binary. Put test helpers in_test.go.