Skip to content

Conversation

@coodos
Copy link
Contributor

@coodos coodos commented Jan 23, 2026

Description of change

add docs for key delegation and auth

Issue Number

Type of change

  • Docs (changes to the documentation)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides on eVault key delegation workflows and provisioning
    • Added detailed documentation on W3DS Protocol signatures with examples and verification flows
    • Enabled Mermaid diagram support for richer visuals and added illustrative diagrams
    • Removed an outdated W3DS getting-started tutorial
    • Reorganized documentation categories to improve navigation and ordering

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Warning

Rate limit exceeded

@coodos has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds new and updated documentation for Infrastructure and W3DS Protocol (including an eVault key delegation guide and a signatures spec), adjusts several docs category ordering files, and enables Mermaid diagram support in the Docusaurus config and docs package dependencies.

Changes

Cohort / File(s) Summary
Infrastructure Documentation
docs/docs/Infrastructure/_category_.json, docs/docs/Infrastructure/eVault-Key-Delegation.md
Adds an "Infrastructure" category and a detailed eVault key delegation doc describing key generation/backing, provisioning during onboarding (publicKey param), sync flows (on-creation and post-creation), actors (KeyService, Provisioner, EVault, Registry), endpoints (PATCH /public-key, GET /whois), key-binding certificate format (JWT, 1h validity), verification via Registry JWKS, examples, and sequence diagram in docs.
W3DS Protocol Documentation
docs/docs/W3DS Protocol/_category_.json, docs/docs/W3DS Protocol/Signatures.md, docs/docs/W3DS Protocol/getting-started.md
Adds comprehensive Signatures.md covering ECDSA P-256 signatures, format detection/normalization (DER/raw/multibase/base64), public key encodings, verification workflow (resolve eVault, retrieve certs, verify JWTs, import key, verify), multiple-certificate handling, examples and diagrams; deletes prior getting-started.md; updates category position.
Documentation Category Reordering
docs/docs/Post Platform Guide/_category_.json
Adjusts position from 4 → 5 to reflect new ordering.
Docusaurus Configuration & Dependencies
docs/docusaurus.config.ts, docs/package.json
Enables Mermaid in markdown (markdown.mermaid = true), adds @docusaurus/theme-mermaid to themes, and adds dependency @docusaurus/theme-mermaid in docs/package.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Docs/bootstrap docusaurus #688: Overlaps changes to Docusaurus configuration and docs package (mermaid/theme) affecting the same docs infrastructure files.

Suggested reviewers

  • sosweetham

Poem

🐰
I hopped through docs with bits of light,
Keys tucked safe, certificates bright,
Mermaid waves drew signature art,
eVault and W3DS play their part—
A tiny hop, a doc-made heart.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description follows the template structure but lacks substantive detail—it only states 'add docs for key delegation and auth' without explaining what aspects are documented or why. Expand the description with specific details about key delegation, authentication flows, or endpoints being documented to provide meaningful context.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: add docs for key delegation and auth' clearly summarizes the main change—adding documentation for key delegation and authentication workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@docs/docs/W3DS` Protocol/Signatures.md:
- Around line 24-26: Add a fenced-code language identifier (e.g., text or
plaintext) to the signature code blocks in Signatures.md so they satisfy
markdownlint MD040 and render correctly; locate the triple-backtick blocks
containing the signature lines like "Signature:
\"MEUCIQDxK3vJZQ2F3k5L8mN9pQrS7tUvW1xY3zA5bC7dE9fG1h==\"" and the other similar
blocks (around the other mentioned signature blocks) and change ``` to ```text
for each occurrence (including the blocks referenced at the other ranges).
- Around line 59-64: Update the multibase prefix usages so they match the actual
encodings: replace any occurrence that pairs the 'z' prefix with hex payloads to
use the 'f' prefix for base16/hex (lowercase), change examples that show
z{base64-encoded-SPKI} to use the 'm' prefix for base64 (no padding), and
correct any statements that say "base58btc, but using base64 here" to choose the
intended encoding and apply its correct prefix (use 'z' for base58btc, 'm' for
base64, 'f' for base16). Ensure all examples and descriptive lines consistently
use the correct prefix for their shown payloads (e.g., hex → 'f', base64 → 'm',
base58btc → 'z') so the Signatures.md multibase examples and descriptions are
accurate.
- Around line 17-32: Replace the DER-encoded example signature with a true P1363
raw signature example: update the "Example: Signature" value so it is a base64
encoding of a 64-byte raw ECDSA P-256 signature (32-byte r followed by 32-byte
s), and ensure the surrounding text refers to "P1363 (raw 64-byte r||s) base64"
and to the signing call crypto.subtle.sign() producing that raw format; locate
the current example string near the Example block and swap it for a base64
string that decodes to 64 bytes (r||s).

