Files
wmantly f4efdfb957 Release 1.3.0: adopt shared @simpleworkjs/* packages; fix LDAP filter injection
Rewire onto the shared @simpleworkjs/oidc-client, /ldap, and /app-stack
packages (deleting the byte-identical local forks of the same code), close the
LDAP filter-injection in User.get by routing the username through escapeFilter
(RFC 4515), align model-redis ^1.6.0 and ldapts ^8.1.8, and unify build_info to
{buildVersion, buildHash, buildYear}. package-lock regenerated from the npm
registry (no file:/link:), so npm ci is clean in docker builds.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-25 15:53:30 -04:00

36 lines
1.5 KiB
JavaScript

'use strict';
const router = require('express').Router();
const conf = require('@simpleworkjs/conf');
const middleware = require('../middleware/auth');
const authz = require('../middleware/authz');
// API routes for authentication.
router.use('/auth', require('../models').authRouter);
// API routes for working with users. All endpoints need to be have valid user.
// User management is admin-only; the router allows self-service exceptions
// (GET /me, PUT /password) before its own admin gate.
router.use('/user', middleware.auth, require('./user'));
// API routes for working with hosts. All endpoints need to be have valid user.
// Per-domain authorization is enforced inside the host router.
router.use('/host', middleware.auth, require('./host'));
router.use('/dns', middleware.auth, require('./dns'));
// API routes for working with hosts. All endpoints need to be have valid user.
router.use('/cert', middleware.auth, require('./cert'));
// Permission management (who can manage which domains) is global-admin-only.
router.use('/permission', middleware.auth, authz.requireAdmin, require('./permission'));
// Local group management is global-admin-only.
router.use('/group', middleware.auth, authz.requireAdmin, require('./group'));
// Self-service API tokens (PATs) — owner-scoped, no admin gate required.
router.use('/api-token', middleware.auth, require('./api_token'));
router.use('/update-check', middleware.auth, require('./update_check'));
module.exports = router;