Giter Club home page Giter Club logo

traceability-interop's Introduction

Traceability Interoperability Specification

Interoperability Report Conformance Report

About

This specification describes an enterprise grade HTTP API for leveraging W3C Decentralized Identifiers and W3C Verifiable Credentials with W3C CCG Traceability Vocabulary and the VC API when possible.

We encourage contributions meeting the Contribution Guidelines. While we prefer the creation of Issues and Pull Requests in the GitHub repository, discussions often occur on the public-credentials mailing list as well, and at regular public meetings (see MEETINGS.md).

Latest Spec

The current version of the specification can be found at specification

Traceability Interoperability

Getting Started

Reference Implementation

To simplify the creation of test vectors for the spec, we intend to provide a reference implementation.

This implementation will cover all required AND optional APIs, and will be used to ensure no breaking changes are accidentally contributed to the spec.

Postman Test Suites

To ensure conformance and interoperability, tests are conducted in a manner consistent with production environments. We maintain a set of Postman collections and client credential configurations containing conformance and interoperability test suites. These tests are executed via GitHub actions, on demand by implementers, and on a nightly scheduled basis. Please review the linked documentation for instructions on importing these test suites into your own local Postman environment.

This approach allows us to test implementations in production with the appropriate security and authorization policies in place.

If you would like to register an implementation to be tested against the test suite, please review the step-by-step instructions provided here.

Test suite registration is required for participation in upcoming technical demonstrations with various government and non-government entities related to trade and import/export data exchange.

traceability-interop's People

Contributors

acarnagey avatar adamjlemmon avatar alexyenkalov avatar benjaminmoe avatar brownoxford avatar bumblefudge avatar clehner avatar cykoder avatar dependabot[bot] avatar fqutishat avatar gannan08 avatar gjgd avatar ipbyrne avatar kgobin2000 avatar kimdhamilton avatar mavarley avatar mkhraisha avatar mprorock avatar msporny avatar nissimsan avatar or13 avatar patstlouis avatar peacekeeper avatar rhofvendahl avatar rolsonquadras avatar srmalley-sphereon avatar tallted avatar tplooker avatar troyronda avatar vaishnavipanchal23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

traceability-interop's Issues

Selective Disclosure credentials

Follow on from #20. This interoperability profile should include the ability to selectively disclose attributes of credentials. This is currently blocked because of a bug in the BBS+ LD signature suite. w3c/vc-di-bbs#62

We will continue to monitor the situation and include them here once possible.

Define or forbid human readable `exchange-id`

consider:

POST /exchanges/credential-refresh
POST /exchanges/definition-oil-import-from-ca
POST /exchanges/definition-steel-import-from-mx

vs

POST /exchanges/urn:uuid:123

is guessable names a security issue?

if we support a single human readable name, does that mean we support all the other ones?

where is the registry for human readable "workflow definition names" maintained.

Better error handling

When errors occur, there should be helpful messages returned over http.

There should be an error message structure.

The structure should be used when handling 200 responses where the verification failed

There should also be a 400 error message structure, for cases where the client violates the api definition.

There should be test cases for errors, and each variant of an error.

There should be specific cases for revocation, expiration, preactivation.

PROPOSAL: mirror the vc http api structure

I suggest we mirror or directly link to the vc http api now that is has separate spec, and that we clearly separate endpoints not defined in the vc http api to avoid confusion.

Need ability to get credentials for automated testing

We will need be able to store some OAuth2 credentials for service providers to be able to retrieve a bearer token to run integration tests using the trace vocab against various VC-API providers complying with this interop profile.

These tests will run using newman from gh actions

@brownoxford can you take a task of documenting the right approach so that service providers could add credentials to be used with testing, might be as simple as gh secrets, but then we will need to figure out a storage process for a list of secrets that can be matched to a list of service providers to be tested, and document a process for securely sending that info over to an editor on this project so that the keys can be added

What is the response type for resolve Identifier?

