nuts-foundation / nuts-consent-store

Storage backend enabling querying unencrypted consent records.
GNU General Public License v3.0
0 stars 0 forks source link

Request to /consent/query triggers error #7

Closed Timendus closed 4 years ago

Timendus commented 5 years ago
POST localhost:21323/consent/query

Body:

{
  "custodian": "urn:oid:2.16.840.1.113883.2.4.6.1:00000007",
  "actor": "urn:oid:2.16.840.1.1113883.2.4.6.1:1234567",
  "page": {
    "offset": 0,
    "limit": 0
  },
  "validAt": "2019-10-17"
}

Ja, actor is een rare urn. Foutje mijnerzijds. Maar dat mag niet uitmaken ;)

Error:

nuts-service-space_1  | echo: http: panic serving 172.25.0.1:51194: interface conversion: interface {} is nil, not string
nuts-service-space_1  | goroutine 14183 [running]:
nuts-service-space_1  | net/http.(*conn).serve.func1(0xc00034d400)
nuts-service-space_1  |     /usr/local/go/src/net/http/server.go:1769 +0x139
nuts-service-space_1  | panic(0x10015a0, 0xc000466ab0)
nuts-service-space_1  |     /usr/local/go/src/runtime/panic.go:522 +0x1b5
nuts-service-space_1  | github.com/nuts-foundation/nuts-consent-store/api.(*ApiWrapper).QueryConsent(0xc0000104c8, 0x134c180, 0xc0002821b0, 0xea11b84a, 0xed82349af2345073)
nuts-service-space_1  |     /pkg/mod/github.com/nuts-foundation/nuts-consent-store@v0.0.0-20191014081951-d9519591ab5b/api/api.go:181 +0x6b0
nuts-service-space_1  | github.com/nuts-foundation/nuts-consent-store/api.(*ServerInterfaceWrapper).QueryConsent(...)
nuts-service-space_1  |     /pkg/mod/github.com/nuts-foundation/nuts-consent-store@v0.0.0-20191014081951-d9519591ab5b/api/generated.go:641
nuts-service-space_1  | github.com/labstack/echo/v4.(*Echo).add.func1(0x134c180, 0xc0002821b0, 0x114fbc0, 0x1b)
nuts-service-space_1  |     /pkg/mod/github.com/labstack/echo/v4@v4.1.11/echo.go:505 +0x87
nuts-service-space_1  | github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1(0x134c180, 0xc0002821b0, 0x1b7a000, 0xc000e29c28)
nuts-service-space_1  |     /pkg/mod/github.com/labstack/echo/v4@v4.1.11/middleware/cors.go:121 +0x478
nuts-service-space_1  | github.com/labstack/echo/v4/middleware.LoggerWithConfig.func2.1(0x134c180, 0xc0002821b0, 0x2, 0x2)
nuts-service-space_1  |     /pkg/mod/github.com/labstack/echo/v4@v4.1.11/middleware/logger.go:117 +0x1c0
nuts-service-space_1  | github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc000c6c380, 0x1328b60, 0xc000130380, 0xc00359e700)
nuts-service-space_1  |     /pkg/mod/github.com/labstack/echo/v4@v4.1.11/echo.go:616 +0x22d
nuts-service-space_1  | net/http.serverHandler.ServeHTTP(0xc000275110, 0x1328b60, 0xc000130380, 0xc00359e700)
nuts-service-space_1  |     /usr/local/go/src/net/http/server.go:2774 +0xa8
nuts-service-space_1  | net/http.(*conn).serve(0xc00034d400, 0x132d1e0, 0xc00023c000)
nuts-service-space_1  |     /usr/local/go/src/net/http/server.go:1878 +0x851
nuts-service-space_1  | created by net/http.(*Server).Serve
nuts-service-space_1  |     /usr/local/go/src/net/http/server.go:2884 +0x2f4
woutslakhorst commented 4 years ago

current master is a bit different, but I think the date format is the problem here. In the API spec it's also defined as format: date which gives huge explosions when generating code for different languages. Should be string with custom format checking