feat: split cose and jwt into independent default-on features#57
Merged
thomas-fossati merged 3 commits intoJul 14, 2026
Merged
Conversation
thomas-fossati
approved these changes
Jul 14, 2026
thomas-fossati
left a comment
Contributor
There was a problem hiding this comment.
(Again) thanks very much @imlk0, LGTM!
Here are a few non-blocking comments in case you want to take a look now or in the future:
- It would be nice if the CI checked the individual features alongside the default. I believe this can be done with a matrix job.
- The docs.rs metadata could be adjusted to reflect the feature split.
- AFAICS, "hex" is only used in "ear/cose.rs" and could be made optional.
- (Purely cosmetic): There is a redundant "Signed-off-by" in the commit.
Make cose-rust, openssl, and jsonwebtoken optional behind two independent default-on features: cose = [dep:cose-rust, dep:openssl, dep:jsonwebtoken] jwt = [dep:jsonwebtoken] cose no longer implies the jwt feature -- it depends on the jsonwebtoken *crate* (used by from_cose_jwk to parse JWK keys), not the jwt feature's API surface. This lets JWT-only builds drop cose+openssl and COSE-only builds drop the jwt feature's code, with the two features genuinely orthogonal. The jsonwebtoken import in ear.rs is now gated on any(cose, jwt) so the shared JWK types are available to the cose path without forcing the jwt feature on. JWT-only doctests are wrapped in cfg(feature = "jwt") blocks so the feature matrix (cose-only / jwt-only / default) all pass cargo test cleanly. Signed-off-by: Kun Lai <laikun@linux.alibaba.com> Assisted-by: Claude <noreply@anthropic.com>
Run build+test across default, cose-only, jwt-only, no-default-features, and all-features so the cose/jwt feature split is exercised on every change. fmt and clippy move to a dedicated lint job (default features) to avoid running them once per matrix entry. Signed-off-by: Kun Lai <laikun@linux.alibaba.com> Assisted-by: Claude <noreply@anthropic.com>
Add [package.metadata.docs.rs] listing the cose and jwt features explicitly, so the gated API surfaces get documented on docs.rs (which otherwise builds with default features only). Listing features explicitly rather than all-features = true keeps docs.rs stable if experimental or mutually exclusive features are added later. Signed-off-by: Kun Lai <laikun@linux.alibaba.com> Assisted-by: Claude <noreply@anthropic.com>
Contributor
Author
|
hi @thomas-fossati, thanks for the quick response! I've pushed the updates, and CI looks good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-open #56