Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy: prevent nil dereference when no backend is configured #2723

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

reinkrul
Copy link
Member

No description provided.

@woutslakhorst
Copy link
Member

This is encountered in test? Since no backend automatically means a directory based backend.

@reinkrul
Copy link
Member Author

It occurs when requesting an access token using the new IAM API;

echo: http: panic serving 172.22.0.4:39774: runtime error: invalid memory address or nil pointer dereference
goroutine 275 [running]:
net/http.(*conn).serve.func1()
	/usr/local/go/src/net/http/server.go:1868 +0xb9
panic({0x1b0e040?, 0x2e43ba0?})
	/usr/local/go/src/runtime/panic.go:920 +0x270
github.com/nuts-foundation/nuts-node/policy.(*Router).PresentationDefinition(0x20e2dd8?, {0x20dcd38?, 0xc000c04a80?}, {{0xc000aefb44, 0x3}, {0xc000aefb48, 0x2e}, {0xc000aefb48, 0x2e}}, {0xc000c0c40c, ...})
	/go/policy/policy.go:88 +0x65
github.com/nuts-foundation/nuts-node/auth/api/iam.Wrapper.PresentationDefinition({{0x20ebd20, 0xc000103a00}, {0x20e2dd8, 0xc0000db320}, {0x20e2e28, 0xc000151320}, {0x20d39f0, 0xc000568cd0}, 0xc0004075f0, {0x20e02d0, ...}}, ...)
	/go/auth/api/iam/api.go:355 +0x13a
github.com/nuts-foundation/nuts-node/auth/api/iam.(*strictHandler).PresentationDefinition.func1({0x20fd650?, 0xc000c18460?}, {0x1bae480?, 0xc0002fe3c0})
	/go/auth/api/iam/generated.go:814 +0xa3
github.com/nuts-foundation/nuts-node/auth/api/iam.Wrapper.middleware({{0x20ebd20, 0xc000103a00}, {0x20e2dd8, 0xc0000db320}, {0x20e2e28, 0xc000151320}, {0x20d39f0, 0xc000568cd0}, 0xc0004075f0, {0x20e02d0, ...}}, ...)
	/go/auth/api/iam/api.go:129 +0x2ea
github.com/nuts-foundation/nuts-node/auth/api/iam.Wrapper.Routes.func1.1({0x20fd650?, 0xc000c18460?}, {0x1bae480?, 0xc0002fe3c0?})
	/go/auth/api/iam/api.go:91 +0x7e
github.com/nuts-foundation/nuts-node/auth/api/iam.Wrapper.Routes.func2.StrictMiddleware.func1({0x20fd650, 0xc000c18460}, {0x1bae480, 0xc0002fe3c0})
	/go/audit/http.go:32 +0x65
github.com/nuts-foundation/nuts-node/auth/api/iam.(*strictHandler).PresentationDefinition(0xc000691b00, {0x20fd650, 0xc000c18460}, {0xc000c0c3c9?, 0x5?}, {{0xc000c0c40c?, 0x1a02780?}})
	/go/auth/api/iam/generated.go:820 +0x130
github.com/nuts-foundation/nuts-node/auth/api/iam.(*ServerInterfaceWrapper).PresentationDefinition(0xc0005b4fe0, {0x20fd650, 0xc000c18460})
	/go/auth/api/iam/generated.go:276 +0x292

@reinkrul reinkrul merged commit e4f0635 into master Jan 16, 2024
9 checks passed
@reinkrul reinkrul deleted the policy/no-backend-nilptr branch January 16, 2024 08:40
rolandgroen added a commit that referenced this pull request Jan 25, 2024
* master: (38 commits)
  VDR: Fix duplicate results when listing DIDs (#2743)
  VDR: API to list owned DIDs (#2742)
  VDR: Move did:nuts specific to did:nuts creator (#2735)
  Discovery: API to list configured Discovery Services (#2739)
  PKI: Adjust validation logging; OK = trace, NOK = info (#2736)
  Discovery: update client copy of Discovery Services (#2718)
  VDR: Group all DID Document management funcs in a new interface (#2737)
  Handle direct_post return from wallet to verifier (#2702)
  Bump github.com/nats-io/nats.go from 1.31.0 to 1.32.0 (#2724)
  Discovery: fix API of Client.Search() (#2730)
  Bump github.com/amacneil/dbmate/v2 from 2.10.0 to 2.11.0 (#2729)
  Discovery: DID registration by clients (#2709)
  Config: Add HTTP-client timeout (#2725)
  Policy: prevent nil dereference when no backend is configured (#2723)
  Bump github.com/nats-io/nats-server/v2 from 2.10.7 to 2.10.9 (#2721)
  SQL: specify lengths for VARCHAR columns to avoid different behavior with different RDBMS's (#2717)
  Bump golang from 1.21.5-alpine to 1.21.6-alpine (#2719)
  Handle authorization request from verifier by holder/wallet (#2680)
  Bump golang.org/x/crypto from 0.17.0 to 0.18.0 (#2716)
  Bump github.com/lestrrat-go/jwx/v2 from 2.0.18 to 2.0.19 (#2715)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants