Skip to content

feat: extend authuser 3#8689

Open
mikeallisonJS wants to merge 10 commits intomainfrom
00-00-MA-feat-extend-authuser-3
Open

feat: extend authuser 3#8689
mikeallisonJS wants to merge 10 commits intomainfrom
00-00-MA-feat-extend-authuser-3

Conversation

@mikeallisonJS
Copy link
Collaborator

@mikeallisonJS mikeallisonJS commented Feb 4, 2026

Summary by CodeRabbit

  • Refactor

    • Authenticated user information is now consistently exposed across multiple backend services, enabling unified access to user identity and profile fields.
    • User export surface updated so authenticated user references can be resolved from different services.
  • New Features

    • Added a language "publisher" role to user profiles, exposing language-specific role information in the public API.

mikeallisonJS and others added 9 commits February 3, 2026 22:26
- Introduced the AuthenticatedUser type in both API schemas, enhancing user data representation.
- Implemented a resolver for AuthenticatedUser to handle user retrieval and fallback for missing first names.
- Updated user object exports to include AuthenticatedUser for better federation support.
- Added the AuthenticatedUser type to the API schemas, including fields for user details.
- Extended the AuthenticatedUser type to support federation with external services.
- Updated generated TypeScript definitions to reflect the new structure of AuthenticatedUser.
- Modified user-related GraphQL operations to incorporate the new AuthenticatedUser type.
- Updated the AuthenticatedUser type in the API schemas to include federation capabilities with the API_JOURNEYS_MODERN graph.
- Introduced a new external reference for AuthenticatedUser in the user schema to facilitate integration.
- Modified TypeScript exports to include the new AuthenticatedUser reference for improved type handling.
- Deleted the AuthenticatedUser type definition from the GraphQL schema to streamline user data representation.
- This change simplifies the API by removing unnecessary complexity related to user authentication details.
- Added languageUserRoles field to the AuthenticatedUser type in both schema.graphql and schema.graphql for API_LANGUAGES.
- Implemented resolver for languageUserRoles in the user schema to fetch user-specific language roles from the database.
- This update improves the user model by integrating language role management into the authentication process.
@mikeallisonJS mikeallisonJS requested a review from csiyang February 4, 2026 20:46
@mikeallisonJS mikeallisonJS self-assigned this Feb 4, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Walkthrough

Adds AuthenticatedUser as a federated entity across multiple subgraphs (API_JOURNEYS, API_JOURNEYS_MODERN, API_LANGUAGES, API_USERS), introduces LanguageRole enum in API_LANGUAGES, and wires externalRefs/implementations and _Entity updates so the gateway exposes the extended AuthenticatedUser type.

Changes

Cohort / File(s) Summary
API Gateway Schema
apis/api-gateway/schema.graphql
Replaced single-graph AuthenticatedUser with a multi-graph declaration: extended across API_JOURNEYS, API_JOURNEYS_MODERN, API_LANGUAGES, and API_USERS. Added/kept LanguageRole enum for API_LANGUAGES.
API Journeys Modern
apis/api-journeys-modern/schema.graphql, apis/api-journeys-modern/src/schema/user/index.ts, apis/api-journeys-modern/src/schema/user/user.ts
Added federated AuthenticatedUser type (@key, @extends) and external id. Exported AuthenticatedUserRef and implemented it as an externalRef.
API Journeys
apis/api-journeys/schema.graphql, apis/api-journeys/src/app/modules/userTeam/userTeam.graphql
Extended AuthenticatedUser with @key(fields:"id") and id: ID! @external``. Added AuthenticatedUser to the gateway `_Entity` union.
API Languages
apis/api-languages/schema.graphql, apis/api-languages/src/schema/user/user.ts
Added AuthenticatedUser external type with id: ID! @external`` and languageUserRoles: [LanguageRole!]!. Implemented externalRef and resolver to fetch language roles (reused User resolver logic).

Sequence Diagram(s)

