Skip to content

Commit 716910a

Browse files
feat: seed issuer for database attestations (#447)
1 parent 7dd7ab4 commit 716910a

File tree

7 files changed

+322
-40
lines changed

7 files changed

+322
-40
lines changed

deployment/issuer.tf

+18
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ resource "kubernetes_config_map" "issuer-initdb-config" {
4545
CREATE USER issuer WITH ENCRYPTED PASSWORD 'issuer' SUPERUSER;
4646
CREATE DATABASE issuer;
4747
\c issuer issuer
48+
49+
create table if not exists membership_attestations
50+
(
51+
membership_type integer default 0,
52+
holder_id varchar not null,
53+
membership_start_date timestamp default now() not null,
54+
id varchar default gen_random_uuid() not null
55+
constraint attestations_pk
56+
primary key
57+
);
58+
59+
create unique index if not exists membership_attestation_holder_id_uindex
60+
on membership_attestations (holder_id);
61+
62+
-- seed the consumer and provider into the attestations DB, so that they can request FoobarCredentials sourcing
63+
-- information from the database
64+
INSERT INTO membership_attestations (membership_type, holder_id) VALUES (1, 'did:web:consumer-identityhub%3A7083:consumer');
65+
INSERT INTO membership_attestations (membership_type, holder_id) VALUES (2, 'did:web:provider-identityhub%3A7083:provider');
4866
EOT
4967
}
5068
}

deployment/modules/issuer/main.tf

+13-6
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,19 @@ resource "kubernetes_config_map" "issuerservice-config" {
137137
WEB_HTTP_DID_PORT = var.ports.did
138138
WEB_HTTP_DID_PATH = "/"
139139

140-
JAVA_TOOL_OPTIONS = "${var.useSVE ? "-XX:UseSVE=0 " : ""}-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${var.ports.debug}"
141-
EDC_VAULT_HASHICORP_URL = var.vault-url
142-
EDC_VAULT_HASHICORP_TOKEN = var.vault-token
143-
EDC_DATASOURCE_DEFAULT_URL = var.database.url
144-
EDC_DATASOURCE_DEFAULT_USER = var.database.user
145-
EDC_DATASOURCE_DEFAULT_PASSWORD = var.database.password
140+
JAVA_TOOL_OPTIONS = "${var.useSVE ? "-XX:UseSVE=0 " : ""}-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${var.ports.debug}"
141+
EDC_VAULT_HASHICORP_URL = var.vault-url
142+
EDC_VAULT_HASHICORP_TOKEN = var.vault-token
143+
EDC_DATASOURCE_DEFAULT_URL = var.database.url
144+
EDC_DATASOURCE_DEFAULT_USER = var.database.user
145+
EDC_DATASOURCE_DEFAULT_PASSWORD = var.database.password
146+
147+
# even though we have a default data source, we need a named datasource for the DatabaseAttestationSource, because
148+
# that is configured in the AttestationDefinition
149+
EDC_DATASOURCE_MEMBERSHIP_URL = var.database.url
150+
EDC_DATASOURCE_MEMBERSHIP_USER = var.database.user
151+
EDC_DATASOURCE_MEMBERSHIP_PASSWORD = var.database.password
152+
146153
EDC_SQL_SCHEMA_AUTOCREATE = true
147154
EDC_IAM_ACCESSTOKEN_JTI_VALIDATION = true
148155
EDC_IAM_DID_WEB_USE_HTTPS = false
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "9432baf7-0849-46e4-a1a7-dece247a41be",
2+
"id": "9330e6b5-fffa-40a9-8835-5e76233f9ccd",
33
"name": "MVD K8S",
44
"values": [
55
{
@@ -14,12 +14,6 @@
1414
"type": "default",
1515
"enabled": true
1616
},
17-
{
18-
"key": "PROVIDER_ID",
19-
"value": "did:web:provider-identityhub%3A7083:provider",
20-
"type": "default",
21-
"enabled": true
22-
},
2317
{
2418
"key": "CATALOG_SERVER_DSP_URL",
2519
"value": "http://provider-catalog-server-controlplane:8082",
@@ -32,27 +26,39 @@
3226
"type": "default",
3327
"enabled": true
3428
},
29+
{
30+
"key": "PROVIDER_PUBLIC_API",
31+
"value": "http://localhost/provider-qna/public",
32+
"type": "default",
33+
"enabled": true
34+
},
3535
{
3636
"key": "PROVIDER_DSP_URL",
3737
"value": "http://provider-qna-controlplane:8082",
3838
"type": "default",
3939
"enabled": true
4040
},
4141
{
42-
"key": "PROVIDER_PUBLIC_API",
43-
"value": "http://localhost/provider-qna/public",
42+
"key": "PROVIDER_ID",
43+
"value": "did:web:provider-identityhub%3A7083:provider",
4444
"type": "default",
4545
"enabled": true
4646
},
4747
{
48-
"key": "ISSUER_ADMIN_URL",
49-
"value": "http://localhost/issuer/ad",
48+
"key": "PROVIDER_NAME",
49+
"value": "MVD Provider Participant",
5050
"type": "default",
5151
"enabled": true
5252
},
5353
{
54-
"key": "ISSUER_CONTEXT_ID",
55-
"value": "ZGlkOndlYjpkYXRhc3BhY2UtaXNzdWVyLXNlcnZpY2UlM0ExMDAxNjppc3N1ZXI",
54+
"key": "CONSUMER_ID",
55+
"value": "did:web:consumer-identityhub%3A7083:consumer",
56+
"type": "default",
57+
"enabled": true
58+
},
59+
{
60+
"key": "CONSUMER_NAME",
61+
"value": "MVD Consumer Participant",
5662
"type": "default",
5763
"enabled": true
5864
},
@@ -61,9 +67,63 @@
6167
"value": "did:web:dataspace-issuer-service%3A10016:issuer",
6268
"type": "default",
6369
"enabled": true
70+
},
71+
{
72+
"key": "ISSUER_BASE_URL",
73+
"value": "http://localhost/issuer/ad",
74+
"type": "default",
75+
"enabled": true
76+
},
77+
{
78+
"key": "ISSUER_ADMIN_URL",
79+
"value": "",
80+
"type": "default",
81+
"enabled": true
82+
},
83+
{
84+
"key": "PARTICIPANT_ID_BASE64",
85+
"value": "",
86+
"type": "default",
87+
"enabled": true
88+
},
89+
{
90+
"key": "REQUEST_ID",
91+
"value": "",
92+
"type": "any",
93+
"enabled": true
94+
},
95+
{
96+
"key": "POLICY_ID_ASSET_1",
97+
"value": "",
98+
"type": "any",
99+
"enabled": true
100+
},
101+
{
102+
"key": "CONTRACT_NEGOTIATION_ID",
103+
"value": "",
104+
"type": "any",
105+
"enabled": true
106+
},
107+
{
108+
"key": "CONTRACT_AGREEMENT_ID",
109+
"value": "",
110+
"type": "any",
111+
"enabled": true
112+
},
113+
{
114+
"key": "TRANSFER_PROCESS_ID",
115+
"value": "",
116+
"type": "any",
117+
"enabled": true
118+
},
119+
{
120+
"key": "AUTHORIZATION",
121+
"value": "",
122+
"type": "any",
123+
"enabled": true
64124
}
65125
],
66126
"_postman_variable_scope": "environment",
67-
"_postman_exported_at": "2024-07-19T12:19:41.675Z",
68-
"_postman_exported_using": "Postman/11.4.0"
127+
"_postman_exported_at": "2025-03-05T06:26:50.206Z",
128+
"_postman_exported_using": "Postman/11.34.4"
69129
}

