Skip to content

Commit 451ca48

Browse files
committed
fix in issuer registration
1 parent 3ca8409 commit 451ca48

12 files changed

Lines changed: 263 additions & 46 deletions

File tree

config/config.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ const (
1717
type Config struct {
1818
cfgPkg.BaseConfig `envconfig:"CORE"`
1919

20-
Postgres postgresPkg.Config `envconfig:"POSTGRES"`
21-
Nats cloudeventprovider.NatsConfig `envconfig:"NATS"`
22-
Git GitConfig `envconfig:"GIT"`
23-
JwtIssuer JwtIssuerConfig `envconfig:"OPEN_ID"`
24-
CredentialIssuer CredentialIssuerConfig `envconfig:"CREDENTIAL_ISSUER"`
25-
Gateway GatewayConfig `envconfig:"GATEWAY"`
20+
Postgres postgresPkg.Config `envconfig:"POSTGRES"`
21+
Nats cloudeventprovider.NatsConfig `envconfig:"NATS"`
22+
Git GitConfig `envconfig:"GIT"`
23+
JwtIssuer JwtIssuerConfig `envconfig:"OPEN_ID"`
24+
CredentialIssuer CredentialIssuerConfig `envconfig:"CREDENTIAL_ISSUER"`
25+
Gateway GatewayConfig `envconfig:"GATEWAY"`
26+
CredentialConfigurationExpiration int `envconfig:"CREDENTIAL_CONFIGURATION_EXPIRATION" default:"60"`
2627
}
2728

2829
type GatewayConfig struct {

deployment/docker/docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
version: '3.9'
2-
name: well-known-service
1+
version: '2.2'
32
services:
43
postgres:
54
image: postgres:14-alpine
@@ -11,7 +10,9 @@ services:
1110
- POSTGRES_PASSWORD=postgres
1211
- POSTGRES_USER=postgres
1312
- POSTGRES_DB=postgres
13+
- POSTGRES_PARAMS=sslmode=disable
1414
nats:
1515
image: nats:2.10.10
1616
ports:
17-
- 4222:4222
17+
- 4222:4222
18+
- 8222:8222

deployment/helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: v1.0.0
33
description: Well Known Service
44
name: well-known-service
5-
version: 1.0.1-tag
5+
version: 1.0.2-tag
66
dependencies:
77
- name: library
88
version: 1.1.1

deployment/helm/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ spec:
8181
- name: WELLKNOWN_SERVICE_CREDENTIAL_GIT_INTERVAL
8282
value: "{{ .Values.config.importer.git.interval }}"
8383
{{- end}}
84+
- name: WELLKNOWN_SERVICE_CREDENTIAL_CONFIGURATION_EXPIRATION
85+
value: {{ .Values.config.credential.configexpiration }}
8486
{{- if .Values.config.importer.broadcast}}
8587
- name: WELLKNOWN_SERVICE_CREDENTIAL_ISSUER_IMPORTER
8688
value: BROADCAST

deployment/helm/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,6 @@ config:
6666
queuegroup: wellknown
6767
issuer: changeme
6868
importer:
69-
broadcast:
69+
broadcast:
70+
credential:
71+
configexpiration: 60

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ require (
4444
github.com/eclipse-xfsc/cloud-event-provider v0.1.5 // indirect
4545
github.com/eclipse-xfsc/crypto-provider-core v1.4.1 // indirect
4646
github.com/eclipse-xfsc/did-core v1.0.2 // indirect
47-
github.com/eclipse-xfsc/microservice-core-go v1.1.0 // indirect
48-
github.com/eclipse-xfsc/nats-message-library v1.1.13 // indirect
47+
github.com/eclipse-xfsc/microservice-core-go v1.1.1 // indirect
48+
github.com/eclipse-xfsc/nats-message-library v1.1.14 // indirect
4949
github.com/eclipse-xfsc/oid4-vci-vp-library v1.4.6 // indirect
5050
github.com/eclipse-xfsc/ssi-jwt v1.2.1 // indirect
5151
github.com/eclipse/paho.golang v0.12.0 // indirect
5252
github.com/emirpasic/gods v1.18.1 // indirect
5353
github.com/fsnotify/fsnotify v1.9.0 // indirect
5454
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
5555
github.com/gin-contrib/sse v1.1.0 // indirect
56-
github.com/go-logr/logr v1.4.2 // indirect
56+
github.com/go-logr/logr v1.4.3 // indirect
5757
github.com/go-logr/zapr v1.3.0 // indirect
5858
github.com/go-openapi/jsonpointer v0.21.1 // indirect
5959
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -65,7 +65,7 @@ require (
6565
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
6666
github.com/goccy/go-json v0.10.5 // indirect
6767
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
68-
github.com/golang-migrate/migrate/v4 v4.18.2 // indirect
68+
github.com/golang-migrate/migrate/v4 v4.19.0 // indirect
6969
github.com/golang/snappy v0.0.4 // indirect
7070
github.com/hashicorp/errwrap v1.1.0 // indirect
7171
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -92,7 +92,7 @@ require (
9292
github.com/lestrrat-go/httpcc v1.0.1 // indirect
9393
github.com/lestrrat-go/httprc v1.0.6 // indirect
9494
github.com/lestrrat-go/iter v1.0.2 // indirect
95-
github.com/lestrrat-go/jwx/v2 v2.1.5 // indirect
95+
github.com/lestrrat-go/jwx/v2 v2.1.6 // indirect
9696
github.com/lestrrat-go/option v1.0.1 // indirect
9797
github.com/lib/pq v1.10.9 // indirect
9898
github.com/magiconair/properties v1.8.10 // indirect

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ github.com/eclipse-xfsc/did-core v1.0.2 h1:UDqmuBqqaO07jSqW7RhjNkRpENDGJgJ0Gdera
173173
github.com/eclipse-xfsc/did-core v1.0.2/go.mod h1:pNjlLRKCRzyK7q4GtjnHeJKz74l6ooJt8nKPE86BGm0=
174174
github.com/eclipse-xfsc/microservice-core-go v1.1.0 h1:Uyhk64iNiRELS6vjPNZfGKCvRUdpQp39n2oUKS4LBKM=
175175
github.com/eclipse-xfsc/microservice-core-go v1.1.0/go.mod h1:pMkUXQ6E3XLPzYhdHCwMEWx/as6QCaLdQguIFDbORlI=
176+
github.com/eclipse-xfsc/microservice-core-go v1.1.1 h1:G3PEu2N+/I9ije1gnPEUkOr27s8m3+18qtrVJLrBdMw=
177+
github.com/eclipse-xfsc/microservice-core-go v1.1.1/go.mod h1:YRLyt66TYC1Km40w6oagYrXjrMCyI1tym2wGEgWQ9pI=
176178
github.com/eclipse-xfsc/nats-message-library v1.1.13 h1:512BiQ+w7OpzJShWZ/c73BXF/0S45J2iw9pyOCCiMvQ=
177179
github.com/eclipse-xfsc/nats-message-library v1.1.13/go.mod h1:BuyOjgbVrW+9fwh7EurE4LcdsrSjF6UHHiWHTOL0Ojs=
180+
github.com/eclipse-xfsc/nats-message-library v1.1.14 h1:r50RJwEQ6W8rjs500r3pCd6ZRaPITOnWgLESuHknmyw=
181+
github.com/eclipse-xfsc/nats-message-library v1.1.14/go.mod h1:BuyOjgbVrW+9fwh7EurE4LcdsrSjF6UHHiWHTOL0Ojs=
178182
github.com/eclipse-xfsc/oid4-vci-vp-library v1.4.6 h1:7s9z5MMesQyCx4BgWPzG6CovBunLnBqmSKwDzTqa+6A=
179183
github.com/eclipse-xfsc/oid4-vci-vp-library v1.4.6/go.mod h1:EW5YtHCsHsRdAuxF8Xp5a7PRi1kzsAETXf4+0RH3wyw=
180184
github.com/eclipse-xfsc/ssi-jwt v1.2.1 h1:LQRhJ3Uw7sHmMS51RGHPsgUDbQkKO1NAPlB53VldcnQ=
@@ -223,6 +227,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
223227
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
224228
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
225229
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
230+
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
231+
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
226232
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
227233
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
228234
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
@@ -274,6 +280,8 @@ github.com/golang-migrate/migrate/v4 v4.17.1 h1:4zQ6iqL6t6AiItphxJctQb3cFqWiSpMn
274280
github.com/golang-migrate/migrate/v4 v4.17.1/go.mod h1:m8hinFyWBn0SA4QKHuKh175Pm9wjmxj3S2Mia7dbXzM=
275281
github.com/golang-migrate/migrate/v4 v4.18.2 h1:2VSCMz7x7mjyTXx3m2zPokOY82LTRgxK1yQYKo6wWQ8=
276282
github.com/golang-migrate/migrate/v4 v4.18.2/go.mod h1:2CM6tJvn2kqPXwnXO/d3rAQYiyoIm180VsO8PRX6Rpk=
283+
github.com/golang-migrate/migrate/v4 v4.19.0 h1:RcjOnCGz3Or6HQYEJ/EEVLfWnmw9KnoigPSjzhCuaSE=
284+
github.com/golang-migrate/migrate/v4 v4.19.0/go.mod h1:9dyEcu+hO+G9hPSw8AIg50yg622pXJsoHItQnDGZkI0=
277285
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
278286
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
279287
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -423,6 +431,8 @@ github.com/lestrrat-go/jwx/v2 v2.1.0 h1:0zs7Ya6+39qoit7gwAf+cYm1zzgS3fceIdo7RmQ5
423431
github.com/lestrrat-go/jwx/v2 v2.1.0/go.mod h1:Xpw9QIaUGiIUD1Wx0NcY1sIHwFf8lDuZn/cmxtXYRys=
424432
github.com/lestrrat-go/jwx/v2 v2.1.5 h1:PQI5gzadLfJ22ckLrejPVX6eGXKM4M4eGi5fW2jjA3o=
425433
github.com/lestrrat-go/jwx/v2 v2.1.5/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU=
434+
github.com/lestrrat-go/jwx/v2 v2.1.6 h1:hxM1gfDILk/l5ylers6BX/Eq1m/pnxe9NBwW6lVfecA=
435+
github.com/lestrrat-go/jwx/v2 v2.1.6/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU=
426436
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
427437
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
428438
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=

internal/database/issuers/issuers.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ import (
88
)
99

1010
type Store interface {
11-
Get(ctx context.Context, tenantID string) (*Issuer, error)
12-
Insert(ctx context.Context, issuer Issuer) error
13-
Update(ctx context.Context, tenantID, credentialIssuer string, update IssuerUpdate) error
11+
GetIssuerRecord(ctx context.Context, tenantID string) (*Issuer, error)
12+
GetConfigurationsRecord(ctx context.Context, tenantID string) ([]CredentialsSupported, error)
13+
InsertIssuerRecord(ctx context.Context, issuer Issuer) error
14+
UpdateIssuerRecord(ctx context.Context, tenantID, credentialIssuer string, update IssuerUpdate) error
15+
InsertConfigurationsSupported(ctx context.Context, tenantID string, cs []CredentialsSupported) error
16+
UpdateConfigurationsSupported(ctx context.Context, tenantID string, update []CredentialsSupported) error
1417
// List(ctx context.Context, tenantID string) ([]Issuer, error)
1518
// ListAll(ctx context.Context) ([]Issuer, error)
1619
}
@@ -55,6 +58,7 @@ type IssuerUpdate struct {
5558
}
5659

5760
type CredentialsSupported struct {
61+
TenantID string
5862
CredentialConfigurationID string
5963
Format string
6064
Scope string
@@ -73,6 +77,7 @@ type CredentialsSupported struct {
7377
}
7478

7579
type CredentialSupportedRow struct {
80+
TenantID string
7681
CredentialConfigurationID *string
7782
Format *string
7883
Scope *string

0 commit comments

Comments
 (0)