lib/api: Remove remnants of CSRF tokens file mentions (ref #9284)

This commit is contained in:
Jakob Borg 2024-01-23 12:07:58 +01:00
parent ee9b20e47a
commit 45beb28fa5
3 changed files with 0 additions and 6 deletions

1
lib/api/.gitignore vendored
View File

@ -1 +0,0 @@
/testdata/config/csrftokens.txt

View File

@ -51,7 +51,6 @@ import (
var ( var (
confDir = filepath.Join("testdata", "config") confDir = filepath.Join("testdata", "config")
token = filepath.Join(confDir, "csrftokens.txt")
dev1 protocol.DeviceID dev1 protocol.DeviceID
apiCfg = newMockedConfig() apiCfg = newMockedConfig()
testAPIKey = "foobarbaz" testAPIKey = "foobarbaz"
@ -87,7 +86,6 @@ func TestStopAfterBrokenConfig(t *testing.T) {
mdb, _ := db.NewLowlevel(backend.OpenMemory(), events.NoopLogger) mdb, _ := db.NewLowlevel(backend.OpenMemory(), events.NoopLogger)
kdb := db.NewMiscDataNamespace(mdb) kdb := db.NewMiscDataNamespace(mdb)
srv := New(protocol.LocalDeviceID, w, "", "syncthing", nil, nil, nil, events.NoopLogger, nil, nil, nil, nil, nil, nil, false, kdb).(*service) srv := New(protocol.LocalDeviceID, w, "", "syncthing", nil, nil, nil, events.NoopLogger, nil, nil, nil, nil, nil, nil, false, kdb).(*service)
defer os.Remove(token)
srv.started = make(chan string) srv.started = make(chan string)
@ -867,7 +865,6 @@ func startHTTP(cfg config.Wrapper) (string, context.CancelFunc, error) {
mdb, _ := db.NewLowlevel(backend.OpenMemory(), events.NoopLogger) mdb, _ := db.NewLowlevel(backend.OpenMemory(), events.NoopLogger)
kdb := db.NewMiscDataNamespace(mdb) kdb := db.NewMiscDataNamespace(mdb)
svc := New(protocol.LocalDeviceID, cfg, assetDir, "syncthing", m, eventSub, diskEventSub, events.NoopLogger, discoverer, connections, urService, mockedSummary, errorLog, systemLog, false, kdb).(*service) svc := New(protocol.LocalDeviceID, cfg, assetDir, "syncthing", m, eventSub, diskEventSub, events.NoopLogger, discoverer, connections, urService, mockedSummary, errorLog, systemLog, false, kdb).(*service)
defer os.Remove(token)
svc.started = addrChan svc.started = addrChan
// Actually start the API service // Actually start the API service
@ -1410,7 +1407,6 @@ func TestEventMasks(t *testing.T) {
mdb, _ := db.NewLowlevel(backend.OpenMemory(), events.NoopLogger) mdb, _ := db.NewLowlevel(backend.OpenMemory(), events.NoopLogger)
kdb := db.NewMiscDataNamespace(mdb) kdb := db.NewMiscDataNamespace(mdb)
svc := New(protocol.LocalDeviceID, cfg, "", "syncthing", nil, defSub, diskSub, events.NoopLogger, nil, nil, nil, nil, nil, nil, false, kdb).(*service) svc := New(protocol.LocalDeviceID, cfg, "", "syncthing", nil, defSub, diskSub, events.NoopLogger, nil, nil, nil, nil, nil, nil, false, kdb).(*service)
defer os.Remove(token)
if mask := svc.getEventMask(""); mask != DefaultEventMask { if mask := svc.getEventMask(""); mask != DefaultEventMask {
t.Errorf("incorrect default mask %x != %x", int64(mask), int64(DefaultEventMask)) t.Errorf("incorrect default mask %x != %x", int64(mask), int64(DefaultEventMask))

1
test/.gitignore vendored
View File

@ -13,7 +13,6 @@ json
*.idx.gz *.idx.gz
dirs-* dirs-*
*.out *.out
csrftokens.txt
s4d s4d
http http
h*/index* h*/index*