Implemented: Support for independent rest-apis (OFBIZ-13440) - #1790
Implemented: Support for independent rest-apis (OFBIZ-13440)#1790Lukas-Finster wants to merge 5 commits into
Conversation
|
Information regarding the changes: The structure of apis as independant endpoints was mostly already present, More specific: The only necessary change to allow grouping apis was thus, to allow apis to define the same Note that until here, there is no functional change to how the rest-api works, its only organization so far. Next i restructured existing apis and introduced "api" as the default api group for ofbiz-native apis. That means if an endpoints was previously available at: I implemented an authorization check based on the apiGroup. The apiGroupPath ist then added to the claims of the token issued. Regarding SwaggerUI: Now a filter intercepts all calls to the swagger webapp and checks wether an explicit apiGroupPath is provided, swagger-ui.html itself does a call to rest/openapi.json where the swaggerUI is constructed. I did intentionally NOT gate the swaggerUi itself. |
b8836e9 to
2c9aa11
Compare
(OFBIZ-1344) Previously, each ModelApi defined via rest.xml was treated as an independent API, reachable at mountpoint/<api-path>/<other-path-segments>. This refactoring renames the path element to apiGroupPath and allows multiple APIs to define a common apiGroupPath. APIs with a common apiGroupPath therefore necessarily share their first path segment and form a logical unit.
* Currently rest-api authorization is independant of the invoked endpoint. With this feature, authorization (SecurityPermissions check, token issuing & validation) becomes api specific, allowing the definition of SecurityGroups on a per api basis. Tokens now contain their apiGroupName to determine wether a token was issued for this api or another
* Swagger UI now filters its api groups. A new api group is now reachable under .../docs/<apiGroupPath>/swagger-ui.html If <apiGroupPath> is ommited, it defaults to api, the default apiGroupPath. For Backward compatability, the UI can still be reached under .../docs/swagger-ui.html or .../docs where it will display all apis belonging to group api. Note that endpoints provided via Resources are not affected by this filtering.
of the apiGroup "api" (OFBIZ-13440) * Moves the current endpoint of ofbiz apis down one path element (e.g. .../rest/production-runs/facilities -> .../rest/api/production-runs/facilities). Updates swagger documentation and renames restExampleApiDefinitions to testApi. Define testApi as part of its own api group test-api
2c9aa11 to
ee31414
Compare
|
Hi @Lukas-Finster, |
No description provided.