In `@docs/package.json`:
- Around line 18-21: The `@docusaurus/theme-mermaid` entry currently uses a caret
range ("@docusaurus/theme-mermaid": "^3.9.2") which allows minor-version drift;
change it to the exact version string matching the other Docusaurus packages
("@docusaurus/theme-mermaid": "3.9.2") so all `@docusaurus/`* packages are pinned
to the same version, then reinstall/update lockfile (npm/yarn/pnpm) to commit
the deterministic dependency change.
🧹 Nitpick comments (1)
docs/docs/Infrastructure/eVault-Key-Delegation.md (1)

109-121: Call out the publicKey encoding in the endpoint section.

Earlier you mention multibase encoding in the diagram, but the endpoint request doesn’t specify it. Consider adding a one‑liner (e.g., “publicKey is multibase‑encoded”) to avoid ambiguity.


When provisioning an eVault during onboarding, the eID wallet:
1. Generates or retrieves the public key using `getApplicationPublicKey()`
2. Includes the `publicKey` in the provision request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should cross reference docs explaining /provision endpoint


### Key Binding Certificates

Key binding certificates are JWTs that cryptographically bind a public key to an eName. They are generated by the Registry service and stored in eVault.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should mark that they are generated in the Registry only in the prototype and that it was mostly arbitrary decision

- **Payload**: `{ ename: "@user.w3id", publicKey: "z..." }`
- **Signature**: Signed by Registry's private key (ES256)

The certificate is valid for 1 hour and can be verified using the Registry's JWKS endpoint at `/.well-known/jwks.json`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should reference documentation about registry's endpoints. This one I particularly dislike btw.

- **Payload**: `{ ename: "@user.w3id", publicKey: "z..." }`
- **Signature**: Signed by Registry's private key (ES256)

The certificate is valid for 1 hour and can be verified using the Registry's JWKS endpoint at `/.well-known/jwks.json`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should explain the purpose of this JWT -- it is to allow anyone to validate signatures by the private key of the public key presented here. And one hour is quite arbitrary


#### PATCH /public-key

Stores a public key in eVault for a given eName.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who can run this? does this override the old public key? how does this work with the option for multiple keys described below?


1. **Key Storage**: Private keys are never transmitted or stored in eVault. Only public keys are synced.

2. **Certificate Validity**: Key binding certificates expire after 1 hour. eVault regenerates them on-demand when requested.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the attack vector or confusion we are trying to avoid here?

@coodos
Copy link
Contributor Author

coodos commented Jan 23, 2026

@nsergey82 I will address your comments later, for now we will just merge to unblock geosemantica


### Verification Steps

1. **Resolve eVault URL**: Query Registry with eName to get eVault URI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which endpoint? and how does one know the url of the registry?

### Verification Steps

1. **Resolve eVault URL**: Query Registry with eName to get eVault URI
2. **Get Key Binding Certificates**: Request `/whois` endpoint from eVault
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe using URI from [1] for clarity

3. **Verify JWT**: Verify each certificate's signature using Registry JWKS
4. **Extract Public Key**: Get public key from JWT payload
5. **Decode Public Key**: Convert multibase format to bytes
6. **Import Public Key**: Import into Web Crypto API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import for example into Web Crypto API


2. **Payload Validation**: Always verify that the signed payload matches the expected content before processing.

3. **Certificate Expiration**: Key binding certificates expire after 1 hour. Ensure your verification logic handles expired certificates gracefully.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by refreshing?

**Algorithm Steps:**

1. **Request Entropy**
- Send GET request to Registry `/entropy` endpoint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we could remove this feature

@coodos coodos merged commit 1aed2fc into main Jan 23, 2026
4 checks passed
@coodos coodos deleted the docs/auth branch January 23, 2026 18:23
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

Successfully merging this pull request may close these issues.

4 participants