{
    "didDocument": {
        "@context": [
            "https://www.w3.org/ns/did/v1",
            "https://w3id.org/security/suites/jws-2020/v1"
        ],
        "id": "did:key:z82LktXPpyJiLELpZ5gKT8eDSxWrbo9USNFeGzu12SZsemEhhGcQeehfVpEZBxP6fuEmQhq",
        ...

or

{
     "@context": [
         "https://www.w3.org/ns/did/v1",
         "https://w3id.org/security/suites/jws-2020/v1"
     ],
     "id": "did:key:z82LktXPpyJiLELpZ5gKT8eDSxWrbo9USNFeGzu12SZsemEhhGcQeehfVpEZBxP6fuEmQhq",
     ...

See: https://api.did.actor/docs#tag--Identifiers

PROPOSAL: Define support for DIDComm / WACI-PEx

WACI-PEx describes an alternate flow for exchanging verifiable presentations:

https://github.com/decentralized-identity/waci-presentation-exchange

Unlike the vc-http-api, it is built on top of message level encryption for DIDs, according to a spec called https://github.com/decentralized-identity/didcomm-messaging

The advantage of WACI-PEx is that messages can flow other transports other than HTTP.

The spec also makes use of https://github.com/decentralized-identity/presentation-exchange

Which defines extensions for verifiable presentations that a verifier can use to request specific kinds of presentations from holders.

I would like to define support for this once it stabilizes so we can establish interoperability with other DIF companies and TOIPs Good Health Pass.

I think for sanity sake, we would need new endpoints for this, luckily they would be generate "DIDComm" service endpoints.

Github workflows contain syntax error

We have this construct in several of the tests:
--reporters cli,jsonname: Mill Test Report Certificate Tests
which results in the following error:
newman: could not find "jsonname:" reporter

Everything after ,json should be removed.

Abstract and Introduction contradict

The abstract talks about this being a vocab and the introduction talks about this being a platform. The abstract can probably be written at a later date and we can track that here

Add CI to run postman tests

We need to add workflow items to run the postman tests on push (secrets are not passed on PR from remote repos). This may require some additional work in getting the suite ready to run in this context. We should also look into how we can publish results of test runs for review (newman produces html artifacts).

Define Universal Wallet objects for presentation submissions in the universal wallet interop spec

This proposal was made originally to link the VC Data Model and Universal Wallet and VC HTTP APIs, together in a way that would support interoperability across HTTP based wallets:

https://github.com/OR13/simple-presentations

We should discuss the associated assumed JSON models related to "handling presentations", including preserving of metadata etc...

Since this work is related to a number of active CCG work items, we may need to cross link here to provide sufficient context.

Openapi JSON generation handles refs awkwardly

We are using swagger-cli to generate docs/openapi/openapi.json based on the manually maintained docs/openapi/openapi.yml. When swagger-cli encounters a ref for the first time, it inlines that ref and then rewrites all subsequent references to point to the inline definition (see APIDevTools/swagger-cli#29).

This results in inlined definitions where we don't really want them, and very awkward references in other places - for example:

                      "title": "Verifiable Credential",
                      "type": "object",
                      "allOf": [
                        {
                          "$ref": "#/paths/~1api~1credentials~1issue/post/requestBody/content/application~1json/schema/properties/credential"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "proof": {
                              "$ref": "#/paths/~1credentials~1%7Bcredential-id%7D/get/responses/200/content/application~1json/schema/allOf/1/properties/proof"
                            }
                          }
                        }
                      ],

One solution here is to modify the openapi.yml file to add new components where needed and rearrange where things live in the file in order to coerce swagger-cli to do what we want - I'm not certain that that is guaranteed to work.

Another solution is to simply inline everything by using the --dereference argument. Since this file is generated, this seems like a better solution - more verbose for sure, but without the normal drift we might see from repeated code throughout the file.

PROPOSAL: Define Client Credentials for APIs

HTTP API integrations between trusted parties are a solved problem and do not require a new spec to provide support for the authorization we need.

These "Client Credentials" solutions are appropriate starting point for cross trust domain VC HTTP API operations.

This ticket seeks to gain consensus on their use with the vc http api.

For the sake of simplicity, lets assume 2 vendors wish to exchange presentations over https.

Vendor A -> Client Credentials App for Vendor B -> Vendor B uses app to access Vendor A's API.
Vendor B -> Client Credential App for Vendor A -> Vendor A uses app to access Vendor B's API.

OAuth client credentials setup is out of scope, but let us assume that each integration is identified with a CLIENT_ID and authenticated via a CLIENT_SECRET.

Before authenticated exchanges can be made, an application access_token's for each app must be obtained using the client credentials.

Vendor A's software integration uses the client credentials from Vendor B's client credentials app and vendor b's IDP to obtain an access token, see these docs for the standard way this is accomplished: auth0

curl --location --request POST 'https://vendor-b.auth0.com/oauth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "A's integration app for B's API",
"client_secret": "[You application client secret]",
"audience": "https://vendor-b.example.com",
"grant_type": "client_credentials"
}

once Vendor A' software has an access_token for Vendor B's API, the presentation exchange can begin, the flow is as follows:

Getting a Challenge for a flow

curl POST -H "Authorization: <ACCESS_TOKEN>" \
http://www.vendor-b.example.com/organizations/123/presentations/available  \
-d @./get-challengge-token-with-query-by-frame.json
{
  "query": [
    {
      "type": "RequestQueryByFrame",
      "credentialQuery": [
        {
          "type": [
            "VerifiableCredential",
            "CommercialInvoiceCertificate"
          ],
          "reason": "Wallet XYZ is ready to selectively disclose new credentials."
        }
      ]
    }
  ]
}

Response is expected to look like this:

{
  "query": [
    {
      "type": "QueryByFrame",
      "credentialQuery": {
        "frame": {
          "@context": [
            "https://www.w3.org/2018/credentials/v1",
            "https://w3id.org/traceability/v1",
            "https://w3id.org/bbs/v1"
          ],
          "type": [
            "VerifiableCredential",
            "CommercialInvoiceCertificate"
          ],
          "credentialSubject": {
            "@explicit": true,
            "type": [
              "CommercialInvoice"
            ],
            "purchaseDate": {},
            "destinationCountry": {}
          }
        }
      }
    }
  ],
  "domain": "vendor-b.example.com",
  "challenge": "3182bdea-63d9-11ea-b6de-3b7c1404d57f"
}

Submitting a Presentation

curl POST -H "Authorization: <ACCESS_TOKEN>" \
http://www.vendor-b.example.com/organizations/123/presentations/submissions  \
-d @./submit-presentation.json
{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1"
  ],
  "holder": "did:example:123",
  "type": "VerifiablePresentation",
  "verifiableCredential": [
    {
      "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://www.w3.org/2018/credentials/examples/v1"
      ]
    },
    {
      "id": "http://example.gov/credentials/3732"
    },
    {
      "type": [
        "VerifiableCredential",
        "UniversityDegreeCredential"
      ]
    },
    {
      "issuer": "did:example:123"
    },
    {
      "issuanceDate": "2020-03-16T22:37:26.544Z"
    },
    {
      "credentialSubject": {
        "id": "did:example:123",
        "degree": {
          "type": "BachelorDegree",
          "name": "Bachelor of Science and Arts"
        }
      }
    },
    {
      "proof": {
        "type": "Ed25519Signature2018",
        "created": "2020-04-02T18:28:08Z",
        "verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
        "proofPurpose": "assertionMethod",
        "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA"
      }
    }
  ],
  "proof": {
    "type": "Ed25519Signature2018",
    "created": "2020-04-02T18:28:08Z",
    "verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
    "proofPurpose": "assertionMethod",
    "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA"
  }
}

