Skip to content

Commit

Permalink
feat: Signed Credential Issuer's Metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK committed Sep 13, 2023
1 parent f3ea002 commit 79599be
Show file tree
Hide file tree
Showing 19 changed files with 883 additions and 353 deletions.
38 changes: 23 additions & 15 deletions cmd/vc-rest/startcmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ import (
"github.com/trustbloc/vcs/pkg/service/requestobject"
"github.com/trustbloc/vcs/pkg/service/verifycredential"
"github.com/trustbloc/vcs/pkg/service/verifypresentation"
"github.com/trustbloc/vcs/pkg/service/wellknown"
wellknownfetcher "github.com/trustbloc/vcs/pkg/service/wellknown/fetcher"
wellknownprovider "github.com/trustbloc/vcs/pkg/service/wellknown/provider"
"github.com/trustbloc/vcs/pkg/storage/mongodb"
"github.com/trustbloc/vcs/pkg/storage/mongodb/cslindexstore"
"github.com/trustbloc/vcs/pkg/storage/mongodb/cslvcstore"
Expand Down Expand Up @@ -536,12 +537,19 @@ func buildEchoHandler(
return newHTTPClient(tlsConfig, conf.StartupParameters, metrics, id)
}

openidCredentialIssuerConfigProviderSvc := wellknownprovider.NewService(&wellknownprovider.Config{
ExternalHostURL: conf.StartupParameters.apiGatewayURL,
KMSRegistry: kmsRegistry,
CryptoJWTSigner: vcCrypto,
})

// Issuer Profile Management API
issuerProfileSvc, err := profilereader.NewIssuerReader(&profilereader.Config{
TLSConfig: tlsConfig,
KMSRegistry: kmsRegistry,
CMD: cmd,
HTTPClient: getHTTPClient(metricsProvider.ClientIssuerProfile),
OpenidIssuerConfigProvider: openidCredentialIssuerConfigProviderSvc,
TLSConfig: tlsConfig,
KMSRegistry: kmsRegistry,
CMD: cmd,
HTTPClient: getHTTPClient(metricsProvider.ClientIssuerProfile),
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -647,7 +655,7 @@ func buildEchoHandler(
oidc4ciService, err = oidc4ci.NewService(&oidc4ci.Config{
TransactionStore: oidc4ciTransactionStore,
ClaimDataStore: oidc4ciClaimDataStore,
WellKnownService: wellknown.NewService(getHTTPClient(metricsProvider.ClientWellKnown)),
WellKnownService: wellknownfetcher.NewService(getHTTPClient(metricsProvider.ClientWellKnown)),
ProfileService: issuerProfileSvc,
IssuerVCSPublicHost: conf.StartupParameters.apiGatewayURL,
HTTPClient: getHTTPClient(metricsProvider.ClientOIDC4CI),
Expand Down Expand Up @@ -754,15 +762,15 @@ func buildEchoHandler(
}))

issuerv1.RegisterHandlers(e, issuerv1.NewController(&issuerv1.Config{
EventSvc: eventSvc,
ProfileSvc: issuerProfileSvc,
KMSRegistry: kmsRegistry,
DocumentLoader: documentLoader,
IssueCredentialService: issueCredentialSvc,
VcStatusManager: statusListVCSvc,
OIDC4CIService: oidc4ciService,
ExternalHostURL: conf.StartupParameters.apiGatewayURL,
Tracer: conf.Tracer,
EventSvc: eventSvc,
ProfileSvc: issuerProfileSvc,
DocumentLoader: documentLoader,
IssueCredentialService: issueCredentialSvc,
VcStatusManager: statusListVCSvc,
OIDC4CIService: oidc4ciService,
ExternalHostURL: conf.StartupParameters.apiGatewayURL,
Tracer: conf.Tracer,
OpenidIssuerConfigProvider: openidCredentialIssuerConfigProviderSvc,
}))

// Verifier Profile Management API
Expand Down
10 changes: 10 additions & 0 deletions component/profile/reader/file/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,20 @@ require (
github.com/creasty/defaults v1.7.0 // indirect
github.com/dave/jennifer v1.6.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deepmap/oapi-codegen v1.11.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ecordell/optgen v0.0.9 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getkin/kin-openapi v0.94.0 // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/go-jose/go-jose/v3 v3.0.1-0.20221117193127-916db76e8214 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/golang/glog v1.1.1 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand All @@ -67,13 +72,15 @@ require (
github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect
github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e // indirect
github.com/kilic/bls12-381 v0.1.1-0.20210503002446-7b7597926c69 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/cpuid/v2 v2.0.4 // indirect
github.com/labstack/echo/v4 v4.9.0 // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/goveralls v0.0.12 // indirect
Expand Down Expand Up @@ -136,13 +143,16 @@ require (
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Expand Down
Loading

0 comments on commit 79599be

Please sign in to comment.