按 DDD 重构认证流程并复用用户 bind 实现 LDAP 仓储

This commit is contained in:
2026-09-27 16:54:54 +00:00
parent 14f69a8a7c
commit a4b99d54f3
43 changed files with 1143 additions and 1167 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ def main():
def request(path, authenticated=False):
headers = {'Accept': 'text/plain' if authenticated and path == '/actuator/prometheus' else 'application/json'}
if path == '/preview':
if path == '/signin':
headers['Accept'] = 'text/html'
if authenticated:
headers['Authorization'] = f'Basic {basic}'
@@ -80,7 +80,7 @@ def main():
ready_seconds = time.monotonic() - started
assert request('/actuator/prometheus')[0] == 401, 'Anonymous metrics must be rejected'
assert request('/')[0] == 401, 'Anonymous application access must be rejected'
assert request('/preview')[0] == 404, 'UI preview must be disabled by default'
assert request('/signin')[0] == 404, 'Sign-in must be disabled without directory configuration'
status, before = request('/actuator/prometheus', authenticated=True)
assert status == 200, 'Authenticated Prometheus scrape failed'
for _ in range(3):