Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
remove obsolete test
Browse files Browse the repository at this point in the history
  • Loading branch information
chunningham committed Sep 22, 2023
1 parent f0e7dca commit 8d50961
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions src/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,75 +31,3 @@ impl_fromreq!(Delegation, "Authorization");
// currently delegations and invocations are really the same type
// impl_fromreq!(Invocation, "Authorization");
impl_fromreq!(Revocation, "Authorization");

#[cfg(test)]
mod test {
use kepler_lib::{
libipld::cid::Cid,
resolver::DID_METHODS,
ssi::{
did::{Document, Source},
did_resolve::DIDResolver,
jwk::{Algorithm, JWK},
jws::Header,
ucan::{Capability, Payload},
vc::NumericDate,
},
};

async fn gen(
iss: &JWK,
aud: String,
caps: Vec<Capability>,
exp: f64,
prf: Vec<Cid>,
) -> (Document, Thing) {
let did = DID_METHODS
.generate(&Source::KeyAndPattern(iss, "key"))
.unwrap();
(
DID_METHODS
.resolve(&did, &Default::default())
.await
.1
.unwrap(),
gen_ucan((iss, did), aud, caps, exp, prf).await,
)
}
async fn gen_ucan(
iss: (&JWK, String),
audience: String,
attenuation: Vec<Capability>,
exp: f64,
proof: Vec<Cid>,
) -> Thing {
let p = Payload {
issuer: iss.1,
audience,
attenuation,
proof,
nonce: None,
not_before: None,
facts: None,
expiration: NumericDate::try_from_seconds(exp).unwrap(),
}
.sign(Algorithm::EdDSA, iss.0)
.unwrap();
Thing {
token: p.encode().unwrap(),
payload: p.payload,
header: p.header,
}
}

#[derive(serde::Serialize)]
struct Thing {
pub token: String,
pub payload: Payload,
pub header: Header,
}
#[test]
async fn basic() -> anyhow::Result<()> {
Ok(())
}
}

0 comments on commit 8d50961

Please sign in to comment.