feat(modules): RequireModule middleware to gate route groups #98
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ref: docs/MODULES.md §4, §3, §11 step 5
Implement
RequireModulemiddleware and wrap each optional module's route group.Middleware behavior:
When a module is disabled, all its routes return
404with{"error": "module '<id>' is not enabled"}.Route groups to wrap (per §3):
auth— login/logout, OIDC callbacks,/api/auth/*, settings token routesprojects—/api/projects/*, item-project tagging endpointsaudit—/api/audit/*odoo—/api/integrations/odoo/*jobs—/api/jobs/*,/api/job-definitions/*,/api/runners/*,/api/runner/*dag—/api/items/{partNumber}/dag/*freecad— no routes currently, but future-proofedWhen
authis disabled:All routes are open and a synthetic
devadmin user is injected (existing behavior).Additional disabled-module behavior:
Depends on #96.