Feat/account#175
Merged
duguwanglong merged 6 commits intomainfrom Apr 24, 2026
Merged
Conversation
- Add login/setup-admin/force-change-password pages and auth-guarded routing - Rewrite AdminUsers page with self-service password reset - Integrate require_user guard into session routes Made-with: Cursor
…175 follow-up) - Make /api/channel/{channel_id}/webhook public via PUBLIC_PATH_REGEXES so external IM platforms (DingTalk / WeCom / Feishu) can deliver callbacks without 401; plugin handle_webhook retains full signature validation ownership and no synthetic admin user is injected. - Add AuthService.reassign_orphan_sessions and `flocks admin reassign-orphan-sessions` CLI to backfill empty owner_user_id on sessions created by CLI / background / inbound dispatchers, so later-added member accounts can still see them. - Document remote-TUI / SDK API-token flow, reverse-proxy X-Forwarded-For requirement, and one-time-password operational caveats in README.md / README_zh.md (new section 4.4). - Add unit coverage for the webhook regex, the channel-webhook no-credentials passthrough, and the reassign helper (dry-run, role guard, orphan filter). Made-with: Cursor
Driven by a deeper second pass over the previous fix:
- AuthService.reassign_orphan_sessions now wraps each Session.update in
its own try/except, returning a new ``failed`` counter so a single
storage error no longer aborts the whole pass.
- ``flocks admin reassign-orphan-sessions`` drops the duplicated admin
pre-check (single-sourced in the service layer via ValueError),
removes the misleading ``# noqa: UP006`` annotation and the
``{"role": -1}`` magic sentinel, surfaces ``failed`` in the CLI
output, and exits with code 2 when any update failed so CI / scripts
can react.
- PUBLIC_PATH_REGEXES uses a non-capturing ``(?:api/)?`` group and
documents (a) the built-in DingTalk / WeCom plugins still run in
stream mode (so the webhook entrypoint is for external / custom
plugins only) and (b) a TODO to add the provider OAuth-callback path
once it leaves stub state.
- README.md / README_zh.md §4.4 distinguishes server-side
``generate-api-token`` (persists on the server) from client-side
``set-api-token`` (writes the same token into the client's local
secret store), adds a curl smoke test, calls out the built-in webhook
caveat, and documents the new ``failed`` counter / exit-code-2
behaviour.
- Add a partial-failure unit test (one orphan raises mid-loop, the
other two still get rewritten) and update the existing dry-run /
rewrite assertions for the new ``failed`` field.
Made-with: Cursor
duguwanglong
approved these changes
Apr 24, 2026
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.
add account login module and auth module