Visualizing Postman Reports

See https://learning.postman.com/docs/sending-requests/visualizer/

We need to setup SOME visualization of postman reports asap, and iterate on it later.

At a minimum there should be a way to see the results of a report by visiting a web page, and there should be an index of the reports that helps you get to the latest run.

I think its fine for us to drop older reports over time, since a report from 2 years ago, means nothing today.

Mutual certification of interoperability test conformance

I have been considering scenario where each vendor might certify other vendors that have demonstrated a capability to pass an interoperability test.

In an ideal world, this might even be wired to github actions so that certification was automatically revoked when the vendor stopped passing the tests.

I believe this can be accomplished via postman and github actions.

Postman interoperability tests and report automation

@mprorock Our team wants to add client credentials for a CCG test report application to this repo, and generate a conformance report using postman.

Can we set this up in CI with no authorization first, and then figure out how to pull client id and client secret from github secrets in CI second?

  • Wire CI tests for postman without authorization
  • Add CLIENT_ID and CLIENT_SECRET to GitHub Secrets
  • Update Postman tests to use authorization

Terminology defined incorrectly

IMO we should not be defining ANY terminology that is not relevant to the HTTP interop profile in this repo...

We should especially not be defining VP or VC data model items in this repo.

Also the current terminology is incorrectly defined.

