Surface DID resolution errors in VP verification failures#3979
Surface DID resolution errors in VP verification failures#3979
Conversation
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (4)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
1 new issue
|
8aa2b43 to
3e58304
Compare
stevenvegt
left a comment
There was a problem hiding this comment.
this whole thing feels like a band aid. The moment a new one gets introduced, this thing falls back on the default. My gut feeling is going up the chain and catch the errors and map them to the correct ones. Or, create a factory for a oauth.OAuth2Error which accepts all kind of errors and creates the correct object.
That said, it is covered in tests and is an improvement to the current situation. So.. let me know if you disagree and I will hit the accept button :)
…rors to client (nuts-foundation#3979) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Rein Krul <info@reinkrul.nl>
* add aws rds iam authentication * add aws rds iam authentication * add aws rds iam authentication * refactore documentation,logs messages around rds iam login and added more tests * fix minor changes recommendation * deleted duplicated log * \#3978: Return credential/presentation verification errors to client (#3979) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Rein Krul <info@reinkrul.nl> * Bump filippo.io/edwards25519 from 1.1.0 to 1.1.1 (#4037) Bumps [filippo.io/edwards25519](https://github.com/FiloSottile/edwards25519) from 1.1.0 to 1.1.1. - [Commits](FiloSottile/edwards25519@v1.1.0...v1.1.1) --- updated-dependencies: - dependency-name: filippo.io/edwards25519 dependency-version: 1.1.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/knadh/koanf/v2 from 2.2.2 to 2.3.2 (#4033) Bumps [github.com/knadh/koanf/v2](https://github.com/knadh/koanf) from 2.2.2 to 2.3.2. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](knadh/koanf@v2.2.2...v2.3.2) --- updated-dependencies: - dependency-name: github.com/knadh/koanf/v2 dependency-version: 2.3.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump gorm.io/driver/sqlserver from 1.6.1 to 1.6.3 (#4032) Bumps [gorm.io/driver/sqlserver](https://github.com/go-gorm/sqlserver) from 1.6.1 to 1.6.3. - [Commits](go-gorm/sqlserver@v1.6.1...v1.6.3) --- updated-dependencies: - dependency-name: gorm.io/driver/sqlserver dependency-version: 1.6.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump google.golang.org/grpc from 1.78.0 to 1.79.1 (#4034) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.78.0 to 1.79.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.78.0...v1.79.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.79.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump docker/setup-buildx-action from 3 to 4 (#4047) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3 to 4. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](docker/setup-buildx-action@v3...v4) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (#4050) Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.65.0 to 0.66.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.65.0...zpages/v0.66.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp dependency-version: 0.66.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/nats-io/nats.go from 1.48.0 to 1.49.0 (#4049) Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.48.0 to 1.49.0. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](nats-io/nats.go@v1.48.0...v1.49.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-version: 1.49.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump docker/login-action from 3 to 4 (#4045) Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](docker/login-action@v3...v4) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump docker/setup-qemu-action from 3 to 4 (#4046) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3 to 4. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](docker/setup-qemu-action@v3...v4) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * signing commit --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kamil Lach <kamil@zd-mbp-fw4klvr2tf.home> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Rein Krul <info@reinkrul.nl> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Plan: Improve Client Error Message for DID Resolution Failures
Summary of Changes
Problem: Currently, when the server can't resolve a DID document during VP verification, it returns a generic error: "presentation(s) or contained credential(s) are invalid". This makes troubleshooting difficult for clients.
Solution Implemented:
Created
verificationErrorDescription()helper (auth/api/iam/openid4vp.go):errors.Is()and string pattern matchingUpdated error handling in two locations:
auth/api/iam/openid4vp.go- OpenID4VP HandleAuthorizeResponse flowauth/api/iam/s2s_vptoken.go- Service-to-service VP token verification flowAdded comprehensive tests (
auth/api/iam/openid4vp_test.go):New Error Messages:
Review Feedback Addressed:
err.Error()directly instead of custom messagesTesting Results:
Security Considerations:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.