Repository navigation
Complete the management API functions and add application components - #139
Open
brionmario wants to merge 1 commit into
Open
brionmario wants to merge 1 commit into
brionmario wants to merge 1 commit into
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. |
brionmario
force-pushed
the
feat-management-api-functions
branch
2 times, most recently
from
October 27, 2026 12:57
106e0c7 to
e12badb
Compare
brionmario
force-pushed
the
feat-management-api-functions
branch
from
October 27, 2026 17:44
e12badb to
faed176
Compare
This was referenced Oct 27, 2026
4 of 12 tasks
brionmario
force-pushed
the
feat-management-api-functions
branch
from
October 27, 2026 18:04
faed176 to
4b70f50
Compare
brionmario
added a commit
to brionmario/ios-sdks
that referenced
this pull request
Oct 27, 2026
Brings the iOS SDK's management operations in line with the JavaScript SDK (thunder-id/javascript-sdks#139) and covers the rest of the management API: - An API error carries the server's error envelope as `serverError`. - Destructive operations take an `administrationMode`; `flow` runs the administration flow the server configures, through the new `client.administrationFlows` API. Suspend, unsuspend and unlock for users, agents and applications run only through their flows. - Every identity resource now has its five operations: user types, agent types, organization units (by id and by path, with their child units, users, groups and roles) and resource servers with their resources and actions. - User usages and credentials, users by organization unit path, sharing policies and overlay rules, client ID metadata document preview, and client, flow and agent secret regeneration. - The server's configuration resources: connections, flows and their versions, notification templates, design themes and layouts, translations, server configuration, gateways with their variables and secrets, server variables and secrets, configuration versions, and import and export. - ApplicationList, ApplicationCreate and ApplicationDetails in SwiftUI, with their Base variants and a `content` closure for a custom render. - Role and type getters request the display data like the others. Signed-off-by: Brion <info@brionmario.com>
brionmario
added a commit
to brionmario/android-sdks
that referenced
this pull request
Oct 27, 2026
Brings the Android SDK's management operations in line with the JavaScript SDK (thunder-id/javascript-sdks#139) and covers the rest of the management API: - An API error carries the server's error envelope as `serverError`. - Destructive operations take an `administrationMode`; `flow` runs the administration flow the server configures, through the new `client.administration` client. Suspend, unsuspend and unlock for users, agents and applications run only through their flows. - Every identity resource now has its five operations: user types, agent types, organization units (by id and by path, with their child units, users, groups and roles) and resource servers with their resources and actions. - User usages and credentials, users by organization unit path, sharing policies and overlay rules, client ID metadata document preview, and client, flow and agent secret regeneration. - The server's configuration resources: connections, flows and their versions, notification templates, design themes and layouts, translations, server configuration, gateways with their variables and secrets, server variables and secrets, configuration versions, and import and export. - ApplicationList, ApplicationCreate and ApplicationDetails in Compose, with their Base variants and a `content` lambda for a custom render. - Role and type getters request the display data like the others. Signed-off-by: Brion <info@brionmario.com>
brionmario
added a commit
to brionmario/flutter-sdks
that referenced
this pull request
Oct 27, 2026
Brings the Flutter SDK's management operations in line with the JavaScript SDK (thunder-id/javascript-sdks#139) and covers the rest of the management API: - An API error carries the server's error envelope as `serverError`. - Destructive operations take an `administrationMode`; `flow` runs the administration flow the server configures, through the administration flow operations on the management client. Suspend, unsuspend and unlock for users, agents and applications run only through their flows. - Applications get list, get, create, update and delete, and every identity resource now has its five operations: user types, agent types, organization units (by id and by path, with their child units, users, groups and roles) and resource servers with their resources and actions. - User usages and credentials, users by organization unit path, sharing policies and overlay rules, client ID metadata document preview, and client, flow and agent secret regeneration. - The server's configuration resources: connections, flows and their versions, notification templates, design themes and layouts, translations, server configuration, gateways with their variables and secrets, server variables and secrets, configuration versions, and import and export. - ApplicationList, ApplicationCreate and ApplicationDetails widgets, with their Base variants and a `builder` for a custom render. - Role and type getters request the display data like the others. Signed-off-by: Brion <info@brionmario.com>
Apps that already own a data layer (TanStack Query, SWR, Pinia) call the management API functions from @thunderid/javascript, re-exported through browser, react and vue, and cache the results themselves. The per-resource React hooks and Vue composables (useGetUsers, useCreateGroup, ...) are removed; the connected admin components fetch through the internal generic query layer instead. Each exported function lives in its own file. - useManagementRequestConfig(collection) hands the API functions the provider's base URL, endpoint override and fetcher, so a call goes through the same transport as the components (the server action in Next.js, the module's proxy in Nuxt). - Every identity resource has full CRUD: applications, users, groups, roles, agents, user types, agent types, organization units (by id or by handle path) and resource servers with their resources and actions. Users and applications gain sharing policies and overlay rules. - Suspend, unsuspend and unlock run through their administration flows and fail with a documented error when no flow is configured. - The server's configuration resources are covered as well: connections, flows, notification templates, design themes and layouts, translations, server configuration, gateways, variables and secrets (write-only values), configuration versions, and import and export. - administrationMode: 'flow' runs the administration flow the server configures for deletes, member and assignment removal, permission removal and secret regeneration, and falls back to the direct call when none is configured. A refused step throws AdministrationFlowError. - Application list, create and details components for React, Vue, Next.js and Nuxt, with Base variants, a status column, and translations in every bundled locale. The OAuth form helpers they share live in @thunderid/javascript. - The Node management client and the Next.js and Nuxt relay allowlist cover applications. - ThunderIDAPIError carries the server's error envelope as serverError, so apps can resolve the server's error codes. - regenerateClientSecret refuses an application without an OAuth client instead of returning a secret it never saved, and regenerateAgentSecret restates the agent's delegated flag and leaves display-only fields out of the update. Application writes leave out the read-only status. - getRoles, getRole, getUserTypes and getAgentTypes request the display data like the other getters, so organization unit handles resolve. - Better Auth 1.7.13 for the Better Auth adapter, which fixes GHSA-965c-763c-88jm and GHSA-r4xp-prcw-77qf. Its provider config drops the `accountIssuer` that version removed and requires verified ID tokens. - The Nuxt module auto-imports useManagementRequestConfig and no longer registers composables that do not exist. Signed-off-by: Brion <info@brionmario.com>
brionmario
force-pushed
the
feat-management-api-functions
branch
from
October 27, 2026 20:16
4b70f50 to
86e4217
Compare
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
Make the management API usable from apps that already own a data layer, and cover all of it. The ThunderID Console fetches with TanStack Query, so it needs the SDK's management calls as plain functions it can put inside its own
queryFn/mutationFn, with its own cache keys and invalidation. Its lists then feed the SDK'sBase*admin components through their render props.The per-resource hooks (
useGetUsers,useCreateGroup, ...) duplicated what any data library already does and had no real users outside the SDK's own components, so they are no longer public. The connected admin components (UserList,GroupMembers, ...) keep working unchanged for apps without a data layer.Approach
API functions are the public surface. They live in
@thunderid/javascriptand are re-exported through browser, react and vue. Each takes aManagementRequestConfig(baseUrl,url,fetcher).useManagementRequestConfig(collection)(React, Vue, Next.js) returns the provider's base URL, the endpoint override for that collection, and the fetcher. A call therefore uses the same transport as the components: the server action in Next.js, the module's proxy in Nuxt. In React the config is memoized, so it can sit in a dependency list.Internal data layer. The connected components inline their queries and mutations on the generic
useResourceQuery/useResourceMutation/useManagementEndpoint. Query keys and invalidation are the same as the removed hooks had, and no per-resource hook files remain.Administration flows.
administrationMode: 'flow'(default'native') runs the administration flow the server configures for these operations:The flow is resolved from
/server-config/flowand/flows?flowType=ADMINISTRATION. When no flow is configured, the call goes direct. A configured but missing flow, or a refused or incomplete step, throwsAdministrationFlowErrorcarrying the step's error.New functions:
getUserUsages,updateUserCredentialsgetUserType,createUserType,updateUserType,deleteUserTypegetAgentType,updateAgentTypepreviewCimdDocument,regenerateClientSecret,regenerateFlowSecretregenerateAgentSecretgetUserTypesis now re-exported from react and vue too.Full coverage of the management API. Every identity resource has list, get, create, update and delete:
getOrganizationUnitByPath), with their child units, users, groups and rolesUsers and applications gain sharing policies and overlay rules. Suspend, unsuspend and unlock run only through their administration flows (
runAccountLifecycleFlow) and fail with a documented error when no flow is configured.Configuration resources. Connections, flows, notification templates, design themes (
*DesignTheme*, sincecreateThemealready exists) and layouts, translations, server configuration, gateways, variables and secrets, configuration versions, and import and export. A secret's value is write-only.Application components.
ApplicationList,ApplicationCreateandApplicationDetailsfor React, Vue, Next.js and Nuxt, each with aBasevariant and a custom render. The list shows a translated status column when the server returns one. Their strings (admin.applications.*) are in every bundled locale. The OAuth form helpers they share (getApplicationOAuthConfig,parseRedirectUris,toCreateApplicationRequest, ...) live in@thunderid/javascript, one per file. Application writes leave out the read-onlystatus.Server side. The Node management client gains an
applicationsgroup, and the Next.js and Nuxt relay allowlist accepts theapplicationscollection. CIMD preview is a direct server call and stays off the relay allowlist.Server error codes.
ThunderIDAPIError.serverErrorcarries the server's error envelope (code,message,descriptionwith params), so an app can show the server's translated error.Secret regeneration:
regenerateClientSecretrefuses an application without an OAuth client (regenerateClientSecret-ValidationError-001), rather than returning a secret it never saved.regenerateAgentSecretrestates the agent'sdelegatedflag, derived from its grant types, because the server doesn't store it. It also leaves the display-onlyouHandleout of the update.One function per file: each administration flow function (
runAdministrationFlow,executeAdministrationFlow,resolveAdministrationFlowId, ...) has its own module underapi/management/administration/, and the playground data layers are split the same way.Display data:
getRoles,getRole,getUserTypesandgetAgentTypesnow sendinclude=display, like the other getters, so organization unit handles resolve.Nuxt: the module auto-imported composables that
@thunderid/vueno longer exports, which would fail an app's build. It now auto-importsuseGrantedPermissionsanduseManagementRequestConfig. A test checks that every auto-imported name is exported.Better Auth: the adapter moves to Better Auth 1.7.13, which fixes GHSA-965c-763c-88jm and GHSA-r4xp-prcw-77qf, the two advisories failing
pnpm audit. That release dropsaccountIssuer, so the provider config leaves it out; a discovery provider uses the discovered issuer anyway. It now setsrequireIdTokenVerification, so the provider isn't registered when discovery can't supply the issuer and keys to verify ID tokens.Playgrounds: the React, Vue, Nuxt and Next.js playgrounds now demonstrate the API functions with a small local data helper.
Related Issues
Related PRs
SDK parity
Checklist
breaking changelabel added.parity/prs-raisedorparity/prs-not-neededadded.parity/prs-raised, the port links are posted as a reply on the parity check's comment.Security checks