Skip to content

feat(oauth): return saved credential IDs from v8 login status - #168

Open
JustYannicc wants to merge 2 commits into
router-for-me:devfrom
JustYannicc:feat/login-account-id
Open

JustYannicc wants to merge 2 commits into
router-for-me:devfrom
JustYannicc:feat/login-account-id

Conversation

@JustYannicc

Copy link
Copy Markdown

Home returns only {"status":"ok"} after OAuth login, so management clients must diff the credential list to identify what was saved. GET /v8/management/oauth/status?state=... now returns auth_id for a single credential and auth_ids for all credentials saved by the session.

The result is stored atomically with the credentials and remains readable from other Home nodes for the existing one-minute completion TTL. Pending session secrets are cleared. Plugin completion uses the same response, including its first successful poll. The v0 response stays unchanged. English and Chinese Management API docs are updated.

Example for a single-credential login:

{"status":"ok","auth_id":"credential-uuid","auth_ids":["credential-uuid"]}

Validation with Go 1.27.3:

  • go test -p 2 ./internal/cluster/... ./internal/managementhttp -count=1 passes.
  • go build -o test-output ./cmd/home passes.
  • Tests cover persisted IDs, another Home handler, repeat polls, channel-group assignment, multiple credentials, the first plugin-success poll, cancellation, rollback, expiry, and the v0 response.

No live provider login or PostgreSQL deployment was tested.

@JustYannicc

Copy link
Copy Markdown
Author

The pr-test-build run ended with action_required before starting any jobs. Could a maintainer approve this fork's workflow run?

The cluster and management tests and Home build pass locally at 80cc58b. The PostgreSQL CI job has not run yet.

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.

1 participant