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>
This commit is contained in:
+23
-4
@@ -1,18 +1,37 @@
|
||||
'use strict';
|
||||
const conf = require('@simpleworkjs/conf');
|
||||
const {setUpTable} = require('model-redis');
|
||||
const {createOidcClient, bootstrapLocalAdmin} = require('@simpleworkjs/oidc-client');
|
||||
|
||||
const Table = setUpTable(conf.redis);
|
||||
|
||||
module.exports = Table;
|
||||
|
||||
// App-local models. User + ApiToken register before the OIDC client factory
|
||||
// below: Auth binds User, and checkApiToken wraps ApiToken.authenticate.
|
||||
require('./user'); // User (redis-backed local + OIDC JIT)
|
||||
const {ApiToken} = require('./api_token'); // ApiToken (Bearer PATs)
|
||||
require('./dns_provider');
|
||||
require('./dynamic_record');
|
||||
require('./host');
|
||||
require('./token');
|
||||
require('./user');
|
||||
require('./local_group');
|
||||
require('./permission');
|
||||
require('./oidc_state');
|
||||
require('./sso_session');
|
||||
require('./api_token');
|
||||
|
||||
// Shared OIDC client (authorization-code + PKCE): session models (Token,
|
||||
// AuthToken, OidcState), the Auth service, and the /login /logout /oidc/start
|
||||
// /oidc/callback router — all created on this app's Table/redis. PAT validation
|
||||
// is wired in (proxy accepts Bearer prx_<id>_<secret>); the package collapses
|
||||
// every checkApiToken failure to a generic 401.
|
||||
const oidcClient = createOidcClient({
|
||||
Table,
|
||||
checkApiToken: (raw) => ApiToken.authenticate(raw),
|
||||
});
|
||||
module.exports.Token = oidcClient.Token;
|
||||
module.exports.AuthToken = oidcClient.AuthToken;
|
||||
module.exports.OidcState = oidcClient.OidcState;
|
||||
module.exports.Auth = oidcClient.Auth;
|
||||
module.exports.authRouter = oidcClient.router;
|
||||
|
||||
// Idempotent anti-lockout local admin (was the IIFE in user_redis.js).
|
||||
bootstrapLocalAdmin(Table.models.User, {defaultName: 'proxyadmin2'});
|
||||
Reference in New Issue
Block a user