qing
373f6af352
^-^
2026-08-01 06:04:27 +08:00
qing
12ece9020c
feat(libhttp,gateway): add admin-only WebSocket reverse proxy
...
libhttp v3.1:
- add ws_proxy(path, handshake) API with WsProxyHandshakeHandler callback
- implement full-duplex async bidirectional bridging (text+binary frames)
- support ws:// and wss:// backends with SNI, write queues for ordering
- proxy routes take priority over regular ws() routes
- 403 response on handshake rejection, graceful close propagation
gateway v0.6.0:
- add [WsProxy] config section (routes = /path=ws://backend;...)
- handshake callback verifies Token (Authorization/Cookie) is_admin=true
- non-admin / expired / missing token → 403, admin → transparent bridge
- fix LocalTime.hpp C++20 tzdb incompatibility on Apple clang (use strftime/get_time/mktime)
- update example.ini and README docs for both modules
2026-08-01 05:20:14 +08:00
qing
a8a190571c
feat(gateway): add /refresh_token API with grace window + refresh limit
...
- POST /refresh_token: accept current Bearer token (or Cookie fallback),
verify RSA signature, check grace window (iat + keep_time * multiplier)
and refresh count limit, then issue a new token.
- Token payload extended with iat, refresh_count, max_refresh fields.
- iat preserves original issue time; created_at updates on each refresh.
- Rate limited: 5 req / 5 min / IP via RateLimiter.
- Config: Token.refresh_grace_multiplier (default 2), Token.max_refresh (default 10).
- Backward compatible: old tokens without new fields still pass proxy checks.
2026-07-30 11:54:31 +08:00
qing
46c3a197be
refactor(auth): 管理员判定上移至 gateway,经 Token payload 下发 is_admin
...
gateway 登录签发 Token 时,账号命中 [Admin] users 白名单即在 payload
写入 is_admin=true(随 RSA 签名保护);dnfs 移除本地 ADMIN_USERS 硬编码,
delete_note/update_note 豁免判断改读 payload 的 is_admin 字段。
旧 Token 无此字段按非管理员处理(安全方向)。
2026-07-30 09:08:33 +08:00
qing
46b8f750ae
fixbug
2026-07-25 13:07:18 +08:00
qing
202f2804b2
增加waf模块
2026-07-25 01:27:08 +08:00
shufeng2012
468d420746
解决冲突(这啥呀*2)
2026-07-24 15:00:34 +08:00
shufeng2012
80d20f5015
解决冲突(这啥呀)
2026-07-24 14:46:26 +08:00
shufeng2012
dc5dc864c3
OK
2026-07-24 12:43:24 +08:00
qingss0
3df9ef8473
update: 更新文件 example.ini
...
Signed-off-by: qingss0 <qingss0@noreply.gitcode.com >
2026-07-24 07:13:55 +08:00
qing
888e1e56f5
9201 => 443
2026-07-23 12:00:38 +08:00
qing
aaac8fff12
代理地址限制
2026-07-21 11:49:45 +08:00
qing
70d467d052
init
2026-07-20 11:12:29 +08:00