From d712764b66f67078440c44eaf5633fd33a5effba Mon Sep 17 00:00:00 2001 From: edutomesco Date: Tue, 17 Sep 2024 14:33:16 +0200 Subject: [PATCH] =?UTF-8?q?BLO-23=20|=C2=A0update=20callback=20revocation?= =?UTF-8?q?=20status=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yaml | 3 +++ internal/config/config.go | 5 +++++ internal/platform/server/server.go | 2 +- internal/platform/zkp/verification_zkp_repository.go | 2 +- internal/services/criteria/verification_by_schema_id.go | 4 +++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/config.yaml b/config.yaml index dc04ba9..fe21e21 100644 --- a/config.yaml +++ b/config.yaml @@ -24,5 +24,8 @@ issuer: key: key: "" +verifier: + did: + verification: expiration: "" diff --git a/internal/config/config.go b/internal/config/config.go index ca501c3..f895a65 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -48,6 +48,10 @@ type IssuerConfig struct { IssuerDid string `mapstructure:"issuer_did"` } +type VerifierConfig struct { + Did string `mapstructure:"did" default:"did:polygonid:polygon:amoy:2qbSDKkr7smskYx9Ds9PkU4ARHbwXnFsSpcfsPHo7R"` +} + type KeyConfig struct { Key string `mapstructure:"key"` } @@ -64,6 +68,7 @@ type Config struct { Blockchain BlockchainConfig Issuer IssuerConfig Verification VerificationConfig + Verifier VerifierConfig } var Configuration = Config{} diff --git a/internal/platform/server/server.go b/internal/platform/server/server.go index 4e4bc2d..9655850 100644 --- a/internal/platform/server/server.go +++ b/internal/platform/server/server.go @@ -12,10 +12,10 @@ import ( "bloock-identity-managed-api/internal/platform/server/middleware" "bloock-identity-managed-api/internal/platform/utils" "fmt" + "github.com/gin-contrib/cors" "github.com/gin-contrib/logger" "github.com/gin-gonic/gin" "github.com/rs/zerolog" - "github.com/gin-contrib/cors" ) type Server struct { diff --git a/internal/platform/zkp/verification_zkp_repository.go b/internal/platform/zkp/verification_zkp_repository.go index 09698c2..ac4b124 100644 --- a/internal/platform/zkp/verification_zkp_repository.go +++ b/internal/platform/zkp/verification_zkp_repository.go @@ -99,7 +99,7 @@ func (z VerificationZkpRepository) DecodeJWZ(ctx context.Context, token string) } func (z VerificationZkpRepository) VerifyJWZ(ctx context.Context, token string, request protocol.AuthorizationRequestMessage) error { - _, err := z.authVerifier.FullVerify(ctx, token, request, pubsignals.WithAcceptedStateTransitionDelay(5*time.Second)) + _, err := z.authVerifier.FullVerify(ctx, token, request, pubsignals.WithAcceptedStateTransitionDelay(5*time.Minute)) if err != nil { z.logger.Error().Err(err).Msg("") return err diff --git a/internal/services/criteria/verification_by_schema_id.go b/internal/services/criteria/verification_by_schema_id.go index 343de84..b4fd9b9 100644 --- a/internal/services/criteria/verification_by_schema_id.go +++ b/internal/services/criteria/verification_by_schema_id.go @@ -20,6 +20,7 @@ import ( type CreateVerification struct { identityRepository repository.IdentityRepository publicUrl string + verifierDid string verificationSyncMap *utils.SyncMap authSyncMap *utils.SyncMap logger zerolog.Logger @@ -29,6 +30,7 @@ func NewCreateVerification(ctx context.Context, verificationSyncMap, authSyncMap return &CreateVerification{ identityRepository: identity.NewIdentityRepository(ctx, l), publicUrl: config.Configuration.Api.PublicHost, + verifierDid: config.Configuration.Verifier.Did, verificationSyncMap: verificationSyncMap, authSyncMap: authSyncMap, logger: l, @@ -61,7 +63,7 @@ func (c CreateVerification) Create(ctx context.Context, verificationJSON []byte) return nil, err } - request := auth.CreateAuthorizationRequest("verification request", "did:polygonid:polygon:amoy:2qbSDKkr7smskYx9Ds9PkU4ARHbwXnFsSpcfsPHo7R", callbackUrl) + request := auth.CreateAuthorizationRequest("verification request", c.verifierDid, callbackUrl) randomUUID := uuid.New().String() request.ID = randomUUID