@pagopa/it-wallet-conformance-tool 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/README.md +520 -0
- package/bin/wct +3 -0
- package/config.example.ini +114 -0
- package/dumps/V1_0/issuer_metadata.json +249 -0
- package/dumps/V1_0/mDL.json +20 -0
- package/dumps/V1_0/pid.json +10 -0
- package/dumps/V1_0/trust_anchor_metadata.json +20 -0
- package/dumps/V1_0/wallet_provider_metadata.json +29 -0
- package/dumps/V1_3/issuer_metadata.json +270 -0
- package/dumps/V1_3/mDL.json +20 -0
- package/dumps/V1_3/pid.json +14 -0
- package/dumps/V1_3/trust_anchor_metadata.json +21 -0
- package/dumps/V1_3/wallet_provider_metadata.json +39 -0
- package/package.json +98 -0
- package/vitest.common.js +170 -0
- package/vitest.issuance.config.js +8 -0
- package/vitest.presentation.config.js +8 -0
package/README.md
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
# IT-Wallet Conformance Tool
|
|
2
|
+
|
|
3
|
+
Tool for the automated conformance testing of services integrating with the [Italian IT Wallet ecosystem](https://italia.github.io/eid-wallet-it-docs/versione-corrente/en). It helps all actors within the ecosystem—including Relying Parties (RPs), Credential Issuers, Authentic Sources, and Certification Bodies—to develop and validate their implementations.
|
|
4
|
+
|
|
5
|
+
The primary challenge is ensuring that all solutions are correct, up-to-date, and aligned with official Italian and European technical and regulatory standards. This tool automates a comprehensive suite of tests, providing detailed reports that highlight any errors or discrepancies from the technical specifications.
|
|
6
|
+
|
|
7
|
+
## Key Goals
|
|
8
|
+
|
|
9
|
+
- ✅ **Automate Conformance Testing**: Run tests defined by the official Italian technical rules to ensure compliance.
|
|
10
|
+
- ✅ **Improve Development Cycles**: Increase implementation quality and efficiency by catching errors early.
|
|
11
|
+
- ✅ **Support the Ecosystem**: Provide a reliable tool for both developers integrating with the IT Wallet and regulatory bodies certifying the solutions.
|
|
12
|
+
|
|
13
|
+
## Key Features
|
|
14
|
+
|
|
15
|
+
- 🤖 **CI/CD Integration**: Designed to be executed automatically in your CI/CD pipelines.
|
|
16
|
+
- 💻 **Headless CLI**: A powerful command-line interface perfect for server and development environments.
|
|
17
|
+
- 🌐 **Open Source**: Fully open-source and ready for community contributions.
|
|
18
|
+
- 📄 **Detailed Reports**: Generates clear reports on test outcomes (success, failure, not applicable) to quickly identify issues.
|
|
19
|
+
- 🐛 **Verbose Debugging**: Offers advanced technical output to simplify debugging and integration.
|
|
20
|
+
- 👥 **For Integrators & Certifiers**: Built to serve both entities building solutions and those who verify them.
|
|
21
|
+
|
|
22
|
+
## 🚀 Getting Started
|
|
23
|
+
|
|
24
|
+
Follow these steps to get the **IT-Wallet Conformance Tool** running on your local machine.
|
|
25
|
+
|
|
26
|
+
### Prerequisites
|
|
27
|
+
|
|
28
|
+
You must have [Node.js >= 22.19.0](https://nodejs.org/en/about/previous-releases) and pnpm installed on your system.
|
|
29
|
+
|
|
30
|
+
### Installation
|
|
31
|
+
|
|
32
|
+
1. Clone the repository to your local machine:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/pagopa/wallet-conformance-test
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Navigate into the project directory:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd wallet-conformance-test
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
3. Install dependencies using pnpm:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm install
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
4. Install the CLI globally using pnpm:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm install -g
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This will make the `wct` command available system-wide. You can use this command or `pnpm` to launch test as described below.
|
|
57
|
+
|
|
58
|
+
5. Verify the installation by checking the version:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
wct --version
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This should print the current version of the tool (e.g., `1.1.0`).
|
|
65
|
+
|
|
66
|
+
### Command not found? 🤔
|
|
67
|
+
|
|
68
|
+
If you encounter an issue where the `wct` command is not available system-wide after installation, you can manually link it. From the root of the wallet-conformance-test directory, run the following commands:
|
|
69
|
+
|
|
70
|
+
1. Make the script executable:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
chmod +x ./bin/wct
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Create a global symbolic link to the command:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pnpm link --global
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 🐳 Docker Usage
|
|
83
|
+
|
|
84
|
+
If you prefer using Docker, you can pull the official image from the GitHub Container Registry or build it locally.
|
|
85
|
+
|
|
86
|
+
### Build image
|
|
87
|
+
|
|
88
|
+
1. Pull the latest image with the following command:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
docker pull ghcr.io/pagopa/wallet-conformance-test:latest
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Alternatively, you can build the Docker image from the source code:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
docker build --tag pagopa/wallet-conformance-test:latest .
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
2. Run the CLI for example to start issuance test:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
docker run --rm wallet-conformance-test:latest test:issuance
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. If you want to mount a local folder for data or configuration (as suggested in the README):
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
docker run --rm -v "$(pwd)/data:/wallet-conformance-test/data" wallet-conformance-test:latest [COMMAND]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Run Container
|
|
113
|
+
|
|
114
|
+
To run the tests, create a local directory (e.g., data) to store configuration and reports. Then, launch the container, mounting your local directory as a volume:
|
|
115
|
+
|
|
116
|
+
1. Create a directory for your data
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
mkdir data
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
2. Run the container
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
docker run -v "$(pwd)/data:/wallet-conformance-test/data" pagopa/wallet-conformance-test:latest [COMMAND]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Replace [COMMAND] with the specific test command you want to run (e.g., test:issuance).
|
|
129
|
+
|
|
130
|
+
## ⚙️ Usage
|
|
131
|
+
|
|
132
|
+
The CLI tool is designed to test a running instance of your Credential Issuer or Relying Party solution. Ensure you have the metadata URL for your service available before you begin.
|
|
133
|
+
|
|
134
|
+
### Configuration
|
|
135
|
+
|
|
136
|
+
The tool can be configured using a `config.ini` file or via command-line options. An example `config.example.ini` file is provided with standard values for settings like the data storage directory or Trust Certification Authority references. You can create your own `config.ini` file and specify it using the `--file-ini` option. Command-line options always override settings from the `config.ini` file.
|
|
137
|
+
|
|
138
|
+
Configuration Hierarchy:
|
|
139
|
+
|
|
140
|
+
- Command-Line Options (Highest priority)
|
|
141
|
+
- Custom .ini File (--file-ini)
|
|
142
|
+
- Default .ini File (Lowest priority)
|
|
143
|
+
|
|
144
|
+
If a mandatory attribute is not defined in either the `.ini` file or as a command-line option, the tool will raise an error.
|
|
145
|
+
|
|
146
|
+
Examples:
|
|
147
|
+
|
|
148
|
+
Override a specific value from the command line:
|
|
149
|
+
|
|
150
|
+
wct test:issuance --credential-issuer-uri https://my-issuer.example.com
|
|
151
|
+
|
|
152
|
+
Use a custom configuration file:
|
|
153
|
+
|
|
154
|
+
wct test:issuance --file-ini /path/to/my-config.ini
|
|
155
|
+
|
|
156
|
+
### Wallet Version
|
|
157
|
+
|
|
158
|
+
The `wallet_version` setting (under the `[wallet]` section) controls which version of the Italian IT Wallet technical specification the tool targets. Different versions define different data models, credential formats, and protocol behaviours. Supported values:
|
|
159
|
+
|
|
160
|
+
| Value | Description |
|
|
161
|
+
|--------|-------------|
|
|
162
|
+
| `V1_0` | Targets the 1.0.x [specification](https://italia.github.io/eid-wallet-it-docs/releases/1.0.2/en/). |
|
|
163
|
+
| `V1_3` | Targets the 1.3.x [specification](https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/). |
|
|
164
|
+
|
|
165
|
+
Set it in your `config.ini`:
|
|
166
|
+
|
|
167
|
+
```ini
|
|
168
|
+
[wallet]
|
|
169
|
+
wallet_version = V1_3
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
> **Tip**: Use `V1_3` when testing against issuers or relying parties that implement the latest specification revision. Use `V1_0` for services that still target the first stable release.
|
|
173
|
+
|
|
174
|
+
### TLS Unsafe Mode
|
|
175
|
+
|
|
176
|
+
When testing against local services with self-signed certificates, you can disable TLS certificate verification. This is cross-platform (Windows, macOS, Linux) and disables TLS certificate verification for the entire Node.js process running this tool.
|
|
177
|
+
|
|
178
|
+
There are three equivalent ways to enable it, listed in priority order (highest first):
|
|
179
|
+
|
|
180
|
+
1. **CLI flag** (highest priority):
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
wct test:issuance --unsafe-tls
|
|
184
|
+
wct test:presentation --unsafe-tls
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
2. **Environment variable**:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
CONFIG_UNSAFE_TLS=true pnpm test:issuance
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
3. **`config.ini`** (lowest priority):
|
|
194
|
+
|
|
195
|
+
```ini
|
|
196
|
+
[network]
|
|
197
|
+
tls_reject_unauthorized = false
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Running Tests
|
|
201
|
+
|
|
202
|
+
The primary function of the tool is to run test suites for the main IT Wallet flows.
|
|
203
|
+
|
|
204
|
+
1. First rename `config.example.ini` to `config.ini`.
|
|
205
|
+
|
|
206
|
+
#### Testing the issuance Flow
|
|
207
|
+
|
|
208
|
+
To test the credential issuance flow, you will use the `test:issuance` command.
|
|
209
|
+
|
|
210
|
+
##### Using Configuration File
|
|
211
|
+
|
|
212
|
+
2. Configure your `config.ini` file with the credential issuer URL and credential types:
|
|
213
|
+
|
|
214
|
+
```ini
|
|
215
|
+
[issuance]
|
|
216
|
+
url = https://issuer.example.com
|
|
217
|
+
credential_types[] = dc_sd_jwt_EuropeanDisabilityCard
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
3. Run the test command:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
wct test:issuance
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
##### Using Command-Line Options
|
|
227
|
+
|
|
228
|
+
2. Alternatively, bypass the configuration file and specify parameters directly:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
wct test:issuance --credential-issuer-uri https://issuer.example.com --credential-types dc_sd_jwt_EuropeanDisabilityCard
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
During the test, verbose logs will be printed to the console, informing you of progress and any anomalies.
|
|
235
|
+
|
|
236
|
+
The pre-configured happy flow tests and security tests validate the issuance of the `--credential-types` credential. To modify this default setting, refer to the instructions below.
|
|
237
|
+
|
|
238
|
+
> **Note**: By default, credentials generated during testing are not saved to disk. However, you can configure the tool to save them locally for presentation phase. You can configure that using `config.ini` with `save_credential = true` or using cli option `--save-credential`
|
|
239
|
+
|
|
240
|
+
**📖 For detailed test configuration and customization**, see the comprehensive [Internal Test Configuration Guide](./tests/docs/TEST-CONFIGURATION-GUIDE.md). If you want to create external test specs see the comprehensive [External Test Configuration Guide](./tests/docs/ISSUANCE-TESTING-GUIDE.md).
|
|
241
|
+
|
|
242
|
+
These guides cover:
|
|
243
|
+
|
|
244
|
+
- Quick start with default configurations
|
|
245
|
+
- Custom credential types and multiple configurations
|
|
246
|
+
- Environment-based configuration
|
|
247
|
+
- Custom step classes and advanced options
|
|
248
|
+
|
|
249
|
+
#### Testing the Presentation Flow
|
|
250
|
+
|
|
251
|
+
##### Using Configuration File
|
|
252
|
+
|
|
253
|
+
2. Ensure your `.ini` file is configured with the correct URL for the credential identifier you wish to test, `config.ini`:
|
|
254
|
+
|
|
255
|
+
```ini
|
|
256
|
+
[presentation]
|
|
257
|
+
authorize_request_url = ...
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
3. Similarly, to test the presentation flow, you will use the `test:presentation` command:
|
|
261
|
+
```bash
|
|
262
|
+
wct test:presentation [OPTIONS]
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
##### Using Command-Line Options
|
|
266
|
+
|
|
267
|
+
2. Alternatively, bypass the configuration file and specify parameters directly:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
wct test:presentation --presentation-authorize-uri https://rp.example.com
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
> **Note**:
|
|
274
|
+
> The credentials used during the presentation tests will include both the credentials saved during the issuance tests and the auto-generated PID (dc_sd_jwt_PersonIdentificationData).
|
|
275
|
+
|
|
276
|
+
#### Test Reports
|
|
277
|
+
|
|
278
|
+
Upon completion of a test suite, the tool generates a comprehensive report (e.g., an HTML file) summarizing the results. The report will clearly detail:
|
|
279
|
+
|
|
280
|
+
- Success Cases: Tests that passed validation.
|
|
281
|
+
- Failure Cases: Tests that failed, with details to help identify the root cause.
|
|
282
|
+
- Non-Executable Cases: Tests that were skipped and why.
|
|
283
|
+
- Additional Data: Verbose logs and other debugging information.
|
|
284
|
+
|
|
285
|
+
## 📊 Reports
|
|
286
|
+
|
|
287
|
+
Every test run is automatically persisted to a local SQLite database (`data/wct.db`). After one or more runs you can inspect the history and generate a formatted report without re-running any tests.
|
|
288
|
+
|
|
289
|
+
### How It Works
|
|
290
|
+
|
|
291
|
+
The built-in `ConformanceReporter` (a Vitest reporter) hooks into each test run and writes every result to the database in real time. For each test case it stores:
|
|
292
|
+
|
|
293
|
+
- The **requirement ID** (`CI_001`, `RPR-001`, …) parsed from the test title
|
|
294
|
+
- The **result**: `PASS`, `FAIL`, or `NOT_REACHED` (test could not execute)
|
|
295
|
+
- A timestamp and, on failure, the error message
|
|
296
|
+
|
|
297
|
+
Each run is identified by a UUID and carries an overall status (`PASSED`, `FAILED`, or `INCOMPLETE`) derived from the aggregate results.
|
|
298
|
+
|
|
299
|
+
### Listing Runs
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
wct report list
|
|
303
|
+
# or the shorter alias
|
|
304
|
+
wct report ls
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Prints one row per recorded run:
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
RUN ID STARTED AT CLOSED AT STATUS CHECKS
|
|
311
|
+
b3f2a1c0-... 2026-06-17T10:00:00.000Z 2026-06-17T10:01:45.000Z PASSED 42
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Generating a Report
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
wct report create <run_id|latest> <format> [--view <view>]
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
| Argument / Option | Values | Description |
|
|
321
|
+
|---|---|---|
|
|
322
|
+
| `<run_id\|latest>` | UUID from `report list`, or `latest` | Which run to generate a report for |
|
|
323
|
+
| `<format>` | `html`, `pdf` | Output file format |
|
|
324
|
+
| `--view` | `both` (default), `executive`, `technical` | Which view(s) to include |
|
|
325
|
+
|
|
326
|
+
The report file is written to the **current working directory**:
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
conformance-report-<run_id>.<format>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### Examples
|
|
333
|
+
|
|
334
|
+
HTML report for the most recent run (both views, default):
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
wct report create latest html
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
PDF with only the executive summary:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
wct report create latest pdf --view executive
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Technical-only HTML for a specific run:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
wct report create b3f2a1c0-1234-... html --view technical
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Report Views
|
|
353
|
+
|
|
354
|
+
| View | Content | Audience |
|
|
355
|
+
|---|---|---|
|
|
356
|
+
| `executive` | High-level compliance narrative: overall score as a percentage, pass / fail / partial counts, and a highlighted box listing any critical failures. | Stakeholders, certification bodies |
|
|
357
|
+
| `technical` | Full check-by-check breakdown with requirement IDs, results, and failure messages for every test case. | Developers, integrators |
|
|
358
|
+
| `both` | Interactive HTML with a tab switcher between the two views above (default). | All audiences |
|
|
359
|
+
|
|
360
|
+
> **Note**: When generating a PDF with `--view both`, both sections are rendered sequentially in the document without the interactive switcher.
|
|
361
|
+
|
|
362
|
+
## 📋 Official Test Plans
|
|
363
|
+
|
|
364
|
+
The tests executed by this tool are a **subset of the official conformance tests** defined within the [IT Wallet Technical Specifications](https://italia.github.io/eid-wallet-it-docs/versione-corrente/en). Specifically, they implement part of the test plans documented in the [Test Plans section](https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/test-plans.html) of the official documentation. See [Test Execution Reference](./tests/docs/TEST-EXECUTION-REFERENCE.md) for more details.
|
|
365
|
+
|
|
366
|
+
This ensures that implementations validated by this tool are aligned with the requirements established by the Italian technical rules for the IT Wallet ecosystem.
|
|
367
|
+
|
|
368
|
+
## 🪪 Automatic Mock PID Generation
|
|
369
|
+
|
|
370
|
+
The tool **automatically generates a mock PID (Person Identification Data)** credential for testing purposes. This allows you to run conformance tests without needing a real credential from an official issuer.
|
|
371
|
+
|
|
372
|
+
> Currently, `dc_sd_jwt_PersonIdentificationData` (PID) is the only credential used for presentation in this project. Other credential types are not yet supported for presentation flows.
|
|
373
|
+
|
|
374
|
+
### How It Works
|
|
375
|
+
|
|
376
|
+
The mock PID is generated in the **SD-JWT VC** (Selective Disclosure JWT Verifiable Credential) format, which is the standard format used in the Italian IT Wallet ecosystem. All personal data fields are selectively disclosable, meaning they can be individually revealed during presentation flows.
|
|
377
|
+
|
|
378
|
+
The mock PID credential uses a **fictitious issuer** with the value `https://issuer.example.com`.
|
|
379
|
+
|
|
380
|
+
The credential is **signed with auto-generated mock keys** created locally by the tool. These keys are part of a **local Trust Anchor** federation setup, described in the section below.
|
|
381
|
+
|
|
382
|
+
> ⚠️ **Important**: The solution under test **must not** fetch issuer data from the `/.well-known/openid-federation` endpoint. Instead, it should perform verification using either:
|
|
383
|
+
>
|
|
384
|
+
> - The `trust_chain` claim in the credential header, or
|
|
385
|
+
> - The `x5c` (X.509 certificate chain) parameter
|
|
386
|
+
>
|
|
387
|
+
> Additionally, **Trust Anchor validity checks must be disabled** during testing, as the mock credentials use locally generated keys that are not part of a real trust infrastructure.
|
|
388
|
+
|
|
389
|
+
This ensures that your implementation correctly handles trust verification through the credential itself, rather than relying on external federation metadata lookups.
|
|
390
|
+
|
|
391
|
+
### What is Generated
|
|
392
|
+
|
|
393
|
+
When running tests, the tool creates a sample PID credential containing fictional Italian citizen data.
|
|
394
|
+
|
|
395
|
+
**Selectively disclosable claims** (included in the SD-JWT disclosure frame):
|
|
396
|
+
|
|
397
|
+
- **Personal Information**: Given name, family name, and birth date
|
|
398
|
+
- **Place of Birth**: Italian location
|
|
399
|
+
- **Nationality**: Italian (IT)
|
|
400
|
+
- **Administrative Number**: A sample personal administrative number
|
|
401
|
+
- **Validity**: The credential is set to expire one year from generation
|
|
402
|
+
|
|
403
|
+
**Non-selectively disclosable claims** (present in the JWT payload, not in disclosure frame):
|
|
404
|
+
|
|
405
|
+
- **`verification`**: An Italian domestic mandatory extension (per ARF HLR PID_06) asserting the identity verification method and assurance level:
|
|
406
|
+
```json
|
|
407
|
+
{
|
|
408
|
+
"trust_framework": "it_cie",
|
|
409
|
+
"assurance_level": "high"
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
`trust_framework: "it_cie"` reflects that PID issuance is gated on the CIE identity infrastructure. `assurance_level: "high"` corresponds to LoA High (eIDAS High), the level required for PID issuance. Look under /dumps folder for more detail.
|
|
413
|
+
|
|
414
|
+
> **Note (V1_3 only)**: The `verification` claim is specific to the V1.3 data model. V1_0 uses a different PID data model and does not include this claim.
|
|
415
|
+
|
|
416
|
+
## 🔐 Local Federation Servers
|
|
417
|
+
|
|
418
|
+
The tool spins up several **local HTTPS servers** that provide OpenID Federation metadata used during conformance testing. Together they simulate a complete federation hierarchy — Trust Anchor → Wallet Provider → Credential Issuer — so that issuers and relying parties under test can resolve and validate entity configurations without any external dependency.
|
|
419
|
+
|
|
420
|
+
| Server | Hostname | Default Port | Purpose |
|
|
421
|
+
|---|---|---|---|
|
|
422
|
+
| **Trust Anchor** | `trust-anchor.wct.example.org` | `3001` | Root of trust — serves `openid-federation` and `/fetch` endpoints |
|
|
423
|
+
| **Wallet Provider** | `wallet-provider.wct.example.org` | `3002` | Exposes the Wallet Provider entity configuration and JWKS |
|
|
424
|
+
| **Credential Issuer** | `credential-issuer.wct.example.org` | `3003` | Exposes the mock PID issuer entity configuration |
|
|
425
|
+
|
|
426
|
+
### DNS Resolution Requirement
|
|
427
|
+
|
|
428
|
+
Because these servers listen on HTTPS (port 443 implied by the canonical URLs), the three hostnames **must resolve to `127.0.0.1`** on the machine where the tests run. This is required so that services under test can reach the federation endpoints advertised in credentials and entity configurations.
|
|
429
|
+
|
|
430
|
+
#### macOS / Linux
|
|
431
|
+
|
|
432
|
+
Add the following line to `/etc/hosts` (requires `sudo`):
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
sudo sh -c 'echo "127.0.0.1 trust-anchor.wct.example.org wallet-provider.wct.example.org credential-issuer.wct.example.org" >> /etc/hosts'
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
Or open the file manually:
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
sudo nano /etc/hosts
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
And append:
|
|
445
|
+
|
|
446
|
+
```
|
|
447
|
+
127.0.0.1 trust-anchor.wct.example.org wallet-provider.wct.example.org credential-issuer.wct.example.org
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
#### Windows
|
|
451
|
+
|
|
452
|
+
Open **Notepad** (or any text editor) **as Administrator**, then open the file:
|
|
453
|
+
|
|
454
|
+
```
|
|
455
|
+
C:\Windows\System32\drivers\etc\hosts
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Append the following line and save:
|
|
459
|
+
|
|
460
|
+
```
|
|
461
|
+
127.0.0.1 trust-anchor.wct.example.org wallet-provider.wct.example.org credential-issuer.wct.example.org
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
> **Tip:** You can also run the following command in an **Administrator PowerShell** prompt:
|
|
465
|
+
>
|
|
466
|
+
> ```powershell
|
|
467
|
+
> Add-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Value "127.0.0.1 trust-anchor.wct.example.org wallet-provider.wct.example.org credential-issuer.wct.example.org"
|
|
468
|
+
> ```
|
|
469
|
+
|
|
470
|
+
### Automatic Startup
|
|
471
|
+
|
|
472
|
+
All three servers **automatically start when you run tests**. The global test setup handles the server lifecycle:
|
|
473
|
+
|
|
474
|
+
- Starts all servers before tests begin
|
|
475
|
+
- Stops all servers after all tests complete
|
|
476
|
+
|
|
477
|
+
No manual intervention is required when running test suites.
|
|
478
|
+
|
|
479
|
+
### Manual Startup
|
|
480
|
+
|
|
481
|
+
If you need to run the Trust Anchor server independently (e.g., for development or debugging), you can start it manually:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
pnpm ta:server
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
The server will start on port `3001` by default.
|
|
488
|
+
|
|
489
|
+
### Bind Address
|
|
490
|
+
|
|
491
|
+
By default, all three servers bind to `127.0.0.1`, making them reachable only from the local machine. When running inside a container or on a remote host where the service under test needs to reach back to these servers, bind them to all interfaces instead.
|
|
492
|
+
|
|
493
|
+
There are two ways to configure it, listed in priority order (highest first):
|
|
494
|
+
|
|
495
|
+
1. **Environment variable** (highest priority):
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
OIDF_SERVERS_BIND_ADDRESS=0.0.0.0 pnpm test:issuance
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
2. **`config.ini`** (lowest priority):
|
|
502
|
+
|
|
503
|
+
```ini
|
|
504
|
+
[network]
|
|
505
|
+
bind_address = 0.0.0.0
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
> **Note**: Binding to `0.0.0.0` exposes the servers on all network interfaces. Use this only in controlled environments (CI, Docker networks, private LANs) — never on a public-facing host.
|
|
509
|
+
|
|
510
|
+
## 🤝 Contributing
|
|
511
|
+
|
|
512
|
+
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
|
|
513
|
+
|
|
514
|
+
1. Fork the Project
|
|
515
|
+
2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
|
|
516
|
+
3. Commit your Changes (git commit -m 'Add some AmazingFeature')
|
|
517
|
+
4. Push to the Branch (git push origin feature/AmazingFeature)
|
|
518
|
+
5. Open a Pull Request
|
|
519
|
+
|
|
520
|
+
Please see the CONTRIBUTING.md file for more details on our code of conduct and the process for submitting pull requests.
|
package/bin/wct
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
[wallet]
|
|
2
|
+
# Wallet Instance Configuration
|
|
3
|
+
wallet_id = wallet_cli_instance
|
|
4
|
+
wallet_name = CEN TC Wallet CLI
|
|
5
|
+
# Admissible values for wallet_version are : V1_0, V1_3
|
|
6
|
+
wallet_version = V1_0
|
|
7
|
+
|
|
8
|
+
# Port for the local Wallet Provider federation metadata server.
|
|
9
|
+
port = 3002
|
|
10
|
+
|
|
11
|
+
# Storage Configuration
|
|
12
|
+
wallet_attestations_storage_path = ./data/attestation
|
|
13
|
+
credentials_storage_path = ./data/credentials # each credential within a file named using its credential type
|
|
14
|
+
backup_storage_path = ./data/backup
|
|
15
|
+
|
|
16
|
+
[issuer]
|
|
17
|
+
# Port for the local Mocked Credential Issuer federation metadata server.
|
|
18
|
+
port = 3003
|
|
19
|
+
|
|
20
|
+
[trust]
|
|
21
|
+
# eIDAS Trusted Lists
|
|
22
|
+
eidas_trusted_lists[] = [array of urls] # Optional
|
|
23
|
+
|
|
24
|
+
# X.509 CA Configuration
|
|
25
|
+
ca_cert_path = ./data/trust_anchor/localhost # single cert or chain per each pem file
|
|
26
|
+
certificate_subject="CN=localhost, O=myOrg, OU=myUnit, C=IT, ST=Roma, L=Roma, E=example@email.it"
|
|
27
|
+
|
|
28
|
+
# OpenID Federation Configuration
|
|
29
|
+
# Optional. List of URLs of Federation Trust Anchors to trust. If not set, no Federation TA will be trusted and federation-based tests will be skipped.
|
|
30
|
+
federation_trust_anchors[] = [array of urls]
|
|
31
|
+
federation_trust_anchors_jwks_path = ./data/trust_anchor/localhost # each named with the related TA name
|
|
32
|
+
|
|
33
|
+
[issuance]
|
|
34
|
+
url = https://issuer.example
|
|
35
|
+
|
|
36
|
+
# Optional: override the directory where issuance test specs are discovered
|
|
37
|
+
# tests_dir = ./tests/conformance/issuance
|
|
38
|
+
|
|
39
|
+
# Save the received credential to disk after test issuance (if supported by the flow)
|
|
40
|
+
# The credential will be saved in the path specified in wallet->credentials_storage_path
|
|
41
|
+
save_credential = false
|
|
42
|
+
|
|
43
|
+
# List of credentialConfigurationIds to test (used by test suite)
|
|
44
|
+
# Example:
|
|
45
|
+
credential_types[] = dc_sd_jwt_EuropeanDisabilityCard
|
|
46
|
+
|
|
47
|
+
# Optional: enable credential offer resolution if present
|
|
48
|
+
# The credential_issuer field in the response will override the issuance url.
|
|
49
|
+
# credential_offer_uri=https://offer.example
|
|
50
|
+
|
|
51
|
+
[presentation]
|
|
52
|
+
# Optional: override the directory where presentation test specs are discovered
|
|
53
|
+
# tests_dir = ./tests/conformance/presentation
|
|
54
|
+
|
|
55
|
+
# Optional: RP Verifier URL in case endpoint metadata is different from the authorize_request_url domain
|
|
56
|
+
# verifier = https://rp-example.example
|
|
57
|
+
|
|
58
|
+
# URL to initiate the presentation request, metadata will be fetched from client_id domain if [verifier] is not set
|
|
59
|
+
authorize_request_url = https://rp-example.example/auth?client_id=https://rp-example.example&request_uri=https://rp-example.example/auth/request/2f4c8d91-7b35-4e2a-9c1d-5a6f8b3e2d10&state=2f4c8d91-7b35-4e2a-9c1d-5a6f8b3e2d10
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
[network]
|
|
63
|
+
# Network Configuration
|
|
64
|
+
# Optional. Default value: 10
|
|
65
|
+
timeout = 10
|
|
66
|
+
# Optional. Default value: 10
|
|
67
|
+
max_retries = 2
|
|
68
|
+
# Optional. Default value: CEN-TC-Wallet-CLI/<wct_version>
|
|
69
|
+
user_agent = CEN-TC-Wallet-CLI/1.0.0
|
|
70
|
+
# Optional. Set to false to disable TLS certificate verification (e.g. self-signed certs on local services).
|
|
71
|
+
# WARNING: Never use false in production — it disables all TLS trust checks for HTTP calls.
|
|
72
|
+
# tls_reject_unauthorized = false
|
|
73
|
+
|
|
74
|
+
[trust_anchor]
|
|
75
|
+
# Trust Anchor Server Configuration
|
|
76
|
+
port = 3001
|
|
77
|
+
|
|
78
|
+
# Trust Anchor Server Certificates dir
|
|
79
|
+
# Directory that contains the certificates for the trust anchor's HTTPS server.
|
|
80
|
+
# Expected filenames: server.cert.pem and server.key.pem (auto-generated if absent).
|
|
81
|
+
tls_cert_dir = ./data/backup
|
|
82
|
+
|
|
83
|
+
[logging]
|
|
84
|
+
# Logging Configuration
|
|
85
|
+
log_level = INFO
|
|
86
|
+
log_file = ./data/logs/test_run.log
|
|
87
|
+
log_format = [%(tag)]: %(message)
|
|
88
|
+
# Optional: override the format used when writing to log_file (defaults to log_format)
|
|
89
|
+
# Available placeholders: %(date) %(utc) %(tag) %(levelname) %(message)
|
|
90
|
+
# log_file_format = %(date) - [%(tag)]: %(message)
|
|
91
|
+
|
|
92
|
+
[testing]
|
|
93
|
+
# Test Configuration
|
|
94
|
+
# Pattern for test spec files (glob pattern)
|
|
95
|
+
spec_pattern = **/*.spec.ts
|
|
96
|
+
|
|
97
|
+
# Pattern for custom step files (glob pattern, excludes *.spec.ts)
|
|
98
|
+
custom_step_pattern = **/*.ts
|
|
99
|
+
|
|
100
|
+
[steps_mapping]
|
|
101
|
+
# Step Mapping Configuration
|
|
102
|
+
# Maps test names to their custom step implementation directories.
|
|
103
|
+
#
|
|
104
|
+
# Specific mappings:
|
|
105
|
+
# Key = Test flow name passed to defineIssuanceTest() / definePresentationTest()
|
|
106
|
+
# Value = Relative path to directory containing custom step implementations
|
|
107
|
+
#
|
|
108
|
+
# How it works:
|
|
109
|
+
# - Steps are first searched in the specific mapped directory
|
|
110
|
+
# - Missing steps are automatically searched in default src/step and that implementations are used
|
|
111
|
+
#
|
|
112
|
+
# Example: Map specific tests to their custom step directories
|
|
113
|
+
# HappyFlowIssuance = tests/steps/wrong_authorize/issuance
|
|
114
|
+
# HappyFlowPresentation = tests/steps/fail_redirect/presentation
|