Skip to content

feat(resource): add Verifier.IssueDPoPNonce - #693

Merged
osanderson merged 1 commit into
mainfrom
feat/resource-issue-dpop-nonce
Oct 20, 2026
Merged

osanderson merged 1 commit into
mainfrom
feat/resource-issue-dpop-nonce

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

Adds (*resource.Verifier).IssueDPoPNonce(ctx), the issuer-side counterpart of #691. This is an additive API.

Why

OpenID4VCI 1.0 §7.2 lets a Credential Issuer's Nonce Response carry a DPoP-Nonce header, which the Wallet uses at the Credential Endpoint.

That nonce must come from the store the Credential Endpoint's resource.Verifier checks, or the Verifier will refuse it. Until now only Verify could issue one, in answer to a request. So an issuer built on FAPIgo couldn't hand one out ahead of time, and #691's wallet side had nothing to receive from it.

Change

  • What it does: IssueDPoPNonce issues and stores a fresh nonce, valid for Limits.DPoPNonceLifetime, which Verify then accepts once.
  • Without nonces: with no Dependencies.Nonces configured, it returns "" and no error, because that Verifier doesn't use DPoP nonces.
  • Doc note: called from an endpoint anyone may call (§7.1's Nonce Endpoint is), each call adds a record, exactly as that endpoint's own c_nonce does. Rate-limit the endpoint accordingly.

Testing

  • New test: an issued nonce is accepted by Verify, refused the second time, and a Verifier without nonces returns "".
  • Checks: go vet, golangci-lint (0 issues), and go test -race on Go 1.26.9 for resource.
  • No conformance run: FAPIgo itself doesn't call the new method.

🤖 Generated with Claude Code

A resource server can hand out a DPoP nonce ahead of a request, not
only in answer to one: OpenID4VCI 1.0 §7.2 lets the Credential Issuer's
Nonce Response carry one in its DPoP-Nonce header, for the Wallet to
use at the Credential Endpoint. The nonce must come from the store the
Credential Endpoint's Verifier checks, and only Verify could issue one.

IssueDPoPNonce issues a fresh nonce the Verifier will accept. It returns
"" and no error when Dependencies.Nonces is nil. Its doc notes that
called from an endpoint anyone may call, it lets anyone add records, as
that endpoint's own c_nonce does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@osanderson
osanderson merged commit 29a7549 into main Oct 20, 2026
18 checks passed
@osanderson
osanderson deleted the feat/resource-issue-dpop-nonce branch October 20, 2026 06:23
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.

1 participant