3e5590288a
Adds opt-in basic auth per Host, following the existing per-host controls
pattern:
- Host fields basicauth_enabled / basicauth_realm / basicauth_users
({user: base64(sha1(pw))}). Credentials are parsed to plaintext by the pure
host_features normalizer and hashed at the route layer (utils/basicauth.js),
so plaintext never reaches Redis.
- ops/nginx_conf/hostfeatures.lua enforces it in access phase: verifies the
Authorization header against base64(sha1(password)), fails closed with a 401
WWW-Authenticate challenge.
- hosts.ejs gains an enable toggle, realm, and a username:password textarea
(passwords never echoed back; blank keeps the current set).
Unit tests cover hashing (matches the htpasswd {SHA} vector), credential
parsing, and normalization. Note: the Lua path needs verification on a live
OpenResty box.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
55 lines
2.4 KiB
JSON
55 lines
2.4 KiB
JSON
{
|
|
"name": "proxy-api",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"author": [
|
|
{
|
|
"name": "William Mantly",
|
|
"email": "wmantly@gmail.com"
|
|
}
|
|
],
|
|
"scripts": {
|
|
"start": "node ./bin/www",
|
|
"dev": "npx nodemon --ignore public/ ./bin/www",
|
|
"test": "node --test test/unit/callback_queue.test.js test/unit/host_lookup.test.js test/unit/wildcard_matchany.test.js test/unit/roles.test.js test/unit/oidc.test.js test/unit/safe_redirect.test.js test/unit/host_features.test.js test/unit/dynamic_record.test.js test/unit/hostname_validate.test.js test/unit/password_policy.test.js test/unit/basicauth.test.js test/unit/unix_socket.test.js test/integration/dns_provider.test.js",
|
|
"test:unit": "node --test test/unit/callback_queue.test.js test/unit/host_lookup.test.js test/unit/wildcard_matchany.test.js test/unit/roles.test.js test/unit/oidc.test.js test/unit/safe_redirect.test.js test/unit/host_features.test.js test/unit/dynamic_record.test.js test/unit/hostname_validate.test.js test/unit/password_policy.test.js test/unit/basicauth.test.js test/unit/unix_socket.test.js",
|
|
"test:integration": "node --test test/integration/dns_provider.test.js",
|
|
"test:watch": "node --test --watch test/unit/callback_queue.test.js test/unit/host_lookup.test.js test/unit/wildcard_matchany.test.js test/unit/roles.test.js test/unit/oidc.test.js test/unit/safe_redirect.test.js test/unit/host_features.test.js test/unit/dynamic_record.test.js test/unit/hostname_validate.test.js test/unit/password_policy.test.js test/unit/basicauth.test.js test/unit/unix_socket.test.js test/integration/dns_provider.test.js"
|
|
},
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@fortawesome/fontawesome-free": "^7.3.0",
|
|
"@popperjs/core": "^2.11.8",
|
|
"@simpleworkjs/conf": "^1.0.0",
|
|
"acme-client": "^5.4.0",
|
|
"axios": "^1.13.5",
|
|
"bcrypt": "^6.0.0",
|
|
"bootstrap": "^5.3.8",
|
|
"ejs": "^6.0.1",
|
|
"express": "^5.2.1",
|
|
"express-rate-limit": "^8.5.2",
|
|
"extend": "^3.0.2",
|
|
"jq-repeat": "^2.0.1",
|
|
"jquery": "^4.0.0",
|
|
"ldapts": "^8.1.8",
|
|
"linux-sys-user": "^1.2.0",
|
|
"model-redis": "^1.5.0",
|
|
"moment": "^2.30.1",
|
|
"mustache": "^4.2.0",
|
|
"p2psub": "^0.2.0",
|
|
"redis": "^6.1.0",
|
|
"socket.io": "^4.8.3",
|
|
"tld-extract": "^2.1.0"
|
|
},
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://git.theta42.com/wmantly/proxy.git"
|
|
},
|
|
"devDependencies": {
|
|
"nodemon": "^3.1.11"
|
|
}
|
|
}
|