deployment/postman/MVD Local Development.postman_environment.json

+58-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "35c096d9-84c2-499f-8ed0-8bcf3275370b",
2+
"id": "448d5e51-e4f9-4b2a-96ea-1054aab52c1d",
33
"name": "MVD Local Development",
44
"values": [
55
{
@@ -14,12 +14,6 @@
1414
"type": "default",
1515
"enabled": true
1616
},
17-
{
18-
"key": "PROVIDER_ID",
19-
"value": "did:web:localhost%3A7093",
20-
"type": "default",
21-
"enabled": true
22-
},
2317
{
2418
"key": "CATALOG_SERVER_DSP_URL",
2519
"value": "http://localhost:8092",
@@ -44,14 +38,68 @@
4438
"type": "default",
4539
"enabled": true
4640
},
41+
{
42+
"key": "ISSUER_BASE_URL",
43+
"value": "",
44+
"type": "default",
45+
"enabled": true
46+
},
4747
{
4848
"key": "ISSUER_ADMIN_URL",
49-
"value": "http://localhost:10013",
49+
"value": "",
50+
"type": "default",
51+
"enabled": true
52+
},
53+
{
54+
"key": "CONSUMER_ID",
55+
"value": "did:web:localhost%3A7083",
56+
"type": "default",
57+
"enabled": true
58+
},
59+
{
60+
"key": "CONSUMER_NAME",
61+
"value": "MVD Consumer Participant",
62+
"type": "default",
63+
"enabled": true
64+
},
65+
{
66+
"key": "PROVIDER_ID",
67+
"value": "did:web:localhost%3A7093",
68+
"type": "default",
69+
"enabled": true
70+
},
71+
{
72+
"key": "PROVIDER_NAME",
73+
"value": "MVD Provider Participant",
74+
"type": "default",
75+
"enabled": true
76+
},
77+
{
78+
"key": "ISSUER_DID",
79+
"value": "did:web:localhost%3A10100",
5080
"type": "default",
5181
"enabled": true
82+
},
83+
{
84+
"key": "POLICY_ID_ASSET_1",
85+
"value": "",
86+
"type": "any",
87+
"enabled": true
88+
},
89+
{
90+
"key": "PARTICIPANT_ID_BASE64",
91+
"value": "ZGlkOndlYjpsb2NhbGhvc3QlM0E3MDgz",
92+
"type": "default",
93+
"enabled": true
94+
},
95+
{
96+
"key": "REQUEST_ID",
97+
"value": "",
98+
"type": "any",
99+
"enabled": true
52100
}
53101
],
54102
"_postman_variable_scope": "environment",
55-
"_postman_exported_at": "2024-07-19T12:19:50.250Z",
56-
"_postman_exported_using": "Postman/11.4.0"
103+
"_postman_exported_at": "2025-03-05T06:26:44.509Z",
104+
"_postman_exported_using": "Postman/11.34.4"
57105
}

0 commit comments

Comments
 (0)