brycx / pasetors

PASETOrs: PASETO tokens in pure Rust
MIT License
87 stars 9 forks source link

Feature gate local & public #29

Closed not-my-profile closed 2 years ago

not-my-profile commented 2 years ago

Some applications might only need Paseto local, while some applicaitons might only need Paseto public. In either case they might want to avoid an unnecessary dependency on ed25519-dalek or orion respectively.

So I think the following would make sense:

[features]
default = [ "std", "local", "public" ]
std = [ "serde_json", "chrono" ]
local = [ "orion" ]
public = [ "ed25519-dalek" ]

The current dependency on orion::util::secure_cmp would need to be dropped (we can just directly depend on subtle).

To make docs.rs render feature badges we can employ this trick.

brycx commented 2 years ago

This seems reasonable, we can add this.

brycx commented 2 years ago

I'm going to close this issue for now. The upcoming 0.5.0 release has all versions feature-gated and now that v3 is also being included, I feel like further splitting into public/local features will simply clutter the features-list too much. Let me know if this is critical for you @not-my-profile.

The features badge trick you proposed, is also included in the next release.