Skip to content

Commit

Permalink
Fixes for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
aldigjo committed Dec 10, 2024
1 parent 1b24269 commit 3a2eeb1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/core/ports/verification_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/polygonid/sh-id-platform/internal/core/domain"
)

// VerificationService interface.
// VerificationService interface
type VerificationService interface {
CheckVerification(ctx context.Context, issuerID w3c.DID, verificationQueryID uuid.UUID) (*domain.VerificationResponse, *domain.VerificationQuery, error)
SubmitVerificationResponse(ctx context.Context, verificationQueryID uuid.UUID, issuerID w3c.DID, token string, serverURL string) (*domain.VerificationResponse, error)
Expand Down
4 changes: 4 additions & 0 deletions internal/core/services/verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/polygonid/sh-id-platform/internal/repositories"
)

// Scope is a property of VerificationQuery, and it's required for the authRequest
type Scope struct {
CircuitId string `json:"circuitId"`
Id uint32 `json:"id"`
Expand All @@ -28,6 +29,7 @@ type Scope struct {
TransactionData *TransactionData `json:"transactionData,omitempty"`
}

// TransactionData is a property of Scope, and it's required for the authRequest
type TransactionData struct {
ChainID int `json:"chainID"`
ContractAddress string `json:"contractAddress"`
Expand All @@ -41,6 +43,7 @@ const (
defaultBigIntBase = 10
)

// VerificationService can verify responses to verification queries
type VerificationService struct {
verifier *auth.Verifier
repo ports.VerificationRepository
Expand Down Expand Up @@ -70,6 +73,7 @@ func (vs *VerificationService) CheckVerification(ctx context.Context, issuerID w
return nil, query, nil
}

// SubmitVerificationResponse checks if a verification response passes a verify check and saves result
func (vs *VerificationService) SubmitVerificationResponse(ctx context.Context, verificationQueryID uuid.UUID, issuerID w3c.DID, token string, serverURL string) (*domain.VerificationResponse, error) {
// check db for existing verification query
var authRequest = protocol.AuthorizationRequestMessage{}
Expand Down
3 changes: 2 additions & 1 deletion internal/repositories/verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const foreignKeyViolationErrorCode = "23503"

var (
// VerificationQueryNotFoundError is returned when a verification query is not found
VerificationQueryNotFoundError = errors.New("verification query not found")
VerificationQueryNotFoundError = errors.New("verification query not found")
// VerificationResponseNotFoundError is returned when a verification query is not found
VerificationResponseNotFoundError = errors.New("verification response not found")
)

Expand Down

0 comments on commit 3a2eeb1

Please sign in to comment.