fix: harden bot accounts and download handling

This commit is contained in:
ShukeBta
2026-06-07 18:30:27 +08:00
parent 7e37126f7c
commit df02fd1166
26 changed files with 1373 additions and 136 deletions
+11
View File
@@ -188,6 +188,17 @@ func TestAdminResetPasswordAllowsLoginWithNewPassword(t *testing.T) {
}
}
func TestLoginAcceptsUsernameCaseVariant(t *testing.T) {
ctx := context.Background()
_, auth, _, _ := newAuthTestServices(t)
if _, _, err := auth.Register(ctx, "viewer", "password"); err != nil {
t.Fatalf("register: %v", err)
}
if _, err := auth.Login(ctx, "Viewer", "password"); err != nil {
t.Fatalf("case variant username should login: %v", err)
}
}
func TestLoginKeepsOnlyConfiguredActiveRefreshTokens(t *testing.T) {
ctx := context.Background()
repos, auth, _, _ := newAuthTestServices(t)