Conversation
… response cap Registered Verifiable Presentations are now limited to 64 KiB, checked first in verifyRegistration and returned as ErrInvalidPresentation (HTTP 400). Legitimate registrations are a few KB; one carrying an X509Credential with a full PKIoverheid chain is about 16 KB. The Discovery Service client reads responses of up to 10 MiB from the operator-configured Discovery Server, instead of the 1 MiB the strict HTTP client applies to all other outbound calls. The cap is now a per-client setting (WithMaxResponseSize), defaulting to the existing 1 MiB, and all constructors go through one helper so none can end up without a cap. Previously a client could no longer synchronize a service once a response exceeded 1 MiB, which a few hundred registrations, or two deliberately padded ones, could cause. The cap stays at 10 MiB because the response is buffered and parsed in memory; streaming or paging to lift it further is tracked in #4596. Part of #4596 Assisted by AI
Assisted by AI
|
64kb seems strict. You said this is around 4 x509 type VCs in a VP? In LSP x Nuts we have an inschrijfVC, mandateVC, OrgVC and others. Some of those are x509 signed. Would 128kb also work without causing problems? Your test start from 10mb right, so perhaps redo them with smaller sizes to see what would be still ok? |
|
how does this VP size limitation relates to presentations used in access token requests? Should we do the same there? |
Review feedback: 64 KiB is tight for presentations carrying several X509Credentials (about 16 KB each). 128 KiB still bounds a padded registration well below the 10 MiB client response cap. Assisted by AI
1 new issue
|
Reverts 5850d3a. A discovery registration carries the credentials the service definition's presentation definition asks for, typically one organization credential plus the registration credential; measured with the did:x509 toolkit output that is 16 KB with one x509-signed credential, 30 KB with two and 45 KB with three, so 64 KiB leaves room for a second organization-type credential. The multi-credential presentations from the review discussion are used in access token requests, which this change does not cap. Assisted by AI
It doesn't, I'll investigate that separately |
Those aren't credentials that are registered in the discovery service, but access-token-time credentials. We have some use cases that want a separate healthcare provider type-credential, we'll accommodate that comfortably with 64kb cap. If there are use cases that design something that won't fit in the current cap strategy, we can always revise it, but we'll cross that bridge when we get there. |
Part of #4596 (this PR covers items 1 and 2; streaming and paging remain open for debate there).
What
Module.verifyRegistration, returned asErrInvalidPresentationso the server answers 400. Since the same function verifies downloaded entries, clients also ignore oversized entries from a misbehaving server.WithMaxResponseSize, default unchanged at 1 MiB); every constructor goes through one helper so none can end up without a cap.Why
GET /discovery/{serviceID}returns every entry after the given timestamp in one response, and the client refused anything over 1 MiB, so a service whose list grew past a few hundred entries (about 65 with X509Credentials) could no longer be synced by a new node. Two deliberately padded registrations could do the same for everyone. Details and measurements in #4596.Sizing
Testing
http/client: raised versus default cap against a test server; option applied by all constructors.discovery:Registerrejects a padded VP withpresentation exceeds maximum size of 131072 bytes.Assisted by AI