Skip to content

Commit 536cb2b

Browse files
authored
Merge pull request #70 from DCSO/rest-improvements
Improvements to the REST API
2 parents cb7de26 + 23bdba3 commit 536cb2b

File tree

6 files changed

+286
-1612
lines changed

6 files changed

+286
-1612
lines changed

db/db_dummy.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// balboa
2-
// Copyright (c) 2020, DCSO GmbH
2+
// Copyright (c) 2020, 2025, DCSO GmbH
33

44
package db
55

@@ -51,13 +51,8 @@ func (m *MockDB) TotalCount() (int, error) {
5151
func (m *MockDB) Search(qrdata, qrrname, qrrtype, qsensorID *string, limit int) ([]observation.Observation, error) {
5252
retObs := make([]observation.Observation, 0)
5353
for _, o := range m.obs {
54-
if qrdata != nil {
55-
if *qrdata == o.RData {
56-
retObs = append(retObs, o)
57-
}
58-
}
59-
if qrrname != nil {
60-
if *qrrname == o.RRName {
54+
if (qrdata == nil || *qrdata == o.RData) && (qrrname == nil || *qrrname == o.RRName) {
55+
if (qsensorID == nil || *qsensorID == o.SensorID) && (qrrtype == nil || *qrrtype == o.RRType) {
6156
retObs = append(retObs, o)
6257
}
6358
}

go.mod

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,62 @@
11
module github.com/DCSO/balboa
22

3-
go 1.13
3+
go 1.23
4+
5+
toolchain go1.23.4
46

57
require (
68
github.com/NeowayLabs/wabbit v0.0.0-20210927194032-73ad61d1620e
7-
github.com/containerd/containerd v1.6.38 // indirect
89
github.com/farsightsec/go-nmsg v0.2.0
9-
github.com/fsouza/go-dockerclient v1.7.8 // indirect
1010
github.com/gogo/protobuf v1.3.2
1111
github.com/golang/protobuf v1.5.4
1212
github.com/graph-gophers/graphql-go v1.3.0
1313
github.com/machinebox/graphql v0.2.2
14-
github.com/matryer/is v1.2.0 // indirect
15-
github.com/moby/sys/mount v0.3.1 // indirect
16-
github.com/opentracing/opentracing-go v1.2.0 // indirect
17-
github.com/pborman/uuid v1.2.0 // indirect
18-
github.com/rabbitmq/amqp091-go v1.3.0 // indirect
1914
github.com/satori/go.uuid v1.2.0
2015
github.com/sirupsen/logrus v1.9.3
2116
github.com/spf13/cobra v1.3.0
2217
github.com/spf13/viper v1.10.1
2318
github.com/streadway/amqp v1.0.0
24-
github.com/tiago4orion/conjure v0.0.0-20150908101743-93cb30b9d218 // indirect
2519
github.com/ugorji/go/codec v1.2.6
2620
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9
27-
gopkg.in/ini.v1 v1.66.4 // indirect
2821
gopkg.in/yaml.v2 v2.4.0
2922
)
23+
24+
require (
25+
github.com/Microsoft/go-winio v0.5.3 // indirect
26+
github.com/containerd/containerd v1.6.38 // indirect
27+
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
28+
github.com/fsnotify/fsnotify v1.5.1 // indirect
29+
github.com/fsouza/go-dockerclient v1.7.8 // indirect
30+
github.com/google/go-cmp v0.6.0 // indirect
31+
github.com/google/uuid v1.3.1 // indirect
32+
github.com/hashicorp/hcl v1.0.0 // indirect
33+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
34+
github.com/klauspost/compress v1.15.9 // indirect
35+
github.com/kr/pretty v0.3.0 // indirect
36+
github.com/magiconair/properties v1.8.5 // indirect
37+
github.com/matryer/is v1.2.0 // indirect
38+
github.com/mitchellh/mapstructure v1.4.3 // indirect
39+
github.com/moby/sys/mount v0.3.1 // indirect
40+
github.com/opencontainers/image-spec v1.1.0 // indirect
41+
github.com/opencontainers/runc v1.1.5 // indirect
42+
github.com/opentracing/opentracing-go v1.2.0 // indirect
43+
github.com/pborman/uuid v1.2.0 // indirect
44+
github.com/pelletier/go-toml v1.9.5 // indirect
45+
github.com/pkg/errors v0.9.1 // indirect
46+
github.com/rabbitmq/amqp091-go v1.3.0 // indirect
47+
github.com/rogpeppe/go-internal v1.9.0 // indirect
48+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
49+
github.com/spf13/afero v1.9.2 // indirect
50+
github.com/spf13/cast v1.4.1 // indirect
51+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
52+
github.com/spf13/pflag v1.0.5 // indirect
53+
github.com/stretchr/testify v1.8.4 // indirect
54+
github.com/subosito/gotenv v1.2.0 // indirect
55+
github.com/tiago4orion/conjure v0.0.0-20150908101743-93cb30b9d218 // indirect
56+
golang.org/x/net v0.35.0 // indirect
57+
golang.org/x/sys v0.30.0 // indirect
58+
golang.org/x/text v0.22.0 // indirect
59+
google.golang.org/protobuf v1.33.0 // indirect
60+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
61+
gopkg.in/ini.v1 v1.66.4 // indirect
62+
)

0 commit comments

Comments
 (0)