docs: address auth-flows review, reorganize subject docs, and fix accuracy#54
Conversation
Address review feedback from emsearcy on PR #20: - access_token_mgmt_self uses update:current_user_metadata (self-service), not update:users; removed the orphan asterisk #20 (comment) - Auth Service M2M client now holds create/read/update/delete:users; updated the client description, security consideration, and Flow A diagram #20 (comment) Issue: LFXV2-888 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Relocate username_lookups, alias, password_management, and impersonation docs into docs/subjects/ alongside the other NATS subject docs. This fixes the previously broken sibling links from identity_linking.md and user_emails.md, and corrects relative paths to the internal/ READMEs. Issue: LFXV2-888 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Clarify that the user_emails.read auth_token field accepts either a verified JWT/Authelia token or a subject identifier (Auth0 sub containing "|", or an Authelia UUID) used directly via the service M2M token. Issue: LFXV2-888 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
…note Remove the inaccurate "usernames" input type and the stale "only supported for Authelia" note; user_emails.read accepts a JWT token or a subject identifier and is exercised on the Auth0 provider. Issue: LFXV2-888 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
- email_verification: correct error string to "email already linked" - auth-flows: distinguish update:current_user_metadata (C) from update:current_user_identities (D, E); clarify Flow D link payload/endpoint and Flow E subjects; note conceptual audience labels - README: replace duplicated per-subject lists with a link directory so docs/ remain the single source of truth Issue: LFXV2-888 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughRefactors documentation: consolidates operations into a linked overview, clarifies auth-flow diagram tokens and NATS subjects, updates M2M scopes and token scope descriptions, standardizes email-verification errors, expands user_auth_token acceptance notes, and fixes relative cross-document links. ChangesDocumentation Clarification and Link Path Corrections
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Follow-up documentation cleanup after the auth-flows docs merge, aimed at improving accuracy and reducing drift by consolidating subject-operation references into the docs/ directory.
Changes:
- Replaced the README’s per-subject operation lists with a directory of links into
docs/subjects/. - Updated subject docs and auth-flow diagrams for corrected scopes, subjects, and error strings; fixed internal relative links after reorganizing subject docs.
- Added/organized subject documentation pages (e.g., impersonation) and clarified request payload expectations in a few subject docs.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Replaces expanded “Available Operations” content with a link directory to subject docs and auth-flows. |
| docs/subjects/username_lookups.md | Updates relative link to internal Authelia README after moving into docs/subjects/. |
| docs/subjects/user_emails.md | Clarifies user.auth_token accepted inputs and adds examples; updates relative link to internal Auth0 README. |
| docs/subjects/password_management.md | Fixes internal Auth0 README relative links after moving into docs/subjects/. |
| docs/subjects/impersonation.md | Adds documentation for the impersonation token exchange subject, payload, and behavior. |
| docs/subjects/email_verification.md | Updates documented error string to match the service’s surfaced validation message. |
| docs/subjects/alias.md | Fixes internal Auth0 README relative link after moving into docs/subjects/. |
| docs/auth-flows/README.md | Updates token/scope descriptions and security notes to reflect current behavior and terminology. |
| docs/auth-flows/E-passwordless-email-linking.md | Updates diagram steps to reference literal NATS subjects for email verification flow. |
| docs/auth-flows/D-social-identity-linking.md | Updates diagram steps to reference literal NATS subjects and clarifies link payload details. |
| docs/auth-flows/A-auth-service-m2m-profile-lookup.md | Adjusts diagram annotation around M2M token usage in Flow A. |
Comments suppressed due to low confidence (1)
docs/subjects/username_lookups.md:53
- The notes imply this operation “works with Auth0, Authelia, and mock repositories based on configuration” and that the returned value is the canonical user identifier. However, the handler for
lfx.auth-service.username_to_subis deterministic and always returns an Auth0-stylesub(auth0|...) without consulting any configured provider, so this is not a canonical Authelia UUID in Authelia deployments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Fayaz G. <5818912+fayazg@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/auth-flows/README.md (1)
48-49: 💤 Low valueClarify the actual JWT audience values for reference.
The note explains that
auth0_mgmtandlfxv2are conceptual labels. While the Management API URL format is shown forauth0_mgmt, consider adding a concrete example for clarity.📝 Suggested enhancement
-> **Note:** `auth0_mgmt` and `lfxv2` are conceptual audience labels used throughout these docs. The actual JWT `aud` claim is the Auth0 Management API URL (`https://{domain}/api/v2/`) for `auth0_mgmt`, and the configured LFX v2 API audience for `lfxv2`. +> **Note:** `auth0_mgmt` and `lfxv2` are conceptual audience labels used throughout these docs. The actual JWT `aud` claim is the Auth0 Management API URL (e.g., `https://sso.linuxfoundation.org/api/v2/`) for `auth0_mgmt`, and the configured LFX v2 API audience (e.g., `https://api-gw.platform.linuxfoundation.org`) for `lfxv2`.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/auth-flows/README.md` around lines 48 - 49, Update the note clarifying the conceptual labels 'auth0_mgmt' and 'lfxv2' by adding concrete example JWT aud values for each (e.g., for auth0_mgmt show a fully-formed Management API audience like "https://your-auth0-domain.example/api/v2/" and for lfxv2 show a sample configured API audience like "https://api.lfx.example/v2" or "lfx-v2.example.com"), so readers can see exact formats to expect when inspecting tokens; keep the original sentence but append these example audience strings for clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/auth-flows/README.md`:
- Around line 48-49: Update the note clarifying the conceptual labels
'auth0_mgmt' and 'lfxv2' by adding concrete example JWT aud values for each
(e.g., for auth0_mgmt show a fully-formed Management API audience like
"https://your-auth0-domain.example/api/v2/" and for lfxv2 show a sample
configured API audience like "https://api.lfx.example/v2" or
"lfx-v2.example.com"), so readers can see exact formats to expect when
inspecting tokens; keep the original sentence but append these example audience
strings for clarity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 02b4ccaa-3ea1-43d9-ac09-50a9cf4f9593
📒 Files selected for processing (11)
README.mddocs/auth-flows/A-auth-service-m2m-profile-lookup.mddocs/auth-flows/D-social-identity-linking.mddocs/auth-flows/E-passwordless-email-linking.mddocs/auth-flows/README.mddocs/subjects/alias.mddocs/subjects/email_verification.mddocs/subjects/impersonation.mddocs/subjects/password_management.mddocs/subjects/user_emails.mddocs/subjects/username_lookups.md
Address review comments from copilot-pull-request-reviewer: - docs/subjects/user_emails.md: document authorization/trust constraints for the subject-identifier (no-token) mode of user.auth_token - README.md: confirmed subject doc links now resolve under docs/subjects/ (files were moved; no change needed) Resolves 2 review threads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Review Feedback AddressedCommit: 408b5a3 Changes Made
No Change Needed
Threads Resolved2 of 2 unresolved threads addressed in this iteration. |
Resolve docs/subjects/user_emails.md conflict: keep the detailed set_primary preservation note from main (PR #56) over the prior one-line wording. The README link depth (../../) already matched on both sides; PR #54's auth_token subject-identifier docs are retained. Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Merged
|
Address review comments from copilot-pull-request-reviewer: - docs/subjects/email_verification.md: the conflict error was documented as the fixed string "email already linked", but it is provider-specific (the mock provider returns "alternate email already linked"). Add a note under both "Email Already Linked" error replies that the error text is a human-readable diagnostic, not a stable contract, and consumers should branch on the success flag; note the mock variant in the Mock provider section. Resolves 2 review threads. Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Review Feedback AddressedCommit: Changes Made
Threads Resolved2 of 2 review threads addressed and resolved. Chose a doc-only clarification over normalizing the mock's error string — the mock's more specific message is useful, and changing a test double's behavior is out of scope for a docs PR. |
Address review comment from copilot-pull-request-reviewer: - docs/auth-flows/README.md: the Token Overview listed access_token_m2m_read with only read:users, contradicting the client description and Security Considerations (which grant create/read/update/delete:users). The M2M token is requested without a scope param, so it carries all granted scopes; update the Scope cell to list them and note Flow A uses read:users, matching the Flow A diagram. Resolves 1 review thread. Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Review Feedback AddressedCommit: Changes Made
Threads Resolved1 of 1 review thread addressed and resolved. |
Summary
Follow-up documentation cleanup after PR #20 (auth-flows docs) merged. Pure docs — no code changes.
Address @emsearcy's review on PR [LFXV2-888] Auth flows docs #20 (
docs/auth-flows/):access_token_mgmt_selfscope corrected toupdate:current_user_metadata(was
update:users*with an orphan asterisk).the Flow A diagram to reflect that the Auth Service M2M client holds
create/read/update/delete:users(Flow A still performs only reads).Reorganize subject docs — moved
username_lookups.md,alias.md,password_management.md, andimpersonation.mdintodocs/subjects/alongsidethe other NATS subject docs (via
git mv, history preserved). Fixes previouslybroken sibling links from
identity_linking.mdanduser_emails.md, and correctsrelative paths to the
internal/READMEs.Document
user_emails.readinput — theauth_tokenfield accepts a verifiedJWT/Authelia token or a subject identifier (Auth0
subwith|, or Authelia UUID).Also corrected the top-level README (dropped the inaccurate "usernames" input and the
stale "Authelia-only" note).
Docs-vs-code accuracy audit (full sweep of all docs against the handlers,
providers, and
pkg/constants):email_verification.md: corrected error string toemail already linked.auth-flows: distinguishedupdate:current_user_metadata(Flow C) fromupdate:current_user_identities(Flow D, E); clarified Flow D's linkpayload/endpoint and Flow E's literal subjects; noted that
auth0_mgmt/lfxv2are conceptual audience labels.
De-duplicate the README — replaced the per-subject lists in "Available
Operations" with a link directory, so
docs/(andpkg/constants/subjects.go)remain the single source of truth and the README can't drift out of date.
Test plan
docs/resolve (full scan, 0 broken)pkg/constants);two agent false positives (indexer-contract, user_metadata username search)
confirmed accurate and left unchanged
Refs LFXV2-888
🤖 Generated with Claude Code