You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/09/17 14:01:00 UTC
[jira] [Commented] (OFBIZ-13440) Add support for multiple, independent REST-APIS in one OFBIz instance
[ https://issues.apache.org/jira/browse/OFBIZ-13440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116352#comment-18116352 ]
ASF subversion and git services commented on OFBIZ-13440:
---------------------------------------------------------
Commit 8839dbeeb70fde1cc067726e76d8ebd28c074399 in ofbiz-framework's branch refs/heads/trunk from Lukas-Finster
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=8839dbeeb7 ]
Implemented: Support for independent rest-apis (OFBIZ-13440) (#1790)
> Add support for multiple, independent REST-APIS in one OFBIz instance
> ---------------------------------------------------------------------
>
> Key: OFBIZ-13440
> URL: https://issues.apache.org/jira/browse/OFBIZ-13440
> Project: OFBiz
> Issue Type: Sub-task
> Components: rest-api
> Affects Versions: Upcoming Branch
> Reporter: Michael Brohl
> Assignee: Lukas Finster
> Priority: Major
>
> In more complex project scenarios, it can be necessary to host more than one independent REST API with different credentials, authorization rules, and security groups.
> Typical examples include connecting different applications or external integrations, where each integration should have its own API boundary and security configuration.
> Each independent REST API should have:
> Its own API group and routing context.
> Its own configurable authorization/security groups.
> A separate verification/authentication endpoint, where required.
> Its own OpenAPI specification containing only the endpoints belonging to that API.
> Its own Swagger UI displaying only the endpoints belonging to that API.
> A clearly distinguishable URL structure.
> Proposal
> The REST API plugin in its current form is well suited for this improvement. A first implementation plan looks roughly as follows.
> 1. Introduce apiGroup in rest.xml
> Add a new apiGroup parameter at the <api> level in rest.xml.
> The apiGroup parameter defines the logical API to which the REST endpoints belong and effectively replaces the current <api>-level path as the mechanism for separating API groups.
> For backwards compatibility, <api> definitions that do not explicitly declare an apiGroup should be assigned a default group, for example:
> api
> This allows the available REST endpoints to be separated into independent API groups without requiring every existing API definition to be changed.
> For example, suppose the current endpoints are:
> /rest/users
> /rest/users/1000
> /rest/products/create-product
> /rest/testService
> We now want to separate the user- and product-related endpoints.
> This could be achieved by defining the corresponding apiGroup values in rest.xml:
> apiGroup="usermanagement"
> apiGroup="webshop"
> The resulting endpoints would become:
> /rest/usermanagement/users
> /rest/usermanagement/users/1000
> /rest/webshop/products/create-product
> /rest/api/testService
> testService has no explicitly defined apiGroup and therefore remains in the default api group.
> This provides a clear routing boundary between the different APIs.
> 2. API-specific authentication and authorization
> The separation of API groups should also allow authentication and authorization to be configured independently.
> For example, instead of having one universal authentication endpoint:
> /rest/auth/token
> an authentication endpoint could be provided for each API group:
> /rest/usermanagement/auth/token
> /rest/webshop/auth/token
> /rest/api/auth/token
> Each API group could then be associated with its own configurable security groups and credentials.
> Alternatively, the existing authentication service could remain centralized and accept an optional apiGroup parameter when generating a token.
> For example:
> /rest/auth/token?apiGroup=usermanagement
> /rest/auth/token?apiGroup=webshop
> This would retain a single authentication endpoint while still allowing generated tokens to be associated with a specific API group.
> 3. API-specific OpenAPI specifications
> Each API group should have its own OpenAPI specification.
> For example:
> /rest/usermanagement/openapi.json
> /rest/webshop/openapi.json
> /rest/api/openapi.json
> The generated specification should contain only the REST resources belonging to the corresponding API group.
> This is an important distinction from simply hiding endpoints in Swagger UI. The OpenAPI document itself should represent the API boundary.
> Conceptually:
> /rest/usermanagement/openapi.json
> only usermanagement schemas/operations
> /rest/webshop/openapi.json
> This separation should be implemented at the OpenAPI generation level and NOT!! by filtering the final JSON response.
> 4. API-specific Swagger UI
> Swagger UI should be relatively straightforward to adapt.
> Currently, navigating to something such as:
> .../docs/swagger-ui.html
> causes Swagger UI to request the OpenAPI specification, for example:
> /rest/openapi.json
> The OpenAPI resource then generates/returns the specification.
> With API groups, Swagger UI could instead be associated with a specific API group:
> .../docs/usermanagement/swagger-ui.html
> .../docs/webshop/swagger-ui.html
> which would load:
> /rest/usermanagement/openapi.json
> /rest/webshop/openapi.json
> Each Swagger UI would therefore display only the endpoints belonging to its respective API group.
> The Swagger UI itself does not need to contain the API-group logic; it simply needs to be configured to load the appropriate OpenAPI specification.
> 5. Routing context
> The API group should be distinguishable through its routing context.
> For example:
> /rest/usermanagement/...
> /rest/webshop/...
> /rest/api/...
> This provides a clear and consistent boundary between APIs and makes them possible to independently configure
--
This message was sent by Atlassian Jira
(v8.20.10#820010)