Skip to content

Commit 3af552c

Browse files
authored
Merge pull request #127 from OpSecId/witness-service-endpoint
Add Witness service endpoint
2 parents e8a30fa + 3158101 commit 3af552c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3035
-1520
lines changed

README.md

Lines changed: 26 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,49 @@
11
# DID Web with Verifiable History Server Python
2-
## A Web Server component for a DID WebVH implementation
32

4-
This server is built with the FastAPI framework.
3+
A Web Server component for a DID WebVH implementation built with FastAPI.
54

6-
The DID WebVH spec: [https://identity.foundation/didwebvh](https://identity.foundation/didwebvh)
5+
**DID WebVH Specification**: [https://identity.foundation/didwebvh](https://identity.foundation/didwebvh)
76

8-
## Abstract
7+
## Quick Start
98

10-
This server is for issuing clients to deposit their did documents, did logs and other objects.
11-
12-
Having a seperate server to deposit verification material will ensure that signing material is isolated and provide a more secured architecture.
13-
14-
This also enables system architects to create rigid governance rules around publishing DID documents and related ressources through endorsment.
15-
16-
## How it works
17-
*For a demonstration, please see the demo directory*
9+
```bash
10+
# Install dependencies
11+
cd server
12+
uv sync
1813

19-
- A controller requests an identifier from the server.
20-
- The server returns a configuration if the requested identifier is available.
21-
- The controller generates a first log entry matching the server policies.
22-
- The controller sends the initial log entry to the server, along with the did witness file if required
14+
# Copy and configure environment
15+
cp env.example .env
16+
# Edit .env with your settings
2317

24-
### Registering a new DID
25-
```mermaid
26-
sequenceDiagram
27-
participant WebVH Server
28-
participant Controller
29-
participant Witness
30-
Controller->>WebVH Server: Request an identifier namespace.
31-
WebVH Server->>Controller: Provide log input document.
32-
Controller->>Controller: Create and sign initial log entry.
33-
Controller->>Witness: Request witness signature if enabled.
34-
Controller->>WebVH Server: Send initial log entry and did witness file if required.
35-
WebVH Server->>WebVH Server: Verify and publish DID.
18+
# Run server
19+
uv run python main.py
3620
```
3721

38-
### AnonCreds Objects (AttestedResources)
39-
40-
An attested resource is a stored resource cryptographically bound to it's location on the web. See the anoncreds document for more information.
41-
42-
### Setting up policies
43-
44-
The server is equiped with a configurable policy module. Rule sets can be established to change the server behavior when validating some requests.
45-
46-
When a rule is enforced, the server will reject any request that doesn't match said policy. Here are the configurable policies:
47-
48-
#### Known Witnesses Registry
49-
50-
- WEBVH_KNOWN_WITNESS_KEY: A default known witness key to provision the server.
51-
- ex: `WEBVH_KNOWN_WITNESS_KEY="z6Mkf5rGMoatrSj1f4CyvuHBeXJELe9RPdzo2PKGNCKVtZxP"`
52-
53-
- WEBVH_KNOWN_WITNESS_REGISTRY: A list of known witnesses is used for validating witness policies. This will be cached every time a witness can't be found.
54-
- ex: `WEBVH_KNOWN_WITNESS_REGISTRY="https://known-witnesses.example.com"`
55-
56-
#### Attested Resource Endorsement
57-
58-
- WEBVH_ENDORSEMENT: This will require a known witness proof on any attested resource uploaded or updated. It's up to the witness service to determine which resources to endorse from the controller.
59-
- ex: `WEBVH_ENDORSEMENT="true"`
60-
61-
#### WebVH Parameters
62-
63-
The following policy variables can be used to enforce parameters from the did:webvh specification:
64-
- WEBVH_VERSION: Specify a webvh method version to enforce
65-
- ex: `WEBVH_VERSION="1.0"`
66-
- WEBVH_WITNESS: Enforce the use of witness with a minimum threshold of 1. At least 1 witness from the known witness registry will need to be used.
67-
- ex: `WEBVH_WITNESS="true"`
68-
- WEBVH_PORTABILITY: Ensure that portability is enabled.
69-
- ex: `WEBVH_PORTABILITY="true"`
70-
- WEBVH_WATCHER: Request a specific watcher to be included in the watchers array
71-
- ex: `WEBVH_WATCHER=https://watcher.example.com`
72-
- WEBVH_PREROTATION: Enforce the use of prerotation
73-
- ex: `WEBVH_PREROTATION="true"`
74-
75-
### Exploring the resources
76-
77-
Have a look at the demo directory for instructions on how to browse the explorer.
22+
The server will be available at `http://localhost:8000` with:
23+
- **API Documentation**: `http://localhost:8000/docs` (Swagger UI)
24+
- **Web Explorer**: `http://localhost:8000/api/explorer`
7825

7926
## Documentation
8027

81-
The documentation is built with [Zensical](https://zensical.org/). To view the documentation locally:
28+
📚 **Complete documentation is available in the [User Manual](docs/index.md)**
29+
30+
To view the documentation locally:
8231

8332
```bash
8433
# Install Zensical
8534
pip install zensical
8635

87-
# Navigate to the project root (where zensical.toml is located)
88-
cd /path/to/didwebvh-server-py
89-
9036
# Start the documentation server
9137
zensical serve
9238
```
9339

9440
The documentation will be available at `http://localhost:8000` (or the port specified in `zensical.toml`).
9541

96-
For comprehensive documentation, see the [User Manual](docs/user-manual.md) in the `docs/` directory.
42+
## Additional Resources
43+
44+
- **[Server README](server/README.md)**: Quick setup guide
45+
- **Demo**: See the `demo/` directory for load testing and examples
46+
47+
## License
48+
49+
Apache License 2.0

charts/didwebvh-server/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: didwebvh-server-py
33
icon: https://identity.foundation/didwebvh/didwebvh.jpg
44
description: An api server to register and serve web dids with verifiable history.
55
type: application
6-
version: 0.4.5
7-
appVersion: 0.4.5
6+
version: 0.5.0
7+
appVersion: 0.5.0
88

99
maintainers:
1010
- name: PatStLouis

charts/didwebvh-server/templates/server/configmap.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ data:
3131
{{- if .Values.server.branding }}
3232
APP_NAME: {{ .Values.server.branding.app_name | default "DID WebVH Server" | quote }}
3333
APP_DESCRIPTION: {{ .Values.server.branding.app_description | default "An api server to register and serve web dids with verifiable history." | quote }}
34-
APP_ICON: {{ .Values.server.branding.app_icon | default "https://didwebvh.info/latest/assets/favicon.ico" | quote }}
35-
APP_LOGO: {{ .Values.server.branding.app_logo | default "https://raw.githubusercontent.com/decentralized-identity/didwebvh-info/main/docs/assets/didwebvh.jpg" | quote }}
34+
APP_ICON: {{ .Values.server.branding.icon | default "https://didwebvh.info/latest/assets/favicon.ico" | quote }}
35+
APP_LOGO_VERTICAL: {{ .Values.server.branding.logo_vertical | default "https://raw.githubusercontent.com/decentralized-identity/didwebvh-info/main/docs/assets/didwebvh.jpg" | quote }}
36+
APP_LOGO_HORIZONTAL: {{ .Values.server.branding.logo_horizontal | default "https://raw.githubusercontent.com/decentralized-identity/didwebvh-info/main/docs/assets/didwebvh.jpg" | quote }}
3637
APP_PRIMARY_COLOR: {{ .Values.server.branding.app_primary_color | default "#1a365d" | quote }}
3738
APP_SECONDARY_COLOR: {{ .Values.server.branding.app_secondary_color | default "#38a169" | quote }}
3839
APP_ACCENT_COLOR: {{ .Values.server.branding.app_accent_color | default "#3182ce" | quote }}

charts/didwebvh-server/templates/server/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ spec:
5353
protocol: TCP
5454
livenessProbe:
5555
httpGet:
56-
path: /server/status
56+
path: /api/server/status
5757
port: {{ .Values.server.service.apiPort }}
5858
failureThreshold: 2
5959
initialDelaySeconds: 60
6060
periodSeconds: 5
6161
readinessProbe:
6262
httpGet:
63-
path: /server/status
63+
path: /api/server/status
6464
port: {{ .Values.server.service.apiPort }}
6565
initialDelaySeconds: 60
6666
resources:

charts/didwebvh-server/values.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ networkPolicy:
1616
server:
1717
image:
1818
repository: ghcr.io/decentralized-identity/didwebvh-server-py
19-
tag: 0.4.5
19+
tag: 0.5.0
2020
pullPolicy: IfNotPresent
2121
pullSecrets: []
2222

@@ -38,8 +38,9 @@ server:
3838
branding:
3939
app_name: "DID WebVH Server"
4040
app_description: "An api server to register and serve web dids with verifiable history."
41-
app_icon: "https://didwebvh.info/latest/assets/favicon.ico"
42-
app_logo: "https://raw.githubusercontent.com/decentralized-identity/didwebvh-info/main/docs/assets/didwebvh.jpg"
41+
icon: "https://didwebvh.info/latest/assets/favicon.ico"
42+
logo_vertical: "https://raw.githubusercontent.com/decentralized-identity/didwebvh-info/main/docs/assets/didwebvh.jpg"
43+
logo_horizontal: "https://raw.githubusercontent.com/decentralized-identity/didwebvh-info/main/docs/assets/didwebvh.jpg"
4344
app_primary_color: "#1a365d"
4445
app_secondary_color: "#38a169"
4546
app_accent_color: "#3182ce"

demo/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Build Options:
113113
Load Test Options:
114114
-c, --count N Number of DIDs to create (default: 10)
115115
-u, --updates N Updates per DID (default: 2)
116+
-s, --server URL Server URL for load test (default: http://localhost:8000)
117+
Use this to test against an existing server instead of starting one
116118
--concurrent Run tests concurrently (faster)
117119
--agent Use agent provisioning instead of load test
118120
@@ -126,6 +128,8 @@ Server Options:
126128
Examples:
127129
./magic.sh # Quick start with defaults
128130
./magic.sh -c 50 --concurrent # 50 DIDs concurrently
131+
./magic.sh -s http://localhost:8000 # Test existing server (skip startup)
132+
./magic.sh -s https://did.example.com -c 20 # Test remote server
129133
./magic.sh --ngrok # Start with ngrok
130134
./magic.sh --agent --ngrok # Agent provisioning with ngrok
131135
./magic.sh --no-rebuild -c 20 # Skip rebuild, 20 DIDs

demo/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
WEBVH_ENDORSEMENT: ${WEBVH_ENDORSEMENT:-false}
1616
APP_PORT: 8000
1717
healthcheck:
18-
test: ["CMD-SHELL", "python3 -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/server/status\")' || exit 1"]
18+
test: ["CMD-SHELL", "python3 -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/api/server/status\")' || exit 1"]
1919
interval: 5s
2020
timeout: 3s
2121
retries: 10

0 commit comments

Comments
 (0)