webdriverio / webdriverio/cddl
Missing .cbor and .cborseq control operators (RFC 8610 §3.8.4)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 4
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 7
Description
RFC 8610 section 3.8.4 defines `.cbor`/`.cborseq` as control operators asserting that a `bstr`, once parsed as CBOR (or a sequence of CBOR items), matches the given type. This is the standard way to describe a byte string containing nested CBOR-encoded data -- exactly how COSE (RFC 9052) describes a `COSE_Sign1`'s protected header or payload field, for instance.
Neither operator is in `OPERATORS`/`OPERATORS_EXPECTING_VALUES` in `packages/cddl/src/parser.ts` today. `bstr .cbor sometype` currently crashes the parser (via the same underlying issue as #87 -- an unguarded `parseOperator()` call -- once #88 is merged it'll instead hit "expects a X property" from the operator not being recognised at all, rather than parsing).
I have a small patch (just the two operator-table additions, no new parsing logic needed since the operator's value is a plain type reference, which `parseOperator` already handles generically) and I'll open a PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/cddl/src/parser.ts and inspect OPERATORS and OPERATORS_EXPECTING_VALUES, where the issue says both missing operators belong. Add the two table entries and verify that bstr .cbor sometype and bstr .cborseq sometype parse without the reported operator error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100