mas: TestAdminAllowCrossSigningReplacementWithoutUIA

This commit is contained in:
Roman Isaev 2025-01-15 18:54:59 +00:00
parent 5dd8568ecd
commit 418c584e40
No known key found for this signature in database
GPG key ID: 7BE2B6A6C89AEC7F
2 changed files with 111 additions and 15 deletions

View file

@ -819,12 +819,17 @@ func AdminAllowCrossSigningReplacementWithoutUIA(
}
var rs userapi.PerformAllowingMasterCrossSigningKeyReplacementWithoutUIAResponse
err = userAPI.PerformAllowingMasterCrossSigningKeyReplacementWithoutUIA(req.Context(), &rq, &rs)
if err != nil && err != sql.ErrNoRows {
if err != nil && !errors.Is(err, sql.ErrNoRows) {
util.GetLogger(req.Context()).WithError(err).Error("userAPI.PerformAllowingMasterCrossSigningKeyReplacementWithoutUIA")
return util.JSONResponse{
Code: http.StatusInternalServerError,
JSON: spec.Unknown(err.Error()),
}
} else if errors.Is(err, sql.ErrNoRows) {
return util.JSONResponse{
Code: http.StatusNotFound,
JSON: spec.NotFound("User not found."),
}
}
return util.JSONResponse{
Code: http.StatusOK,