You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor(db): replace flyway with liquibase
Liquibase has better support for different types of databases. It allows having a single migration file for all databases.
* do not copy test resources into prod image
* update README.md
* rename 2.0.3 database migration script
---------
Co-authored-by: Stefan Wiedemann <[email protected]>
@@ -13,12 +13,15 @@ trusted for a certain service.
13
13
14
14
## Background
15
15
16
-
In an DSBA-compliant framework, a [Verifier](https://github.com/FIWARE/VCVerifier) is responsible to communicate with wallets
16
+
In an DSBA-compliant framework, a [Verifier](https://github.com/FIWARE/VCVerifier) is responsible to communicate with
17
+
wallets
17
18
and verify the credentials they provide. To get this done, it needs information about:
19
+
18
20
- the credentials to be requested from a wallet
19
21
- the credentials and claims an issuer is allowed to issue
20
22
21
-
To do so, it requires a service that provides such information, e.g. the Credentials Config Service. See the following diagram
23
+
To do so, it requires a service that provides such information, e.g. the Credentials Config Service. See the following
24
+
diagram
22
25
on how the service integrates into the framework.
23
26
24
27

@@ -27,20 +30,26 @@ on how the service integrates into the framework.
27
30
28
31
### Container
29
32
30
-
The Credentials-Config-Service Service is provided as a container at [quay.io](https://quay.io/repository/fiware/credentials-config-service).
33
+
The Credentials-Config-Service Service is provided as a container
34
+
at [quay.io](https://quay.io/repository/fiware/credentials-config-service).
31
35
To store information about the services, a database has to be provided. In a local setup, you can for example use:
36
+
32
37
```shell
33
38
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=db mysql
34
39
```
40
+
35
41
and the start the service:
42
+
36
43
```shell
37
44
docker run --network host quay.io/fiware/credentials-config-service:0.0.1
38
45
```
46
+
39
47
After that, its accessible at ```localhost:8080```.
40
48
41
49
### Configuration
42
50
43
-
Configurations can be provided with the standard mechanisms of the [Micronaut-Framework](https://micronaut.io/), e.g. [environment variables or appliction.yaml file](https://docs.micronaut.io/3.1.3/guide/index.html#configurationProperties).
51
+
Configurations can be provided with the standard mechanisms of the [Micronaut-Framework](https://micronaut.io/),
52
+
e.g. [environment variables or appliction.yaml file](https://docs.micronaut.io/3.1.3/guide/index.html#configurationProperties).
44
53
The following table concentrates on the most important configuration parameters:
45
54
46
55
| Property | Env-Var | Description | Default |
@@ -55,10 +64,13 @@ The following table concentrates on the most important configuration parameters:
55
64
56
65
### Database
57
66
58
-
Credentials-Config-Service requires an SQL database. It currently supports MySql-compatible DBs, PostgreSQL and H2 (as an In-Memory DB for dev/test purposes).
59
-
Migrations are applied via [flyway](https://flywaydb.org/), see the [migration-scripts](./src/main/resources/db/migration) for the schema.
67
+
Credentials-Config-Service requires an SQL database. It currently supports MySql-compatible DBs, PostgreSQL and H2 (as
68
+
an In-Memory DB for dev/test purposes).
69
+
Migrations are applied via [liquibase](https://www.liquibase.com/), see
70
+
the [migration-scripts](./src/main/resources/db/migration).
60
71
61
-
By default, the system is configured to use MySQL. To run it with PostgreSQL, you should update the following configuration:
72
+
By default, the system is configured to use MySQL. To run it with PostgreSQL, you should update the following
It is used to manage the service-related entries and provides endpoints to retrieve the required information.
90
+
- [ Credentials-Config-Service API ](./api/credentials-config-service.yaml)
79
91
92
+
It is used to manage the service-related entries and provides endpoints to retrieve the required information.
80
93
81
94
### Example
82
95
83
96
To have information about a service available, it first needs to be created.
84
97
An example request would look like:
85
-
```shell
86
-
curl -X 'POST' \
98
+
99
+
```shell
100
+
curl -X 'POST' \
87
101
'http://localhost:8080/service'\
88
-
-H 'accept: */*' \
89
-
-H 'Content-Type: application/json' \
102
+
-H 'accept: */*' \
103
+
-H 'Content-Type: application/json' \
90
104
-d '{
91
-
"id": "packet-delivery-service",
92
-
"defaultOidcScope": "default",
93
-
"oidcScopes": {
94
-
"default": {
95
-
"credentials": [
105
+
"id": "packet-delivery-service",
106
+
"defaultOidcScope": "default",
107
+
"oidcScopes": {
108
+
"default": {
109
+
"credentials": [
110
+
{
111
+
"type": "VerifiableCredential",
112
+
"trustedParticipantsLists": [
113
+
"https://tir-pdc.ebsi.fiware.dev"
114
+
],
115
+
"trustedIssuersLists": [
116
+
"https://til-pdc.ebsi.fiware.dev"
117
+
]
118
+
}
119
+
],
120
+
"presentationDefinition": {
121
+
"id": "somethingUnique",
122
+
"name": "Presentation to be requested.",
123
+
"purpose": "something that describes our request.",
124
+
"input_descriptors": [
96
125
{
97
-
"type": "VerifiableCredential",
98
-
"trustedParticipantsLists": [
99
-
"https://tir-pdc.ebsi.fiware.dev"
100
-
],
101
-
"trustedIssuersLists": [
102
-
"https://til-pdc.ebsi.fiware.dev"
126
+
"id": "somethingUnique",
127
+
"name": "User Age request",
128
+
"purpose": "Only users above a certain age should get service access",
129
+
"constraints": {
130
+
"fields": [
131
+
{
132
+
"id": "somethingUnique",
133
+
"name": "User Age request",
134
+
"purpose": "Only users above a certain age should get service access",
135
+
"optional": false,
136
+
"path": [
137
+
"$.dateOfBirth"
138
+
]
139
+
}
140
+
]
141
+
},
142
+
"format": {
143
+
"vc+sd-jwt":
144
+
"alg": [ "ES256" ]
145
+
}
103
146
]
104
147
}
105
-
],
106
-
"presentationDefinition": {
107
-
"id": "somethingUnique",
108
-
"name": "Presentation to be requested.",
109
-
"purpose": "something that describes our request.",
110
-
"input_descriptors": [
111
-
{
112
-
"id": "somethingUnique",
113
-
"name": "User Age request",
114
-
"purpose": "Only users above a certain age should get service access",
115
-
"constraints": {
116
-
"fields": [
117
-
{
118
-
"id": "somethingUnique",
119
-
"name": "User Age request",
120
-
"purpose": "Only users above a certain age should get service access",
121
-
"optional": false,
122
-
"path": [
123
-
"$.dateOfBirth"
124
-
]
125
-
}
126
-
]
127
-
},
128
-
"format": {
129
-
"vc+sd-jwt":
130
-
"alg": ["ES256"]
131
-
}
132
-
]
133
-
}
134
-
}
135
-
}
136
-
}'
148
+
}
149
+
}
150
+
}'
137
151
```
138
-
Such configuration will define that the requested scope for authentication-requests to ```packet-delivery-service``` is
139
-
```VerifiableCredential```and that the issuer needs to be listed as a trusted-participant at
140
-
```https://tir-pdc.ebsi.fiware.dev```and that the information about the trusted-issuers should be retrieved from ```https://til-pdc.ebsi.fiware.dev```.
141
-
Additionally, it describes the presentation to be requested need to include the claim ```$.dateOfBirth``` and should be a ```vc+sd-jwt``` credential, signed by an ```ES256``` algorithm.
152
+
153
+
Such configuration will define that the requested scope for authentication-requests to ```packet-delivery-service``` is
154
+
```VerifiableCredential``` and that the issuer needs to be listed as a trusted-participant at
155
+
```https://tir-pdc.ebsi.fiware.dev``` and that the information about the trusted-issuers should be retrieved from
156
+
```https://til-pdc.ebsi.fiware.dev```.
157
+
Additionally, it describes the presentation to be requested need to include the claim ```$.dateOfBirth``` and should be
158
+
a ```vc+sd-jwt``` credential, signed by an ```ES256``` algorithm.
For each service and scope, a [Presentation Definition](https://identity.foundation/presentation-exchange/#presentation-definition) can be defined.
221
-
The Presentation Definition will be requested in the OID4VP exchange from the Holder's Wallet.
240
+
For each service and scope,
241
+
a [Presentation Definition](https://identity.foundation/presentation-exchange/#presentation-definition) can be defined.
242
+
The Presentation Definition will be requested in the OID4VP exchange from the Holder's Wallet.
222
243
223
244
Example:
224
245
225
246
```json
247
+
{
226
248
"presentationDefinition": {
227
249
"id": "somethingUnique",
228
250
"name": "Presentation to be requested.",
@@ -240,10 +262,10 @@ Example:
240
262
"purpose": "We do only accept offical documents for proofing the age.",
241
263
"optional": false,
242
264
"path": [
243
-
"$.vct"
265
+
"$.vct"
244
266
],
245
267
"filter": {
246
-
"const": "NaturalPersonCredential"
268
+
"const": "NaturalPersonCredential"
247
269
}
248
270
},
249
271
{
@@ -252,25 +274,32 @@ Example:
252
274
"purpose": "Only users above a certain age should get service access",
253
275
"optional": false,
254
276
"path": [
255
-
"$.dateOfBirth"
277
+
"$.dateOfBirth"
256
278
]
257
279
}
258
280
]
259
281
},
260
282
"format": {
261
-
"vc+sd-jwt":
262
-
"alg": ["ES256"]
283
+
"vc+sd-jwt": {
284
+
"alg": [
285
+
"ES256"
286
+
]
287
+
}
288
+
}
263
289
}
264
290
]
265
291
}
292
+
}
266
293
```
267
294
268
-
This definition will request a credential of type ```NaturalPersonCredential```, that contains the claim ```$.dateOfBirth```(defined by a JsonPath expression),
269
-
in the ```vc+sd-jwt``` format, signed by the ```ES256``` algorithm. While PresentationDefinitions allow very fine-grained control about the claims and
270
-
credentials to be requested, most wallets do only support a limited complexity(f.e. only level-one path expressions or no filtering). At the moment,
295
+
This definition will request a credential of type ```NaturalPersonCredential```, that contains the claim
296
+
```$.dateOfBirth```(defined by a JsonPath expression),
297
+
in the ```vc+sd-jwt``` format, signed by the ```ES256``` algorithm. While PresentationDefinitions allow very
298
+
fine-grained control about the claims and
299
+
credentials to be requested, most wallets do only support a limited complexity(f.e. only level-one path expressions or
300
+
no filtering). At the moment,
271
301
its recommended to keep complexity at the minimal level.
272
302
273
-
274
303
## License
275
304
276
305
Credentials-Config-Service is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
0 commit comments