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

Encode/decode rountrip error with UcanResource::OwnedBy #7

Open
matheus23 opened this issue Jan 24, 2024 · 0 comments
Open

Encode/decode rountrip error with UcanResource::OwnedBy #7

matheus23 opened this issue Jan 24, 2024 · 0 comments

Comments

@matheus23
Copy link
Member

This test case fails:

#[test]
fn test_broken_ucan() -> Result<()> {
    let issuer = &EdDidKey::generate();
    let ucan: Ucan = UcanBuilder::default()
        .for_audience(issuer)
        .claiming_capability(Capability::new(
            UcanResource::OwnedBy(issuer.did()),
            TopAbility,
            EmptyCaveat,
        ))
        .sign(issuer)?;

    // This should work
    assert_matches!(
        Ucan::<DefaultFact, DefaultCapabilityParser>::from_str(&ucan.encode()?),
        Ok(_)
    );

    Ok(())
}

The error message I get:

panicked at 'assertion failed: `Err(TokenParseError { msg: "malformed payload" })` does not match `Ok(_)`'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant