Repository navigation
Add management operations for agents, groups, roles and users - #130
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
🔀 Cross-SDK feature parity, ports raisedThis pull request is labelled Ports (DO NOT EDIT)
3 of 3 sibling SDKs accounted for. Every sibling SDK is accounted for. The contract is in the SDK development specification. |
This was referenced Oct 22, 2026
brionmario
force-pushed
the
feat-cp-dp-separation
branch
from
October 22, 2026 11:33
5bb8d0d to
51f46d4
Compare
This was referenced Oct 22, 2026
brionmario
force-pushed
the
feat-cp-dp-separation
branch
from
October 26, 2026 11:53
b0ab054 to
176bef6
Compare
brionmario
force-pushed
the
feat-cp-dp-separation
branch
from
October 26, 2026 12:29
176bef6 to
51d9190
Compare
Adds group and role management to the JavaScript SDKs alongside the existing user and agent operations: list, get, create, update and delete, group members and role assignments, agent and user groups and roles, and agent types. endpoints.groups, endpoints.roles and endpoints.agentTypes join the management endpoint keys. getTokenPermissions() and hasPermission() read the permissions an access token grants and match them the way the server does. React and Vue gain query and mutation hooks and composables for every resource, useGrantedPermissions(), and admin components for users, groups, roles and agents (list, create, details, members, permissions and assignments), each with a Base variant and render props that let any UI library draw them. UserList and AgentList search on the server, and RoleAssignments filters by assignee type. A DataTable primitive and an Attribution component are added. Next.js relays management calls through server actions, Nuxt adds a management module option and relay route, Node and Express bind management operations to a session, and the router packages add admin routes. The admin strings are translated in every locale. The code is now grouped by function instead of by kind: components into auth (with buttons, flow and guards), account, admin and common; APIs, hooks, composables and server actions into auth, account and management. Every package exports the same names as before. The playgrounds exercise the new APIs, including custom rendering with MUI and PrimeVue. Refs thunder-id/thunderid#5162 Signed-off-by: Brion <info@brionmario.com>
brionmario
force-pushed
the
feat-cp-dp-separation
branch
from
October 26, 2026 12:42
51d9190 to
7831300
Compare
5 of 12 tasks
DonOmalVindula
approved these changes
Oct 27, 2026
This was referenced Oct 27, 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.
Purpose
Adds agent, group, role and user management to the JavaScript SDKs: the management operations, the hooks and composables over them, and admin components for each. Roles carry their permissions, and the SDKs can read the permissions an access token grants to decide what to show.
Approach
endpoints.groups,endpoints.rolesandendpoints.agentTypesjoin the existing management keys. A collection URL resolves from the call'surl, thenendpoints.<key>, then{baseUrl}/{collection}.@thunderid/javascript:getTokenPermissions()andhasPermission(): read the permissions an access token grants and match them the way the server does (system:usercoverssystem:user:view).createResourceInvalidatormoves here from@thunderid/react.resolveManagedIdentityNameandtoManagementErrorMessageare new.@thunderid/reactand@thunderid/vue:useGrantedPermissions().Base*variant.UserListandAgentListsearch on the server (users by username or email, agents by name), andRoleAssignmentsfilters by assignee type. The server matches one attribute exactly, so the search applies on submit.getAgentsgainsfilter, andtoEqualityFilterbuilds the expression. Groups, roles and group members have no server filter, so they stay unfiltered.SignIn: achildrenfunction in React and the default scoped slot in Vue receive the data, loading and error state, and handlers, so the UI can come from any library. A list hands over its rows, defaultcolumns,limit,offset,totalResults,onPageChangeandonSelect, enough to drive a third-party data grid with server-side paging; a form hands overvalues,handleInputChange,handleSubmitandisValid.DataTableprimitive and anAttributioncomponent.@thunderid/nextjs: the admin components and hooks, with management calls relayed through server actions (managementRequestAction,getGrantedPermissionsAction), so the browser never calls the management API or holds the token.@thunderid/nuxt: amanagementmodule option that auto-imports the admin components and composables, and a/api/auth/managementroute that relays management calls.@thunderid/nodeand@thunderid/express:client.management(sessionId)andmanagementFromRequest(req)bind management operations to a session. The session's token stays on the server and is read on every call.@thunderid/react-routerand@thunderid/tanstack-router: admin routes (createAdminRoutes,AdminPage).auth/(withbuttons/,flow/andguards/),account/,admin/andcommon/, andprimitives/is unchanged. APIs, hooks, composables and Next.js server actions are inauth/,account/andmanagement/. Every package exports the same names as before.Related Issues
Related PRs
b2b/manage) should adopt these agent operations and admin components, and show groups and roles, once this ships; that follows as its own samples pull request.Playgrounds
Every playground exercises the new APIs:
DataTableandAttributionstories with sample data and live variantsUserListas an MUI DataGrid,GroupCreateas an MUI form andUserDetailsas an MUI card in React and Next.js, and the same with PrimeVue in Vue and Nuxt (playground-only dependencies)They read
THUNDERID_ENDPOINT_<KEY>(withVITE_orNUXT_PUBLIC_where the framework needs it) to override one management collection's URL. The server playgrounds show management calls going through the server. The SDK gaps the playgrounds hit are listed in each README.Screenshots
From the React playground's component explorer, with sample data.
Admin components, including the server-side search and the assignee type filter:
Custom rendering through render props, drawn with MUI. Each admin component has a Custom (MUI) story; the Code tab shows the render function:
Vue, through the default scoped slot with PrimeVue:
Verified locally:
pnpm build(18/18) andpnpm testacross the packages (2,233 passed, 3 skipped).onPageChange.