mermaid
sequenceDiagram
rect rgba(52,152,219,0.5)
participant Client
end
rect rgba(39,174,96,0.5)
participant Gateway
end
rect rgba(231,76,60,0.5)
participant API_USERS
participant API_JOURNEYS
participant API_JOURNEYS_MODERN
participant API_LANGUAGES
end

Client->>Gateway: Query AuthenticatedUser (fields including languageUserRoles)
Gateway->>API_USERS: Resolve base AuthenticatedUser (id, user fields)
Gateway->>API_JOURNEYS_MODERN: Fetch/resolve AuthenticatedUser entity (id external)
Gateway->>API_JOURNEYS: Fetch/resolve AuthenticatedUser entity (id external)
Gateway->>API_LANGUAGES: Resolve languageUserRoles for AuthenticatedUser (by id)
API_LANGUAGES-->>Gateway: languageUserRoles
API_USERS-->>Gateway: user fields
API_JOURNEYS_MODERN-->>Gateway: entity reference
API_JOURNEYS-->>Gateway: entity reference
Gateway-->>Client: Aggregated AuthenticatedUser response

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • csiyang
  • tanflem
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat: extend authuser 3' is vague and uses a generic abbreviation that doesn't clearly convey the specific changes. The number suffix suggests it's part of a series without explaining the actual functionality. Consider a more descriptive title like 'feat: extend AuthenticatedUser across multiple federation graphs' that clearly explains what functionality is being added or modified.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 00-00-MA-feat-extend-authuser-3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Feb 4, 2026

View your CI Pipeline Execution ↗ for commit f679297

Command Status Duration Result
nx run player-e2e:e2e ✅ Succeeded 4s View ↗
nx run journeys-admin-e2e:e2e ✅ Succeeded 29s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 30s View ↗
nx run resources-e2e:e2e ✅ Succeeded 13s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 5s View ↗
nx run watch-e2e:e2e ✅ Succeeded 25s View ↗
nx run short-links-e2e:e2e ✅ Succeeded 6s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-02-04 21:07:42 UTC

@nx-cloud
Copy link

nx-cloud bot commented Feb 4, 2026

View your CI Pipeline Execution ↗ for commit f679297

Command Status Duration Result
nx run resources-e2e:e2e ✅ Succeeded 13s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 5s View ↗
nx run watch-e2e:e2e ✅ Succeeded 25s View ↗
nx run short-links-e2e:e2e ✅ Succeeded 6s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 14s View ↗
nx run-many --target=deploy --projects=journeys... ✅ Succeeded 2m 56s View ↗
nx run-many --target=vercel-alias --projects=watch ✅ Succeeded 2s View ↗
Additional runs (17) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-02-04 21:03:04 UTC

@nx-cloud
Copy link

nx-cloud bot commented Feb 4, 2026

View your CI Pipeline Execution ↗ for commit f679297


☁️ Nx Cloud last updated this comment at 2026-02-04 20:55:45 UTC

@github-actions github-actions bot requested a deployment to Preview - journeys-admin February 4, 2026 20:49 Pending
@github-actions github-actions bot requested a deployment to Preview - videos-admin February 4, 2026 20:49 Pending
@github-actions github-actions bot requested a deployment to Preview - short-links February 4, 2026 20:49 Pending
@github-actions github-actions bot temporarily deployed to Preview - resources February 4, 2026 20:49 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Thu Feb 5 09:57:52 NZDT 2026

@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 4, 2026 20:54 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 4, 2026 20:54 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys February 4, 2026 20:54 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin February 4, 2026 20:54 Inactive
@github-actions github-actions bot temporarily deployed to Preview - short-links February 4, 2026 20:54 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Thu Feb 5 09:56:36 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Thu Feb 5 09:56:49 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
short-links ✅ Ready short-links preview Thu Feb 5 09:57:03 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Thu Feb 5 09:57:27 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Thu Feb 5 09:57:59 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Thu Feb 5 09:58:46 NZDT 2026

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