DID Lint provides services to validate conformance of DID Documents to the W3C Decentralised Identifier Specification. It uses overlay information from the SOyA structure on DIDs to validate inputs and identify any violations to the standard.
Semantic Overlay Architecture (SOyA) is a data model authoring and publishing platform and also provides functionalities for validation and transformation. It builds on W3C Resource Description Framework (RDF) and related semantic web technologies to provide a lightweight approach for data integration and exchange.
At the core of SOyA is a YAML-based data model for describing data structures with bases and optional overlays, which provide additional information and context. The DID Lint service uses the following SOyA structure for validating DID Documents: click here.
To validate DID documents on the command line make sure to have the soya-cli installed: https://github.com/OwnYourData/soya
You can use a pre-built package from npmjs.com:
npm install -g soya-cli@latest
The validation includes a pre-processing step (to make the DID Document compliant with SOyA) and is available as a small script here
example:
cat did_document.json | ./script/prep.sh
The pre-preocessed JSON-LD document can then be validated with the soya validate
command,
complete example (including pre-processing) and using the SOyA structure defining Did
:
cat did_document.json | ./script/prep.sh | soya validate Did
The output describes the result of the validation process (using a SHACL) and lists any unmet constraints.
The above steps are bundled in an Docker image available here: https://hub.docker.com/r/oydeu/didlint
Start the image with the following command:
docker run --name didlint -d -p 3000:3000 oydeu/didlint
and access validation features through exposed APIs on http://localhost:3000
as described in the Swagger API documentation here: https://didlint.ownyourdata.eu/api-docs
examples:
curl http://localhost:3000/api/validate/did:oyd:zQmZZbVygmbsxWXhP2BH5nW2RMNXSQA3eRqnzfkFXzH3fg1
cat did_document.jsonld | curl -H 'Content-Type: application/json' -d @- -X POST http://localhost:3000/api/validate
To deploy oydeu/didlint
in a production setting use the following environment variables:
Recommended settings:
RAILS_ENV
:production
RAILS_LOG_TO_STDOUT
:TRUE
LANG
:C.UTF-8
Site-specific Configuration:
allowed_hosts
: hostname (example: didlint.onwyourdata.eu)SECRET_KEY_BASE
: randomized hexadecimal number (minimum 32 bytes)SOYA_DID_DRI
: specify the DID SOyA structure to be used for validation
External Services:
SOYA_REPO
: repository to resolveSOYA_DID_DRI
(default: https://soya.ownyourdata.eu)SOYA_WEB_CLI
: validation service for SOyA structures (default: https://soya-web-cli.ownyourdata.eu)UNIRESOLVER_URL
: Uniresolver instance for resolving DIDs (default: https://dev.uniresolver.io)
The Docker image includes a set of test cases to validate a deployed instance. Run the test cases with:
docker run -it --rm -w /usr/src/app/docker/pytest oydeu/didlint bash -c "export URL=https://your.deployment.com && pytest"
The DID Lint service is also available publicly here: https://didlint.ownyourdata.eu
Use either the web frontend or the provided REST API to resolve DIDs and validate DID Documents.
This service is a Proof-of-Concept to demonstrate the validation overlay capabilities of SOyA, i.e., show-case an easy to understand but still machine-readable format to describe DID Documents and use the built-in mechanisms of SOyA to either validate conformance or list identified violations.
The current DID Document SOyA structure is most certainly not a complete and correct representation of the DID Core Spec and we would like to encourage everyone to report issues using the GitHub Issue-Tracker .
If you want to contribute pull requests, please follow these steps:
- Fork it!
- Create a feature branch:
git checkout -b my-new-feature
- Commit changes:
git commit -am 'Add some feature'
- Push into branch:
git push origin my-new-feature
- Send a Pull Request
This project has received funding from the European Union’s Horizon 2020 research and innovation program through the NGI ONTOCHAIN program under cascade funding agreement No 957338 and the NGI TRUSTCHAIN program under cascade funding agreement No 101093274.