google / google/coset

[Feature Request / Contribution Proposal] working with internet drafts

Open
#112 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
48
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Hi, and first of all thanks for the crate, it great, love it.

When working with internet drafts there are very often a lot of pending/requested IANA codepoints that are not within the private range and hence cannot be used within the `ClaimSetBuilder` which is a very convenient way to build a Cose object.

One have to resort to do the CBOR serialization by hand on the side to bypass [this line](https://github.com/google/coset/blob/442392251948419244e50dac052500702556c906/src/cwt/mod.rs#L195).

My proposal is to add another variants like such:

```rust
pub enum RegisteredLabelWithPrivate {
PrivateUse(i64),
InternetDraft(T),
Assigned(T),
Text(String),
}

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum RegisteredLabel {
InternetDraft(T),
Assigned(T),
Text(String),
}
```

And an associated `ClaimSetBuilder::internet_draft_claim` that would let pass arbitrary labels.

What do you think ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.