Screen Shot 2022-02-08 at 10 43 18 AM

Move to redoc from swagger

I propose we consolidate the api definitions, follow the OAS 3.0 boilerplate guidelines (split parameters, schemas, responses, resources).

and have the respec just link to the OAS 3 Redoc like we do in trace-vocab.

Happy to do the work if folks are ready for it to be done... here is a preview of what it should look like (minus branding):

https://api.did.actor/docs

(happy to apply W3C CCG branding if we have an asset for that).

Running the new serviceProviders

@brownoxford, any chance I can ask you to kindly take a look at how the two serviceProviders we merged yesterday are running in the CI - I'm not sure where to see the result of it?

Locally running node . -n "Transmute DID Actor API" -d key works, but the report seems a bit off.

Running node . -n "Transmute" -d key I get the error below. Any thoughts on what might be causing it? Any pointers on how I can progress would be hugely appreciated!

Traceability Interop Testing
Liveness check starting...
Quick liveness tests on service providers...
Skipping mesur.io due to config
Checking Transmute
file:///Users/nis/git/traceability-interop/packages/tests-postman/node_modules/ky/distribution/utils/time.js:8
        reject(new TimeoutError(request));
               ^

TimeoutError: Request timed out
    at Timeout.<anonymous> (file:///Users/nis/git/traceability-interop/packages/tests-postman/node_modules/ky/distribution/utils/time.js:8:16)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7) {
  request: Request {
    size: 0,
    follow: 20,
    compress: true,
    counter: 0,
    agent: undefined,
    highWaterMark: 16384,
    insecureHTTPParser: false,
    [Symbol(Body internals)]: { body: null, boundary: null, disturbed: false, error: null },
    [Symbol(Request internals)]: {
      method: 'HEAD',
      redirect: 'follow',
      headers: Headers { [Symbol(query)]: [], [Symbol(context)]: null },
      parsedURL: <ref *1> URL {
        [Symbol(context)]: URLContext {
          flags: 400,
          scheme: 'https:',
          username: '',
          password: '',
          host: 'platform.transmute.industries',
          port: null,
          path: [ '.well-known', 'did-configuration.json' ],
          query: null,
          fragment: null
        },
        [Symbol(query)]: URLSearchParams {
          [Symbol(query)]: [],
          [Symbol(context)]: [Circular *1]
        }
      },
      signal: AbortSignal {
        [Symbol(kEvents)]: SafeMap(0) [Map] {},
        [Symbol(events.maxEventTargetListeners)]: 10,
        [Symbol(events.maxEventTargetListenersWarned)]: false,
        [Symbol(kAborted)]: true
      }
    }
  }
}

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.