Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #638 +/- ##
==========================================
- Coverage 97.34% 97.01% -0.33%
==========================================
Files 32 32
Lines 3352 3418 +66
==========================================
+ Hits 3263 3316 +53
- Misses 89 102 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| raise ValueError(f"Unsupported or unknown alg: {v}.") | ||
| v = algs[v] | ||
| else: | ||
| v = v.encode("utf-8") if isinstance(v, str) else v |
There was a problem hiding this comment.
I apologise in advance for offering unsolicited feedback here, which I hope will be useful still.
It is uncommon, and fairly recent, but one soon-to-be standard parameter may only have a tstr value: 260 (payload-location), requested in cose-hash-envelope.
A user passing a protected header {"payload-location": "http://..."} would have their payload-location converted to a bstr by line 191, which although practically harmless, could be rejected by a strict parser/verifier.
Since the code below applies per-key validation, it may be that having per-key conversion logic is desirable. Another edge case may be the use of not-yet supported values for 1 (alg) or 16 (typ), which allow tstr for that purpose. A user may want to pass {"alg": "NEWCRYPTOALGO"}, and a strict verifier may enforce int / tstr and reject a bstr-encoded b"NEWCRYPTOALGO".
No description provided.