Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukasjhan/sd-jwt-tests
Test cases for SD-JWT
https://github.com/lukasjhan/sd-jwt-tests
Last synced: 21 days ago
JSON representation
Test cases for SD-JWT
- Host: GitHub
- URL: https://github.com/lukasjhan/sd-jwt-tests
- Owner: lukasjhan
- License: apache-2.0
- Created: 2023-12-14T14:00:00.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2023-12-14T15:28:17.000Z (11 months ago)
- Last Synced: 2024-04-12T05:09:13.641Z (7 months ago)
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SD JWT Test Cases
## Introduction
This repository contains the test cases for the [SD JWT](https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-06.html) project. Most of the test cases are based on the [sd-jwt-python](https://github.com/openwallet-foundation-labs/sd-jwt-python/tree/main/tests/testcases) framework.
The test cases are written in JSON to ease the integration with other programming languages.
## what is included in the test cases
```json
{
"claims": "...",
"disclosureFrame": "...",
"holder_disclosed_claims": "...",
"expect_verified_user_claims": "..."
}
```- `claims`: the claims to be signed by the issuer.
- `disclosureFrame`: which data can be selective disclosure.
- `holder_disclosed_claims`: the claims that selective disclosure by the holder.
- `expect_verified_user_claims`: the claims to be verified by the verifier.## How to use the test cases
### Claims
Claims are the data that the issuer wants to sign. It is a JSON object.
```json
{
"claims": {
"sub": "john_deo_42",
"given_name": "John",
"family_name": "Deo",
"email": "[email protected]",
"phone": "+1-202-555-0101",
"address": {
"street_address": "123 Main St",
"locality": "Anytown",
"region": "Anystate",
"country": "US"
},
"birthdate": "1940-01-01"
}
}
```### disclosureFrame
The disclosureFrame is an Array of strings that represents the claims that can be disclosed by the holder.
The data is the JSON path property of the claims.
For example,
```json
{
"a": {
"b": {
"c": "d"
}
}
}
```The JSON path of `d` is `a.b.c`.
And we use number string to represent the array index. like this:
```json
{
"a": {
"b": ["c", "d"]
}
}
```The JSON path of `d` is `a.b.1`.
So the disclosureFrame of the Claims can be:
```json
{
"disclosureFrame": [
"given_name",
"family_name",
"email",
"phone",
"address",
"birthdate"
]
}
```### holder_disclosed_claims
The holder_disclosed_claims is an Array of strings that represents the claims that the holder wants to disclose to the verifier.
It's subset of the disclosureFrame.
```json
{
"holder_disclosed_claims": ["given_name", "family_name"]
}
```### expect_verified_user_claims
The expected_verified_user_claims is an disclosd claims that the verifier wants to verify.
```json
{
"expect_verified_user_claims": {
"given_name": "John",
"family_name": "Deo"
}
}
```