diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 11cc1729..63541e1f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,2 @@ # Default -* @cdata -* @ucan-wg/fission +* @cdata @ucan-wg/fission diff --git a/README.md b/README.md index 4e1c5ff3..763c247d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@
- rs-ucan Logo + rs-ucan Logo

rs-ucan

- + Crate Information diff --git a/ucan-key-support/README.md b/ucan-key-support/README.md index 65a02998..4f09b28b 100644 --- a/ucan-key-support/README.md +++ b/ucan-key-support/README.md @@ -1,6 +1,36 @@ -# ucan-key-support +

+ + rs-ucan Logo + + +

ucan-key-support

+ +

+ + Crate Information + + + Code Coverage + + + Build Status + + + License + + + Docs + + + Discord + +

+
+ + +## This is an auxilliary crate containing ready-to-use `SigningKey` implementations -for the Rust UCAN implementation. +for the [Rust UCAN implementation][rs-ucan]. -See https://docs.rs/ucan-key-support for documentation. +[rs-ucan]: https://docs.rs/ucan diff --git a/ucan/README.md b/ucan/README.md index 3ac96108..11fefd37 100644 --- a/ucan/README.md +++ b/ucan/README.md @@ -1,5 +1,39 @@ -# ucan +
+ + rs-ucan Logo + -This is the core Rust UCAN implementation. +

ucan

-See https://docs.rs/ucan for documentation. +

+ + Crate Information + + + Code Coverage + + + Build Status + + + License + + + Docs + + + Discord + +

+
+ + +## + +This is a Rust library to help the next generation of web applications make use +of UCANs in their authorization flows. To learn more about UCANs and how you +might use them in your application, visit [https://ucan.xyz][ucan website] or +read the [spec][spec]. + +[spec]: https://github.com/ucan-wg/spec +[ucan website]: https://ucan.xyz diff --git a/ucan/src/builder.rs b/ucan/src/builder.rs index ee38fe2f..ea9005b6 100644 --- a/ucan/src/builder.rs +++ b/ucan/src/builder.rs @@ -85,7 +85,7 @@ where let header_base64 = header.jwt_base64_encode()?; let payload_base64 = payload.jwt_base64_encode()?; - let data_to_sign = format!("{}.{}", header_base64, payload_base64) + let data_to_sign = format!("{header_base64}.{payload_base64}") .as_bytes() .to_vec(); let signature = self.issuer.sign(data_to_sign.as_slice()).await?; @@ -232,7 +232,7 @@ where let proof_index = self.proofs.len() - 1; let proof_delegation = ProofDelegationSemantics {}; let capability = - proof_delegation.parse(&format!("prf:{}", proof_index), "ucan/DELEGATE"); + proof_delegation.parse(&format!("prf:{proof_index}"), "ucan/DELEGATE"); match capability { Some(capability) => { diff --git a/ucan/src/capability/proof.rs b/ucan/src/capability/proof.rs index bed6d902..798656c4 100644 --- a/ucan/src/capability/proof.rs +++ b/ucan/src/capability/proof.rs @@ -68,7 +68,7 @@ impl TryFrom for ProofSelection { impl ToString for ProofSelection { fn to_string(&self) -> String { match self { - ProofSelection::Index(usize) => format!("prf:{}", usize), + ProofSelection::Index(usize) => format!("prf:{usize}"), ProofSelection::All => "prf:*".to_string(), } } diff --git a/ucan/src/capability/semantics.rs b/ucan/src/capability/semantics.rs index b6088256..85365d1a 100644 --- a/ucan/src/capability/semantics.rs +++ b/ucan/src/capability/semantics.rs @@ -149,7 +149,7 @@ where match self { With::Resource { kind } => kind.to_string(), With::My { kind } => format!("my:{}", kind.to_string()), - With::As { did, kind } => format!("as:{}:{}", did, kind.to_string()), + With::As { did, kind } => format!("as:{did}:{}", kind.to_string()), } } } @@ -184,7 +184,7 @@ where _ => return None, }; - Some((format!("did:key:{}", value), path_parts.collect())) + Some((format!("did:key:{value}"), path_parts.collect())) } fn parse_resource(&self, with: &Url) -> Option> { diff --git a/ucan/src/ipld/principle.rs b/ucan/src/ipld/principle.rs index e2211616..a594f8ca 100644 --- a/ucan/src/ipld/principle.rs +++ b/ucan/src/ipld/principle.rs @@ -36,7 +36,7 @@ impl Display for Principle { _ => [DID_KEY_PREFIX, &bs58::encode(bytes).into_string()].concat(), }; - write!(f, "{}", did_content) + write!(f, "{did_content}") } } diff --git a/ucan/src/ucan.rs b/ucan/src/ucan.rs index 5fe4369f..7bbb0aae 100644 --- a/ucan/src/ucan.rs +++ b/ucan/src/ucan.rs @@ -86,7 +86,7 @@ impl Ucan { let payload = self.payload.jwt_base64_encode()?; let signature = base64::encode_config(self.signature.as_slice(), base64::URL_SAFE_NO_PAD); - Ok(format!("{}.{}.{}", header, payload, signature)) + Ok(format!("{header}.{payload}.{signature}")) } /// Returns true if the UCAN has past its expiration date @@ -222,7 +222,7 @@ impl FromStr for Ucan { .split('.') .take(2) .map(String::from) - .reduce(|l, r| format!("{}.{}", l, r)) + .reduce(|l, r| format!("{l}.{r}")) .ok_or_else(|| anyhow!("Could not parse signed data from token string"))?; let mut parts = ucan_token.split('.').map(|str| {