From a4535e0aa3e103f87bae6c3f1a1527588e60208c Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 22 Jun 2026 19:57:20 +0200 Subject: Remove registration handler This should be an admin-only task which should maybe be done via command line on the server. --- handlers_test.go | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'handlers_test.go') diff --git a/handlers_test.go b/handlers_test.go index f24bde4..c3bdabf 100644 --- a/handlers_test.go +++ b/handlers_test.go @@ -64,27 +64,6 @@ func TestHTTPVersion(t *testing.T) { testHandler(t, version, cases, setup) } -func TestHTTPRegister(t *testing.T) { - cases := []httpCase{ - {"basic", "POST", `{"username":"testuser","password":"mypass"}`, "", http.StatusOK}, - {"missing-password", "POST", `{"username":"testuser"}`, "", http.StatusBadRequest}, - {"missing-username", "POST", `{"password":"mypass"}`, "", http.StatusBadRequest}, - {"unknown-field", "POST", `{"username":"testuser","password":"mypass","foo":"bar"}`, "", http.StatusBadRequest}, - {"invalid-json", "POST", `{username":"testuser","password":"mypass"}`, "", http.StatusBadRequest}, - } - - setup := func(t *testing.T) *sql.DB { - db, _ := emptyDB(t) - err := MigrateToLatest(db) - if err != nil { - t.Fatalf("Could not migrate test database: %v", err) - } - return db - } - - testHandler(t, ApiRegistration, cases, setup) -} - func TestHTTPAuthenticate(t *testing.T) { cases := []httpCase{ {"basic", "POST", `{"username":"testuser","password":"mypass"}`, "", http.StatusOK}, -- cgit v1.3.1