refactor!: separate runtime releases from panel source
This commit is contained in:
@@ -77,16 +77,15 @@ func TestAdmissionRoutesEnforceAuthorization(t *testing.T) {
|
||||
a.Handler().ServeHTTP(w, r)
|
||||
return w
|
||||
}
|
||||
if w := request("GET", "/api/compatibility", "", false, false); w.Code != 401 {
|
||||
t.Fatal(w.Code, w.Body.String())
|
||||
}
|
||||
if w := request("GET", "/api/compatibility", "", true, false); w.Code != 200 {
|
||||
t.Fatal(w.Code, w.Body.String())
|
||||
for _, path := range []string{"/api/latest", "/api/compatibility", "/api/intents", "/api/intents/old"} {
|
||||
if w := request("GET", path, "", true, false); w.Code != 404 {
|
||||
t.Fatal(path, w.Code, w.Body.String())
|
||||
}
|
||||
}
|
||||
if w := request("POST", "/api/images/admission", body, true, true); w.Code != 403 {
|
||||
t.Fatal("nonadmin admission", w.Code, w.Body.String())
|
||||
}
|
||||
if w := request("POST", "/api/builds", `{"version":"9.8.7","experimental":true}`, true, true); w.Code != 403 {
|
||||
if w := request("POST", "/api/builds", `{"version":"9.8.7","experimental":true}`, true, true); w.Code != 405 {
|
||||
t.Fatal("nonadmin experiment", w.Code, w.Body.String())
|
||||
}
|
||||
if _, err = a.s.DB.Exec("UPDATE users SET admin=1 WHERE id='owner'"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user