Repository navigation
feat: one-time admin setup, admin-only password login and account administration - #119
Merged
Merged
Conversation
…inistration Schema 13 adds admin, setup, disabled-account, Google identity and invite tables. Startup logs a hashed 24h setup link while no admin exists. Password login is admin only; admin routes list, disable, enable and delete accounts. Removes public signup, env bootstrap and user create.
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.
Stack 1/3: one admin, admin-only password sign-in, account administration.
identityserviceowns admin setup and administration rules;reviewstorepersists them. While no admin exists, each start stores a hashed one-time setup secret (24h, replaced on restart) and logs<public URL>/setup#t=…. Setup creates the single admin in one transaction. Password login (/admin/login, unlinked) is admin only; refusals are the same 401. Admin routes list, disable, enable and delete accounts (/api/v2/admin/users*); the admin cannot disable or delete itself. Disabling revokes sessions and tokens in the same transaction; deleting removes the account's data and queued jobs; both evict running services. Removed: public signup,DIFFX_SERVER_USERNAME/PASSWORD/SIGNUP_ENABLEDbootstrap,diffx-server user create.user reset-passwordrecovers only the admin. Web:/setupand/admin/loginpages; members see a not-yet-available sign-in notice; password settings admin only.admin_account,admin_setup,disabled_accounts,google_identities,account_invites,google_auth_states); 11 and 12 upgrade in place. OpenAPI: signup removed;/api/v2/setupGET/POST; admin user routes;AccountUser.admin;Bootstrap.googleEnabledreplacessignupEnabled. NewDIFFX_SERVER_PUBLIC_URL/--public-url. Local mode unaffected (googleEnabledfalse, no account pages).mise run checkand the pre-push suite pass. Store tests: setup once, expiry, concurrent setup yields one admin, disable/delete. Transport tests: setup flow, admin-only login, admin routes require admin session and CSRF, restart persistence. Real-binary script (18 checks): link logged/rotated/hashed/single use, signup gone, self-disable 403, no link once an admin exists, reset-password. Risk: a reload of/setupafter the fragment is read loses the token (the link still works).testsupportgains identity helpers (boundary rule updated). Docs:system.md,architecture.md,development.md,release.md, docs site./setupstrips the secret from the URL before any request; checked in the browser on desktop; uses existing auth page layout and form primitives.