Files
blackbird/gateway/example.ini
T
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

35 lines
1.3 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[Server]
# 当 WAF 在前面终止 TLS 时,gateway 退化为内部 HTTP 服务:
# - tls = off 启用 HTTP 模式(配合 waf 模块使用)
# - tls = on 启用 HTTPS 模式(独立部署,证书为 full_chain.crt / server.key)
address = 127.0.0.1
port = 8443
tls = off
[Proxy]
default = http://127.0.0.1:9200
closed = http://127.0.0.1:8005;http://127.0.0.1:8007;
opened = http://127.0.0.1:9200;http://127.0.0.1:8006;
[Token]
# Token 有效期(秒),默认 3600 = 1 小时
keep_time = 3600
# Token 刷新宽限期倍数:过期后 iat + keep_time * 倍数 窗口内仍可刷新,默认 2
refresh_grace_multiplier = 2
# Token 生命周期内最大刷新次数,超过后需重新登录,默认 10
max_refresh = 10
[Admin]
# 管理员账号白名单(分号分隔)。登录时命中即在 Token payload 写入 is_admin=true,
# 下游服务(dnfs 等)凭该字段豁免所有权校验,无需各自维护名单。
# 修改后需重启 gateway 生效;旧 Token 无此字段,按非管理员处理。
users = qing@qsont.me
[CORS]
# 允许跨域的 Origin 白名单(分号分隔)
# 仅命中的 Origin 才会回填 Access-Control-Allow-Origin;缺省为空(不回填)
allowed_origins = https://qsont.me;https://www.qsont.me;http://127.0.0.1:8443;http://localhost:8443
[Database]
path = sqlite3.db