https://github.com/ucan-wg/rs-ucan
Rust implementation of UCAN
https://github.com/ucan-wg/rs-ucan
authorization identity jwt rust ucan
Last synced: 3 months ago
JSON representation
Rust implementation of UCAN
- Host: GitHub
- URL: https://github.com/ucan-wg/rs-ucan
- Owner: ucan-wg
- License: apache-2.0
- Created: 2022-01-15T00:14:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-08T00:25:19.000Z (6 months ago)
- Last Synced: 2025-12-13T14:59:31.633Z (6 months ago)
- Topics: authorization, identity, jwt, rust, ucan
- Language: Rust
- Homepage:
- Size: 1.3 MB
- Stars: 72
- Watchers: 4
- Forks: 20
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
:warning: Work in progress :warning:
> [!NOTE]
> These libraries conform to UCAN v1.0.0-rc.1
> [!WARNING]
> This code has not been formally audited. Use at your own risk!
## Usage
Add the following to the `[dependencies]` section of your `Cargo.toml` file:
```toml
ucan = "0.8"
```
## Testing the Project
Run tests
| Nix | Cargo |
|------------|--------------|
| `test:all` | `cargo test` |
## Benchmarking the Project
For benchmarking and measuring performance, this project leverages
[Criterion] and a `test_utils` feature flag.
## Benchmarks
| Nix | Cargo |
|---------|-------------------------------------|
| `bench` | `cargo bench --features=test_utils` |
## Contributing
:balloon: We're thankful for any feedback and help in improving our project!
We have a [contributing guide][CONTRIBUTING] to help you get involved. We
also adhere to our [Code of Conduct].
### Nix
This repository contains a [Nix flake] that initiates both the Rust
toolchain set in [`rust-toolchain.toml`] and a [pre-commit hook]. It also
installs helpful cargo binaries for development.
Please install [Nix] to get started. We also recommend installing [direnv].
Run `nix develop` or `direnv allow` to load the `devShell` flake output,
according to your preference.
The Nix shell also includes several helpful shortcut commands.
You can see a complete list of commands via the `menu` command.
### Formatting
For formatting Rust in particular, we automatically format on `nightly`, as it
uses specific nightly features we recommend by default.
### Pre-commit Hook
This project recommends using [pre-commit] for running pre-commit
hooks. Please run this before every commit and/or push.
- If you are doing interim commits locally, and for some reason if you _don't_
want pre-commit hooks to fire, you can run
`git commit -a -m "Your message here" --no-verify`.
### Recommended Development Flow
- We recommend leveraging [cargo-watch][cargo-watch],
[`cargo-expand`] and [IRust] for Rust development.
- We recommend using [cargo-udeps][cargo-udeps] for removing unused dependencies
before commits and pull-requests.
### Conventional Commits
This project *lightly* follows the [Conventional Commits
convention][commit-spec-site] to help explain
commit history and tie in with our release process. The full specification
can be found [here][commit-spec]. We recommend prefixing your commits with
a type of `fix`, `feat`, `docs`, `ci`, `refactor`, etc..., structured like so:
```
[optional scope]:
[optional body]
[optional footer(s)]
```
## Getting Help
For usage questions, usecases, or issues reach out to us in the [UCAN Discord].
We would be happy to try to answer your question or try opening a new issue on GitHub.
## External Resources
These are references to specifications, talks and presentations, etc.
## License
This project is [licensed under the Apache License 2.0][LICENSE], or
[http://www.apache.org/licenses/LICENSE-2.0][Apache].
[Benchmarking the Project]: #benchmarking-the-project
[Contributing]: #contributing
[External Resources]: #external-resources
[Getting Help]: #getting-help
[License]: #license
[Testing the Project]: #testing-the-project
[Usage]: #usage
[pre-commit hook]: #pre-commit-hook
[CONTRIBUTING]: ./CONTRIBUTING.md
[LICENSE]: ./LICENSE
[Code of Conduct]: ./CODE_OF_CONDUCT.md
[`rust-toolchain.toml`]: ./rust-toolchain.toml
[Apache]: https://www.apache.org/licenses/LICENSE-2.0
[`cargo-expand`]: https://github.com/dtolnay/cargo-expand
[`cargo-udeps`]: https://github.com/est31/cargo-udeps
[`cargo-watch`]: https://github.com/watchexec/cargo-watch
[commit-spec]: https://www.conventionalcommits.org/en/v1.0.0/#specification
[commit-spec-site]: https://www.conventionalcommits.org/
[Criterion]: https://github.com/bheisler/criterion.rs
[direnv]:https://direnv.net/
[IRust]: https://github.com/sigmaSd/IRust
[Nix]:https://nixos.org/download.html
[Nix flake]: https://nixos.wiki/wiki/Flakes
[pre-commit]: https://pre-commit.com/
[UCAN Discord]: https://discord.gg/4UdeQhw7fv