diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6077bcd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,33 @@ +version: 2 + +# Keeps the kit's two moving parts current: the offline validator's npm tree and the GitHub Actions +# used by CI / drift-check / release. Dependabot *security* updates are enabled at the repo level; +# this adds proactive *version* updates so the SHACL/jsonld dependency tree and the SHA-pinned actions +# don't silently fall behind. + +updates: + # The offline conformance validator (validate/) — ajv, ajv-formats, jsonld, rdf-validate-shacl, … + - package-ecosystem: npm + directory: /validate + schedule: + interval: weekly + open-pull-requests-limit: 5 + commit-message: + prefix: deps + groups: + # Batch low-risk minor/patch bumps into one PR; majors still arrive individually for review. + validator-deps: + patterns: ["*"] + update-types: ["minor", "patch"] + + # CI / drift-check / release workflows — bumps the SHA pins (keeping the "# vX.Y.Z" comment in sync). + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 + commit-message: + prefix: ci + groups: + github-actions: + patterns: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 929807c..ceff79c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: name: Validate samples + schemas runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "20" - name: Install validator deps @@ -69,7 +69,7 @@ jobs: name: Secret scan (gitleaks) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 - name: Run gitleaks diff --git a/.github/workflows/drift-check.yml b/.github/workflows/drift-check.yml index d33a734..9450642 100644 --- a/.github/workflows/drift-check.yml +++ b/.github/workflows/drift-check.yml @@ -18,7 +18,7 @@ jobs: name: openapi.json vs live runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Fetch live spec + compare canonically id: cmp run: | @@ -41,7 +41,7 @@ jobs: ' - name: Open or update a drift issue if: steps.cmp.outputs.drift == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const title = "openapi.json has drifted from the live spec"; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 829d990..f9762fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out main (the tag is always anchored to main's tip) - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: ref: main fetch-depth: 0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..fd42196 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,84 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at support@opendpp-node.eu. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bbf9ab9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,75 @@ +# Contributing to the OpenDPP interop kit + +Thanks for helping improve OpenDPP's public interoperability boundary. Issues and PRs are welcome — +this short guide keeps them landing smoothly. + +## What this repository is (and isn't) + +This repo is the **public contract**: the official/vendored schemas, the offline conformance +validator, live-reproducible samples, the field mappings, and the public `openapi.json`. The OpenDPP +**product backend is a separate, private repository** — it is the source of truth for the API +behaviour, the emitters, and the spec. + +That split drives the one rule that matters most: + +> ### 🚫 `openapi.json` and `samples/` are **mirrored from the backend — do not hand-edit them.** +> +> They are generated/exported from the live OpenDPP service and committed verbatim. A PR that +> hand-edits the spec or a sample to "fix" or extend it will be redirected, because the change has to +> happen in the backend first or it will simply be overwritten on the next refresh (the weekly +> [drift check](./.github/workflows/drift-check.yml) compares `openapi.json` against the live spec). +> +> Found the live service emitting something non-conformant, or want a field the contract doesn't +> expose? That's a **product** change — open a +> [**Conformance gap** issue](./.github/ISSUE_TEMPLATE/conformance-gap.md), not a PR here. + +## What PRs *are* welcome + +- **Validator** improvements — bug fixes, clearer error output, a new validation "door" + (`validate/validate.mjs`), or tests. It must stay **offline** and dependency-light. +- **Docs** — fixes and clarifications to `README.md`, `CONFORMANCE.md`, `CHANGELOG.md`, or this file. +- **Vendored schema copies** (`schemas/`) — only to re-sync with the **upstream** canonical source. + Bump the pinned ref and update [`NOTICE`](./NOTICE) and [`schemas/README.md`](./schemas/README.md) + together; don't locally diverge from upstream. +- **Samples** — additional or refreshed artifacts, **only** when they are faithful, reproducible + outputs of the live service (each should be reproducible via the `curl` in its `*-VALIDATION.md`). + +## Keep non-normative claims honest + +Some content here is **NON-NORMATIVE** and must stay clearly labelled as such: OpenDPP's own SHACL +shapes (`shapes/`), the CIRPASS-2 EU-registry pointer interop, and the IDTA `semanticId` **identity** +check (identity ≠ structural conformance). Never describe any of it as "certified", "EU-official", or +a CIRPASS-2/EU conformance suite. See [`CONFORMANCE.md`](./CONFORMANCE.md) and [`NOTICE`](./NOTICE). + +## Before you open a PR + +```bash +cd validate +npm ci + +# the samples must still validate against the official schemas + the non-normative doors +node validate.mjs aas ../samples/battery-aas-environment.json +node validate.mjs untp ../samples/battery-vc-credential.json +node validate.mjs registry ../samples/battery-registry-pointer-model.json +node validate.mjs shacl ../samples/battery-passport.jsonld +node validate.mjs sdjwt ../samples/battery-vc.sdjwt +# (CI runs the full set, plus the forged-SD-JWT and tampered-SHACL negative controls) +``` + +- **CI must stay green** — sample validation, the negative controls, JSON sanity, and the gitleaks + secret scan all run on every PR. +- **No secrets / private keys** — the samples carry only public demo data and public verification + keys (see [`SECURITY.md`](./SECURITY.md)); push protection will also block key material. +- Fill in the [PR template](./.github/PULL_REQUEST_TEMPLATE.md) checklist and link any issue + (`Fixes #N`). + +## Reporting security issues + +Do **not** open a public issue for a vulnerability — follow [`SECURITY.md`](./SECURITY.md). + +## License of contributions + +This kit's own content is [Apache-2.0](./LICENSE); vendored third-party schemas keep their upstream +terms ([`NOTICE`](./NOTICE)). By submitting a contribution you agree it is licensed under the same +terms as the file(s) it touches (inbound = outbound). Please also follow our +[Code of Conduct](./CODE_OF_CONDUCT.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..a900aa1 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,40 @@ +# Security Policy + +This repository is the **public interop boundary** of OpenDPP — the official/vendored schemas, +live-reproducible samples, the offline conformance validator, and the public OpenAPI contract. The +running service and the product backend are **separate** (see [README](./README.md) → +"Relationship to the product"). + +## Reporting a vulnerability + +**Please do not open a public issue, pull request, or discussion for a security problem.** + +| Where the issue is | How to report | +| --- | --- | +| **This kit** — the validator (`validate/`), CI/release workflows, a vendored schema copy, or a sample | Use GitHub **private vulnerability reporting**: the repository **Security** tab → **Report a vulnerability**. | +| **The live OpenDPP service** (`https://opendpp-node.eu`) or the product backend | Disclose responsibly via . | + +If you're unsure which applies, use and we'll route it. + +Please include enough to reproduce: affected file/endpoint, version (`openapi.json` `info.version` +or the validator commit), and a minimal proof of concept. We aim to acknowledge within a few business +days. We'll keep you updated through remediation and credit you in the release notes unless you'd +prefer otherwise. + +## Supported versions + +The kit version tracks the OpenDPP API contract it carries (`openapi.json` `info.version`, git-tagged +`v`). Security fixes land on **`main`** and ship in the next tagged release; please verify +against the latest release or `main` before reporting. + +## Scope notes + +- **No secrets in this repo.** The `samples/` are synthetic demo data fetched from the public demo + service. The `did:web` document holds only the **public** verification key; the JWT / base58 proof + values are signatures over public demo data, not private keys (see [NOTICE](./NOTICE)). CI runs a + secret scan with push protection, but please still confirm no key material is added in a PR. +- **Vendored schemas keep their upstream terms.** A correctness problem in a vendored third-party + schema (`schemas/`) is best fixed upstream first — see [`schemas/README.md`](./schemas/README.md) + and [NOTICE](./NOTICE) for the canonical sources and pinned refs. +- The validator runs **offline** and pulls no network resources at validation time; report any + behaviour that contradicts that (e.g. an unexpected outbound request) as a security issue.