Giter VIP home page Giter VIP logo

conformance-tests's Introduction

ucan-fixture-generator Logo

ucan-fixture-generator

Crate License Docs

⚠️ Work in progress ⚠️

Outline

Installation

Using cargo

cargo install ucan-fixture-generator

Testing the Project

  • Run tests

    cargo test

Contributing

🎈 We're thankful for any feedback and help in improving our project! We have a contributing guide 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 and direnv to get started.

Run nix develop or direnv allow to load the devShell flake output, according to your preference.

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

Conventional Commits

This project lightly follows the Conventional Commits convention to help explain commit history and tie in with our release process. The full specification can be found here. We recommend prefixing your commits with a type of fix, feat, docs, ci, refactor, etc..., structured like so:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Getting Help

For usage questions, usecases, or issues please open an issue in our repository.

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, or http://www.apache.org/licenses/LICENSE-2.0.

conformance-tests's People

Contributors

bgins avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

conformance-tests's Issues

Update grouping of fixtures to clarify tasks

Summary

Problem

The current fixtures mix validation and capability checks into verify and refute tasks.

Impact

The task intention for the fixtures is confounded and would be clearer if broken into more task categories.

Solution

Break the fixtures into groups like

  1. validate (the UCAN is valid)
  2. prove (the UCAN grants some capability with respect to some issuer)
  3. refute (the UCAN is invalid)
  4. disprove (the UCAN does not grant some capability with respect to some issuer)

Names not final! But the idea is that we would separate out tests that require a check for capabilities, and provide extra context like which capabilities should be available and a timestamp when they should be available.

Additionally, we may be able to add build fixtures where an implementation creates proofs and UCAN, puts the proofs in a store, then checks that their UCAN satisfies some capability check. This would replace the flawed build fixtures referenced in #14.

Add capability semantics

Summary

Problem

We want capability semantics to generate fixtures that demonstrate delegation.

Impact

The fixtures will be uninteresting without some delegation.

Solution

Borrow capabilities schemes from rs-ucan. Note that they wnfs capabilities may need to be updated.

Add GH pages

Summary

Problem

We do not have a mechanism to make the fixtures available to implementations.

Impact

Implementations cannot test without the fixtures.

Solution

Add GH pages that serves from the fixtures directory. It should include an index with a high-level description of the fixtures and links to the fixtures themselves.

The fixtures should be namespaced into directories matching their UCAN version.

Detail

Describe alternatives you've considered

There are options! An implementation could pull in the fixtures as a git submodule or copy-paste directly into their project. Making the fixtures available on endpoints makes them easily accessible.

Add identity and key support

Summary

Problem

We need identity and key support to create and sign UCANs.

Impact

We get nowhere.

Solution

Add identity and key support. Some of this can be borrowed from the rs-ucan test fixtures.

Remove time bounds violation fixtures for UCANs that outlive proofs

Summary

Problem

We have some fixtures that are marked as invalid when they expire after their proofs. But a UCAN may be valid for only some capabilities, which means we can't directly correlate time bounds against a single proof.

Impact

The fixtures are invalid and may indicate incorrect information about time bounds. Time bounds should be checked at invocation with the associated proof as context.

Solution

Remove the relevant fixtures.

Generate toCID fixtures

Summary

Problem

We want to generate fixtures that test toCID functionality in implementations.

Impact

If implementations generate CIDs incorrectly, proofs may not be resolved.

Solution

Generate toCID fixtures. Given a token and a hasher, the output should be some CID.

Remove build fixtures

Summary

Problem

The build fixtures are not possible to test against because the signature is dependent on the representation of serialized JSON, which may vary depending on the JSON encoder.

Impact

Fixtures that can't easily be tested. Implementer frustration.

Solution

Remove the build fixture generator code and the build fixtures. (The fixtures are on #13 at the moment.)

Update proofs in fixtures

Summary

Problem

Fixtures currently include a proof map like:

      "proofs": {
        "bafkreie3bfwr2pxtzphzpspb3plvdrh3obq5yiyibfuuiqj2m3kcrrexpu": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJkaWQ6a2V5Ono2TWtmZkRaQ2tDVFdyZWc4ODY4ZkcxRkdGb2djSmo1WDZQWTkzcFBjV0RuOWJvYiIsImNhcCI6e30sImV4cCI6OTI0NjIxMTIwMCwiaXNzIjoiZGlkOmtleTp6Nk1razg5YkMzSnJWcUtpZTcxWUVjYzVNMVNNVnh1Q2dOeDZ6TFo4U1lKc3hBTGkiLCJuYmYiOjEsInVjdiI6IjAuMTAuMCJ9.qvC6-4agkAxd72ZKNardHy8YHpKGAhz9sbNlWMys0LBoccifGCl-9Yz3bpy4SuosAbWy-W2tc5MGzFCNRmLpAw"
      }

but the ucan-http-bearer-token spec has been updated to put all proofs in a UCAN proof array: https://github.com/ucan-wg/ucan-http-bearer-token#23-example

Impact

The original intuition for proofs in a map no longer applies. In addition, an implementer might incorrectly cache proofs rather than computing their CIDs.

Solution

Present proofs as an array of tokens.

Generate verification fixtures

Summary

Problem

We want to generate fixtures that can be checked by implementations.

Impact

No fixtures, nothing for implementations to check.

Solution

Generate a set of valid and invalid fixtures.

ETA: 2023-08-18

Generate build fixtures

Summary

Problem

We want to generate fixtures that test whether an implementation can correctly build a UCAN and emit a token.

Impact

Without these fixtures, an implementation might emit invalid tokens.

Solution

Generate build fixtures. Given key material, algorithm, and a payload, an implementation should be able to emit a token.

Add 0.10.0 fixtures

Summary

Problem

UCAN libraries do not have a set of conformance tests to verify they have correctly implemented UCAN 0.10.0.

Impact

Library authors aren't able to easily verify their implementation.

Solution

Add a set of fixtures at UCAN 0.10.0.

ETA: 2023-09-01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.