Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0-rc.1 #6

Draft
wants to merge 192 commits into
base: quinn-wip-rework
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
692a4d4
Small change to get this up in a PR
expede Jan 18, 2024
c6e9e17
feat: move flake.nix to numtide/devshell
expede Jan 19, 2024
3177cae
Update README to use new GitHub markdown features
expede Jan 19, 2024
a31445a
Trim whitespace
expede Jan 19, 2024
3cda14f
feat: frustration
expede Jan 19, 2024
d6a62fb
fix: typo
expede Jan 19, 2024
0e0efa2
Adding some TODOs and FIXMEs to come back to
expede Jan 19, 2024
77dafd9
Exploratory programming
expede Jan 24, 2024
9c38b9b
Formatter
expede Jan 24, 2024
a5b5434
Splitting out separate files
expede Jan 24, 2024
6ec904c
Add Signature envelope and receipts
expede Jan 24, 2024
fb8336f
More exploration
expede Jan 24, 2024
aaa2a79
WIP
expede Jan 25, 2024
ad94b97
More exploratory programming, cleanup, and conds
expede Jan 25, 2024
e72b6d8
WIP
expede Jan 26, 2024
9cb4126
Remove -rs from package name
expede Jan 26, 2024
7a5452f
Thanks for the suggestions everyone! :tada:
expede Jan 26, 2024
454670c
Update cargo
expede Jan 26, 2024
a22b0c2
Feels like a hack, but that's a workable serializaion strategy
expede Jan 27, 2024
c69c7ba
Ahead of proven contraint
expede Jan 27, 2024
f9c712d
Actually on checking code afetr getting stuck with serde
expede Jan 27, 2024
2ff88a1
LOL wow the hacks, but honestly these will clean up nicely
expede Jan 27, 2024
7bfc238
Promising direction!
expede Jan 28, 2024
f0a5bf4
Making headway!
expede Jan 28, 2024
66502a8
Much improved proof checking
expede Jan 28, 2024
831695d
Implement CRUD heirarchy to test it out -- seems fine
expede Jan 28, 2024
8f9053a
Save state
expede Jan 28, 2024
6382d8a
Save before changig CheckSelf
expede Jan 29, 2024
f24fcf8
Proving almost done
expede Jan 29, 2024
2355b79
Fixed conditions
expede Jan 29, 2024
21af73e
Got rid of the extra constraint... but at what cost?!??!
expede Jan 29, 2024
f417565
Rounding out types & breaking up modules
expede Jan 30, 2024
9cb6cdf
Break up modules in advance of cleanup
expede Jan 31, 2024
9c6fb07
More cleanup
expede Jan 31, 2024
fdaae6c
I think mainly done moving modules around
expede Jan 31, 2024
8ff556c
Serde sometimes, I tell ya
expede Feb 1, 2024
406b72d
Roughly completed the metadata subsystem
expede Feb 1, 2024
5ec4b9f
Save ahead of wasming
expede Feb 1, 2024
d8ebca2
Save point before riping out pointers
expede Feb 2, 2024
c8bfde7
Learning about Wasm bindgen
expede Feb 2, 2024
f668aa6
Ipld <-> JsValue
expede Feb 2, 2024
5fb875f
okay well this time it compiles :P
expede Feb 2, 2024
9461d8d
Save debugging bindgen
expede Feb 3, 2024
d435ee4
Needs lots of cleanup, but the wasm startegy seems to work
expede Feb 3, 2024
1b36674
Abstracted out lots of dynamic parts / added hooks for lots of things
expede Feb 4, 2024
9209f75
Save before compiling JS bindings
expede Feb 4, 2024
d24f8f4
Happily builds for wasm including JS bindgings
expede Feb 4, 2024
e5fdd53
Configure wasm-pack & wasm-opt
expede Feb 4, 2024
220c9a4
Starting on high-level interfaces :D
expede Feb 5, 2024
1edf634
Many docs. Very wow.
expede Feb 6, 2024
395cbc2
more doctests
expede Feb 6, 2024
448fdfb
Save for the day; working on JS nonce gen
expede Feb 6, 2024
e81f5a5
Finished another round of fighting with feature flags
expede Feb 6, 2024
e739577
Time!
expede Feb 6, 2024
0766cfe
Save
expede Feb 7, 2024
a111ffb
No more meta handling
expede Feb 7, 2024
e8d7afe
Save ahead of reorg
expede Feb 7, 2024
1ed78e1
Save before reworking Promise
expede Feb 7, 2024
c60234f
Fixin' warnings!
expede Feb 8, 2024
4c64c7a
What a saga!
expede Feb 9, 2024
a1d661c
Lots of cleanup
expede Feb 9, 2024
6fefae5
I believe that's most of teh abilities done.
expede Feb 10, 2024
3c2e49a
Save poijt
expede Feb 10, 2024
366c416
Time to go through the type constraints
expede Feb 10, 2024
ae01353
Much simplified delegationpayload
expede Feb 10, 2024
a51202f
Much simplification
expede Feb 10, 2024
3097b3d
Needs renaming, but custom serializer feels much better
expede Feb 10, 2024
3588c29
Lost of docs, wired invocation into the delegation checker
expede Feb 11, 2024
4f3468f
Save before trait reorg
expede Feb 12, 2024
1b68922
Actually chekc the delegation chain
expede Feb 12, 2024
d5e0b13
On to the crypto
expede Feb 12, 2024
ef39431
OKay I lied; I wrote the delegation agent instead
expede Feb 12, 2024
5314d82
DID Key crypto
expede Feb 13, 2024
3f69fc9
Parameterized by DID
expede Feb 13, 2024
23472a2
Tests passing again
expede Feb 13, 2024
3b8d57d
Working on presets
expede Feb 13, 2024
9012ce3
Save point after writing the signature envelope
expede Feb 13, 2024
cc5d305
VERY WIP invocation agent
expede Feb 14, 2024
1b60658
Working on invocaton agent
expede Feb 15, 2024
d99e16a
Most of the way through invocation agent
expede Feb 16, 2024
acc564e
compiles again... back to cleanup
expede Feb 17, 2024
70ff160
Fix linter warnings, starting to remove commented out sections
expede Feb 17, 2024
a48e35c
Attempting to remove some crates
expede Feb 17, 2024
bcf6a50
Remove unused crates
expede Feb 17, 2024
a8ff1f3
Custom serilaizer
expede Feb 17, 2024
eef78f3
Cleaning up naming, squashing TODOs, adding error types
expede Feb 17, 2024
d1f05f3
Clean up did:key
expede Feb 17, 2024
e9a77c2
Save before some newtyping
expede Feb 17, 2024
83f8e6d
Newtype invocation
expede Feb 17, 2024
233397e
Delegation newtype
expede Feb 17, 2024
c2dcb1d
Better docs
expede Feb 17, 2024
a358ffb
Break up a few modules
expede Feb 18, 2024
6b98b49
Move signature under crypto
expede Feb 18, 2024
c41e0b8
Porting IPLD proptest helpers from inlien-ipld
expede Feb 18, 2024
58f5300
More Arbitrary instances
expede Feb 18, 2024
bf3e2ff
Add more arbitrary (receipt paylaod)
expede Feb 18, 2024
5016132
Varsig implementation
expede Feb 19, 2024
76f0fc9
Expose CID helpers
expede Feb 21, 2024
66efbda
Massively simplify instanced for abilities
expede Feb 21, 2024
322b2c6
Cleanup after simplifying promises
expede Feb 22, 2024
8522b55
In theory, that's fully updated
expede Feb 24, 2024
5666899
Working on policy DSL
expede Feb 27, 2024
d1fbad7
Big chunk through the interpreter
expede Feb 28, 2024
ffd4f1a
Big chunk of the way through the first pass on the interpreter
expede Feb 28, 2024
00c9806
Switched to maps for better indexing
expede Feb 28, 2024
a3b328a
Saving
expede Feb 28, 2024
8c936aa
Just need to add pattern matching unification
expede Feb 28, 2024
730894f
Autoencode
expede Feb 29, 2024
5bdba9b
Minimal predicate language
expede Mar 2, 2024
e00f68d
selector parser
expede Mar 3, 2024
3143c39
Swap all files to predicates from condition
expede Mar 4, 2024
65987cd
Cleanup post-spec updates
expede Mar 5, 2024
b156a3a
Going through FIXMEs
expede Mar 5, 2024
6055dd2
Ahead of ripping out devshell for blst
expede Mar 5, 2024
cd22a59
Begn conversion
expede Mar 5, 2024
f5e9cc5
Recover command menu
expede Mar 6, 2024
4541170
Plugging various FIXMEs
expede Mar 6, 2024
abce1e3
Save before fixing promises
expede Mar 6, 2024
4db9cf5
Hugely fixup the promise hierarchy
expede Mar 6, 2024
537811f
Switch to envelope trait
expede Mar 7, 2024
d7a7e11
add default for in memory store
expede Mar 7, 2024
a5180cd
Helpers for integrating to server
expede Mar 7, 2024
656b529
u64 because libpld
expede Mar 7, 2024
ff366c5
update for u64 everywhere
expede Mar 7, 2024
842bf28
Builders
expede Mar 7, 2024
2cb8ef8
lol oops
expede Mar 7, 2024
51c3b02
oops again!
expede Mar 7, 2024
ec1b2b6
PartialOrd
expede Mar 7, 2024
33a0ac3
Defaults
expede Mar 7, 2024
cfe55fd
this is such test code lol
expede Mar 7, 2024
8ecd176
Give delegation an encode instance
expede Mar 7, 2024
326338c
Helper functions on memstore
expede Mar 7, 2024
d5cfbac
make method public
expede Mar 7, 2024
8213091
printable error
expede Mar 7, 2024
6e746ad
Hopefully this eliminates the stack overflow?
expede Mar 7, 2024
39939f4
remote debugging... gross
expede Mar 7, 2024
d0d9055
good ol' printline debugging
expede Mar 7, 2024
f50445d
Serialize to IPLD
expede Mar 7, 2024
6a08986
Better defaults for inv payload builder
expede Mar 7, 2024
ef77814
same for invocation
expede Mar 8, 2024
2f38108
Add some dbg
expede Mar 8, 2024
6e9131c
debugging the store
expede Mar 8, 2024
5c3cea5
Dios mio memstore test works now
expede Mar 8, 2024
9afd69d
WIP
expede Mar 9, 2024
30e687c
Remove bools from pred lang
expede Mar 9, 2024
02d4c2f
Working on predicate unification / symbolic matching
expede Mar 12, 2024
bfae427
Add "via" functionality
expede Mar 13, 2024
b65ec3e
Defaults
expede Mar 13, 2024
61ed0ca
Much work, but clearer what's required
expede Mar 14, 2024
fce6a9a
Introduced (correctly) failing test
expede Mar 14, 2024
aa41773
Evidently proof search is borked
expede Mar 15, 2024
42358bb
Fix test
expede Mar 15, 2024
fa90a81
Plugging little edge cases in invocation agent flow
expede Mar 15, 2024
08f72df
Manual test context
expede Mar 16, 2024
2cb9a70
Fixed test
expede Mar 16, 2024
de000f2
Don't mind me, just fighting with varint in did:key
expede Mar 16, 2024
507507e
DID key test vectors all succeed
expede Mar 16, 2024
3bba844
Manualy test all DID test vectors
expede Mar 16, 2024
2ef67b3
working on filter parsing edge cases with proptests
expede Mar 16, 2024
02b37bd
I guess manually parsing is the right thing sometimes
expede Mar 17, 2024
8c70158
More tests, mainly fixing arbitrary instances
expede Mar 17, 2024
71ee7f3
Fixed errors in Nonce comparison
expede Mar 17, 2024
07ed478
Fix glob matcher
expede Mar 18, 2024
b965982
Working on edge cases in selector parser
expede Mar 18, 2024
c949a4f
refactor: Adjustments to `Store`s & `Agent`s (#9)
matheus23 Mar 21, 2024
3503a32
Fairly complete predicate tests
expede Mar 18, 2024
deee2bc
WIP rebasing
expede Mar 21, 2024
93cce69
Revert so that can push
expede Mar 21, 2024
643b466
Correct the `FIXME` for command
expede Mar 21, 2024
faba286
Test delegation store
expede Mar 22, 2024
246578b
WIP testing
expede Mar 23, 2024
279f17c
Save WIP writng more tests
expede Mar 25, 2024
6affc01
Not pretty, but got that last selector passing
expede Mar 25, 2024
bc0a275
Add automatic CID conversaion error
expede Mar 26, 2024
96b0fe1
Receipts as invocations
expede Mar 26, 2024
4913ad0
Require Subject on get_chain
expede Mar 26, 2024
13510c5
Merge pull request #12 from fission-codes/test-deleg-store
matheus23 Mar 26, 2024
ff87859
Merge pull request #13 from fission-codes/wrap_auto_cid_insert
matheus23 Mar 26, 2024
d854438
Merge pull request #15 from fission-codes/remove-unrestricted-powerbo…
matheus23 Mar 26, 2024
2172b21
fix: Error early in `Agent::invoke` if there's no valid delegation chain
matheus23 Mar 21, 2024
f894e69
fix: Check for delegations for the specific command, not for "/"
matheus23 Mar 21, 2024
5d26366
refactor: Rename `MissingDelegation` -> `DelegationNotFound`
matheus23 Mar 22, 2024
4bd583a
refactor: Use `Mutex` instead of `RwLock`
matheus23 Mar 22, 2024
fd0922f
fix: Check for the appropriate command in `Agent::delegate`
matheus23 Mar 22, 2024
0dfb2a6
refactor: Take `command: &str` instead of by `String` in `Store::get_…
matheus23 Mar 22, 2024
8cc6ac5
refactor: Turn `try_fold` into for loop in `Invocation::check`
matheus23 Mar 22, 2024
d0fab39
Revert "refactor: Turn `try_fold` into for loop in `Invocation::check`"
matheus23 Mar 25, 2024
5dbd296
Merge pull request #11 from fission-codes/matheus23/v1.0-2
matheus23 Mar 26, 2024
7f680d3
refactor: Remove unused constraints (#17)
matheus23 Mar 27, 2024
53c49d2
Nonce simplification (#19)
expede Mar 27, 2024
a00db2d
Rename `CannotCidOr`, API for creating powerlines & more (#18)
matheus23 Mar 28, 2024
a8d1b1d
Cleanup unused imports & bump Nix Flake (#16)
expede Mar 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
tool: 'cargo'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.event_name == 'push' && github.repository == 'ucan-wg/rs-ucan' && github.ref == 'refs/heads/main' }}
auto-push: ${{ github.event_name == 'push' && github.repository == 'ucan-wg/ucan' && github.ref == 'refs/heads/main' }}
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Generate Code coverage
env:
CARGO_INCREMENTAL: '0'
LLVM_PROFILE_FILE: "rs-ucan-%p-%m.profraw"
LLVM_PROFILE_FILE: "ucan-%p-%m.profraw"
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
run: cargo test --all-features
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to rs-ucan
# Contributing to ucan

We welcome everyone to contribute what and where they can. Whether you are brand
new, just want to contribute a little bit, or want to contribute a lot there is
Expand Down Expand Up @@ -84,7 +84,7 @@ need to be the best programmer to contribute. Our discord is open for questions.
- You can learn more about cloning repositories [here][git-clone].

6. **Build** the project
- For a detailed look on how to build rs-ucan look at our
- For a detailed look on how to build ucan look at our
[README file](./README.md).

7. **Start writing** your code
Expand Down
38 changes: 24 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[package]
name = "rs-ucan"
version = "0.1.0"
name = "ucan"
version = "0.2.0"
description = "Rust implementation of UCAN"
keywords = []
keywords = ["capabilities", "authorization", "ucan"]
categories = []
include = ["/src", "/examples", "/benches", "README.md", "LICENSE"]
license = "Apache-2.0"
readme = "README.md"
edition = "2021"
rust-version = "1.67"
documentation = "https://docs.rs/rs-ucan"
repository = "https://github.com/ucan-wg/rs-ucan"
authors = ["Quinn Wilton <quinn@quinnwilton.com>"]
rust-version = "1.75"
documentation = "https://docs.rs/ucan"
repository = "https://github.com/ucan-wg/ucan"
authors = ["Quinn Wilton <quinn@quinnwilton.com>", "Brooklyn Zelenka <hello@brooklynzelenka.com"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have matching websites 🙈


[lib]
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
bench = false

[[bench]]
name = "a_benchmark"
name = "a_benchmark" # TODO rename
harness = false
required-features = ["test_utils"]

Expand All @@ -29,40 +29,49 @@ path = "examples/counterparts.rs"

[dependencies]
anyhow = "1.0.75"
aquamarine = { version = "0.5", optional = true }
async-signature = "0.4.0"
async-trait = "0.1.73"
blst = { version = "0.3.11", optional = true, default-features = false }
cfg-if = "0.1"
cid = "0.10.1"
cid = "0.10"
did_url = "0.1"
downcast-rs = "1.2.0"
dyn-clone = "1.0.14"
ecdsa = { version = "0.16.8", optional = true, default-features = false }
ed25519 = { version = "2.2.2", optional = true, default-features = false }
ed25519-dalek = { version = "2.0.0", features = ["rand_core"], optional = true }
enum-as-inner = "0.6"
erased-serde = "0.3.31"
jose-b64 = { version = "0.1.2", features = ["serde", "json"] }
k256 = { version = "0.13.1", features = ["ecdsa"], optional = true, default-features = false }
lazy_static = "1.4.0"
libipld-core = "0.16.0"
libipld-core = { version = "0.16", features = ["serde-codec"] }
libipld-cbor = "0.16"
multibase = "0.9.1"
multihash = {version = "0.19", features = ["serde"]}
p256 = { version = "0.13.2", features = ["ecdsa"], optional = true, default-features = false }
p384 = { version = "0.13.0", features = ["ecdsa"], optional = true, default-features = false }
p521 = { version = "0.13.0", optional = true, default-features = false }
proptest = { version = "1.1", optional = true }
regex = "1.10"
rsa = { version = "0.9.2", features = ["sha2"], optional = true, default-features = false }
semver = "1.0.19"
serde = { version = "1.0.188", features = ["derive"] }
serde_derive = "1.0"
serde_json = "1.0.107"
signature = { version = "2.1.0", features = ["alloc"] }
thiserror = "1.0"
tracing = "0.1.40"
unsigned-varint = "0.7.2"
url = "2.4.1"
url = { version = "2.5", features = ["serde"] }
web-time = "0.2.3"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# `linkme` relies on linker features that aren't available in wasm32
linkme = "0.3.15"
uuid = { version = "1.7", features = ["v4"] }
xid = "1.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = { version = "0.1" }
Expand All @@ -74,7 +83,7 @@ wasm-bindgen-futures = { version = "0.4" }
web-sys = { version = "0.3", features = ["Crypto", "CryptoKey", "CryptoKeyPair", "SubtleCrypto"] }

[dev-dependencies]
multihash = "0.18.0"
multihash = "0.18"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = "0.4"
Expand Down Expand Up @@ -105,12 +114,13 @@ es512-verifier = ["es512"]
ps256-verifier = ["ps256"]
rs256-verifier = ["rs256"]
bls-verifier = ["bls"]
mermaid_docs = ["aquamarine"]

[metadata.docs.rs]
[package.metadata.docs.rs]
all-features = true
# defines the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]
#
cargo-args = ["--features='mermaid_docs'"]
# See https://doc.rust-lang.org/cargo/reference/profiles.html for more info.
# [profile.release]
# Do not perform backtrace for panic on release builds.
Expand Down
122 changes: 67 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<div align="center">
<a href="https://github.com/ucan-wg/rs-ucan" target="_blank">
<img src="https://raw.githubusercontent.com/ucan-wg/rs-ucan/main/assets/a_logo.png" alt="rs-ucan Logo" width="100"></img>
<a href="https://github.com/ucan-wg/ucan" target="_blank">
<img src="https://raw.githubusercontent.com/ucan-wg/ucan/main/assets/logo.png" alt="ucan Logo" width="100"></img>
</a>

<h1 align="center">rs-ucan</h1>
<h1 align="center">ucan</h1>

<p>
<a href="https://crates.io/crates/rs-ucan">
<img src="https://img.shields.io/crates/v/rs-ucan?label=crates" alt="Crate">
<a href="https://crates.io/crates/ucan">
<img src="https://img.shields.io/crates/v/ucan?label=crates" alt="Crate">
</a>
<a href="https://codecov.io/gh/ucan-wg/rs-ucan">
<img src="https://codecov.io/gh/ucan-wg/rs-ucan/branch/main/graph/badge.svg?token=SOMETOKEN" alt="Code Coverage"/>
<a href="https://codecov.io/gh/ucan-wg/ucan">
<img src="https://codecov.io/gh/ucan-wg/ucan/branch/main/graph/badge.svg?token=SOMETOKEN" alt="Code Coverage"/>
</a>
<a href="https://github.com/ucan-wg/rs-ucan/actions?query=">
<img src="https://github.com/ucan-wg/rs-ucan/actions/workflows/tests_and_checks.yml/badge.svg" alt="Build Status">
<a href="https://github.com/ucan-wg/ucan/actions?query=">
<img src="https://github.com/ucan-wg/ucan/actions/workflows/tests_and_checks.yml/badge.svg" alt="Build Status">
</a>
<a href="https://github.com/ucan-wg/rs-ucan/blob/main/LICENSE">
<a href="https://github.com/ucan-wg/ucan/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License">
</a>
<a href="https://docs.rs/rs-ucan">
<a href="https://docs.rs/ucan">
<img src="https://img.shields.io/static/v1?label=Docs&message=docs.rs&color=blue" alt="Docs">
</a>
<a href="https://discord.gg/4UdeQhw7fv">
Expand All @@ -29,71 +29,63 @@

<div align="center"><sub>:warning: Work in progress :warning:</sub></div>

##

## Outline

- [Usage](#usage)
- [Testing the Project](#testing-the-project)
- [Benchmarking the Project](#benchmarking-the-project)
- [Contributing](#contributing)
- [Getting Help](#getting-help)
- [External Resources](#external-resources)
- [License](#license)

## Usage

Add the following to the `[dependencies]` section of your `Cargo.toml` file:

```toml
rs-ucan = "0.1.0"
ucan = "1.0.0-rc.1"
```

## Testing the Project

- Run tests
Run tests

```console
cargo test
```
| Nix | Cargo |
|------------|--------------|
| `test:all` | `cargo test` |

## Benchmarking the Project

For benchmarking and measuring performance, this project leverages
[criterion][criterion] and a `test_utils` feature flag
for integrating [proptest][proptest] within the the suite for working with
[strategies][strategies] and sampling from randomly generated values.
[Criterion] and a `test_utils` feature flag
for integrating [proptest] within the the suite for working with
[strategies] and sampling from randomly generated values.

- Run benchmarks
## Benchmarks

```console
cargo bench --features test_utils
```
| 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.md) to help you get involved. We
also adhere to our [Code of Conduct](./CODE_OF_CONDUCT.md).
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][nix-flake] that initiates both the Rust
toolchain set in [rust-toolchain.toml](./rust-toolchain.toml) and a
[pre-commit hook](#pre-commit-hook). It also installs helpful cargo binaries for
development. Please install [nix][nix] and [direnv][direnv] to get started.
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][pre-commit] for running pre-commit
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_
Expand All @@ -103,7 +95,7 @@ hooks. Please run this before every commit and/or push.
### Recommended Development Flow

- We recommend leveraging [cargo-watch][cargo-watch],
[cargo-expand][cargo-expand] and [irust][irust] for Rust development.
[`cargo-expand`] and [IRust] for Rust development.
- We recommend using [cargo-udeps][cargo-udeps] for removing unused dependencies
before commits and pull-requests.

Expand All @@ -125,31 +117,51 @@ a type of `fix`, `feat`, `docs`, `ci`, `refactor`, etc..., structured like so:

## Getting Help

For usage questions, usecases, or issues reach out to us in our [Discord channel](https://discord.gg/4UdeQhw7fv).
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.
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].
This project is [licensed under the Apache License 2.0][LICENSE], or
[http://www.apache.org/licenses/LICENSE-2.0][Apache].

<!-- Internal Links -->

[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

<!-- Local Links -->

[CONTRIBUTING]: ./CONTRIBUTING.md
[LICENSE]: ./LICENSE
[Code of Conduct]: ./CODE_OF_CONDUCT.md
[`rust-toolchain.toml`]: ./rust-toolchain.toml

<!-- External Links -->

[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
[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
[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
[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/
[proptest]: https://github.com/proptest-rs/proptest
[strategies]: https://docs.rs/proptest/latest/proptest/strategy/trait.Strategy.html
[UCAN Discord]: https://discord.gg/4UdeQhw7fv
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## Report a security issue or vulnerability

The rs-ucan team welcomes security reports and is committed to
The `ucan` team welcomes security reports and is committed to
providing prompt attention to security issues. Security issues should be
reported privately via [quinn@fission.codes][support-email]. Security issues should
not be reported via the public GitHub Issue tracker.

## Security advisories

The project team is committed to transparency in the security issue disclosure
process. The rs-ucan team announces security advisories through our
process. The ucan team announces security advisories through our
Github respository's [security portal][sec-advisories] and and the
[RustSec advisory database][rustsec-db].

[rustsec-db]: https://github.com/RustSec/advisory-db
[sec-advisories]: https://github.com/ucan-wg/rs-ucan/security/advisories
[sec-advisories]: https://github.com/ucan-wg/ucan/security/advisories
[support-email]: mailto:quinn@fission.codes
4 changes: 2 additions & 2 deletions benches/a_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use criterion::{criterion_group, criterion_main, Criterion};

pub fn add_benchmark(c: &mut Criterion) {
let mut rvg = rs_ucan::test_utils::Rvg::deterministic();
let mut rvg = ucan::test_utils::Rvg::deterministic();
let int_val_1 = rvg.sample(&(0..100i32));
let int_val_2 = rvg.sample(&(0..100i32));

c.bench_function("add", |b| {
b.iter(|| {
rs_ucan::add(int_val_1, int_val_2);
ucan::add(int_val_1, int_val_2);
})
});
}
Expand Down
1 change: 1 addition & 0 deletions examples/counterparts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::error::Error;

// TODO what is this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just from the template to fill in having an example of the library :). https://doc.rust-lang.org/cargo/guide/project-layout.html

pub fn main() -> Result<(), Box<dyn Error>> {
println!("Alien Shore!");
Ok(())
Expand Down