Skip to content

Add demo app event certificate manager #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ dist
cli/bin
cli/out

employee-vci/.env
employee-vci/TEST_DB
employee-vci/database.sqlite
employee-vci/dist
demos/employee-vci/.env
demos/employee-vci/TEST_DB
demos/employee-vci/database.sqlite
demos/employee-vci/dist

proxy-vci/.env
proxy-vci/TEST_DB
proxy-vci/database.sqlite
proxy-vci/dist
demos/proxy-vci/.env
demos/proxy-vci/TEST_DB
demos/proxy-vci/database.sqlite
demos/proxy-vci/dist

participation-cert-vci/.env
participation-cert-vci/TEST_DB
participation-cert-vci/database.sqlite
participation-cert-vci/dist
demos/participation-cert-vci/.env
demos/participation-cert-vci/TEST_DB
demos/participation-cert-vci/database.sqlite
demos/participation-cert-vci/dist

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 OWNED Project
Copyright (c) 2024 OWND Project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion demos/employee-vci/.mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process.env.DATABASE_FILEPATH = "./TEST_DB";
process.env.BASIC_AUTH_USERNAME="username"
process.env.BASIC_AUTH_PASSWORD="password"
process.env.OAUTH2_TOKEN_ENDPOINT="https://example.com/oauth2/token"
process.env.CREDENTIAL_ISSUER="https://datasign-vci.tunnelto.dev"
process.env.CREDENTIAL_ISSUER="https://example.com"
process.env.CREDENTIAL_OFFER_ENDPOINT="openid-credential-offer://"
process.env.VCI_ACCESS_TOKEN_EXPIRES_IN="86400"
process.env.VCI_ACCESS_TOKEN_C_NONCE_EXPIRES_IN="30"
Expand Down
9 changes: 7 additions & 2 deletions demos/employee-vci/READM.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Employee VCI API Summary

### Common API
For details on the common API, please see [README.md](../common/README.md).
For details on the common API, please see [README.md](../../src/README.md).

- POST `/admin/keys/new`
- POST `/admin/keys/:kid/revoke`
Expand Down Expand Up @@ -38,6 +38,11 @@ Create the `.env` file based on the `.env.template`. Please adjust the content a
| VCI_ACCESS_TOKEN_EXPIRES_IN | 86400 |
| VCI_ACCESS_TOKEN_C_NONCE_EXPIRES_IN | 86400 |

## Configuring Credential Issuer Metadata

Please modify the JSON file that exists under the `metadata` directory to match your operating environment.
In particular, the `REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM` in the JSON file should be the actual domain that can communicate with the wallet.

## Specific API

### POST `/admin/employees/new`
Expand Down Expand Up @@ -127,7 +132,7 @@ Example Response
"subject": {
"employeeNo": "1"
},
"credentialOffer": "openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A%22https%3A%2F%2Fdatasign-vci.tunnelto.dev%22%2C%22credentials%22%3A%5B%22EmployeeCredential%22%5D%2C%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22tH5yamPFHZ8pVr95Fhp26GCnzwAvgCfQ%22%2C%22user_pin_required%22%3Atrue%7D%7D%7D",
"credentialOffer": "openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A%22https%3A%2F%2Fissuer.example.com%22%2C%22credentials%22%3A%5B%22EmployeeCredential%22%5D%2C%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22tH5yamPFHZ8pVr95Fhp26GCnzwAvgCfQ%22%2C%22user_pin_required%22%3Atrue%7D%7D%7D",
"userPin": "28092571"
}
```
2 changes: 1 addition & 1 deletion demos/employee-vci/READM_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ http://localhost:3003/admin/employees/1/credential-offer \
"subject": {
"employeeNo": "1"
},
"credentialOffer": "openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A%22https%3A%2F%2Fdatasign-vci.tunnelto.dev%22%2C%22credentials%22%3A%5B%22EmployeeCredential%22%5D%2C%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22tH5yamPFHZ8pVr95Fhp26GCnzwAvgCfQ%22%2C%22user_pin_required%22%3Atrue%7D%7D%7D",
"credentialOffer": "openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A%22https%3A%2F%2Fissuer.example.com%22%2C%22credentials%22%3A%5B%22EmployeeCredential%22%5D%2C%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22tH5yamPFHZ8pVr95Fhp26GCnzwAvgCfQ%22%2C%22user_pin_required%22%3Atrue%7D%7D%7D",
"userPin": "28092571"
}
```
6 changes: 3 additions & 3 deletions demos/employee-vci/metadata/dev/authorization_server.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"issuer": "https://datasign-demo-vci.tunnelto.dev",
"authorization_endpoint": "https://datasign-demo-vci.tunnelto.dev/authorize",
"token_endpoint": "https://datasign-demo-vci.tunnelto.dev/token",
"issuer": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM",
"authorization_endpoint": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/authorize",
"token_endpoint": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/token",
"token_endpoint_auth_methods_supported": ["client_secret_basic", "private_key_jwt"],
"token_endpoint_auth_signing_alg_values_supported": ["RS256", "ES256"],
"jwks_uri": "https://server.example.com/jwks.json",
Expand Down
26 changes: 13 additions & 13 deletions demos/employee-vci/metadata/dev/credential_issuer_metadata.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"credential_issuer": "https://datasign-demo-vci.tunnelto.dev",
"authorization_servers": ["https://datasign-demo-vci.tunnelto.dev"],
"credential_endpoint": "https://datasign-demo-vci.tunnelto.dev/credentials",
"credential_issuer": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM",
"authorization_servers": ["https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM"],
"credential_endpoint": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/credentials",
"display": [
{
"name": "株式会社DataSign",
"name": "株式会社Example",
"locale": "ja_JP",
"logo": {
"url": "https://datasign-demo-vci.tunnelto.dev/public/datasign-inc-logo.png",
"alt_text": "株式会社DataSignのロゴ"
"url": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/images/company-logo.png",
"alt_text": "株式会社Exampleのロゴ"
},
"background_color": "#003289",
"text_color": "#FFFFFF"
},
{
"name": "DataSign Inc.",
"name": "Example Inc.",
"locale": "en-US",
"logo": {
"url": "https://datasign-demo-vci.tunnelto.dev/public/datasign-inc-logo.png",
"alt_text": "a square logo of a DataSign Inc."
"url": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/images/company-logo.png",
"alt_text": "a square logo of a Example Inc."
},
"background_color": "#003289",
"text_color": "#FFFFFF"
Expand All @@ -42,22 +42,22 @@
"name": "社員証",
"locale": "ja",
"logo": {
"url": "https://datasign-demo-vci.tunnelto.dev/public/employee-identification-credential-logo.png",
"url": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/images/credential-logo.png",
"alt_text": "社員証のロゴ"
},
"background_color": "#003289",
"background_image": "https://datasign-demo-vci.tunnelto.dev/images/DataSign.png",
"background_image": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/images/credential-background.png",
"text_color": "#FFFFFF"
},
{
"name": "Employee Identification Credential",
"locale": "en-US",
"logo": {
"url": "https://datasign-demo-vci.tunnelto.dev/public/employee-identification-credential-logo.png",
"url": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/images/credential-logo.png",
"alt_text": "a square logo of a Employee Identification Credential"
},
"background_color": "#003289",
"background_image": "https://datasign-demo-vci.tunnelto.dev/images/DataSign.png",
"background_image": "https://REPLACE-WITH-ISSUERS-DOMAIN.EXAMPLE.COM/images/credential-background.png",
"text_color": "#FFFFFF"
}
],
Expand Down
Loading