decentralized-identity / decentralized-identity/web5-rs

Consider flattening the JWE&JWS implementations for JWT into function names rather than namespaces

Open
#177 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
19
Forks
15
PR merge metrics
No merged PRs in 30d

Description

As part of #173 we decided to implement the JWT as JWE and JWT as JWS along a namespace differentiator, so it's like this

```rust
use jwt::jws::Jwt;

Jwt::sign(); // this would be the JWT as JWS implementation because of the `::jws::` in the namespace
```

But @nitro-neal brought it to my attention, people may accidentally import the wrong `Jwt` and not realize it.

So, instead of namespacing, maybe we should differentiate via the function name, so then it would be like:

```rust
use jwt::Jwt;

Jwt::sign_jws(); // this is JWT as JWS implementation
// ...and then...
Jwt::sign_jwe(); // this is JWT as JWE implementation
```

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.