Skip to content

Commit

Permalink
Various fixes, add create endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aldigjo committed Dec 16, 2024
1 parent 3a2eeb1 commit 68a4ac3
Show file tree
Hide file tree
Showing 7 changed files with 404 additions and 215 deletions.
100 changes: 57 additions & 43 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,40 @@ paths:

# Verification

/v2/verification/{identifier}/check:
/v2/identities/{identifier}/verification/create:
post:
summary: Create a Verification query
operationId: CreateVerification
description: |
Endpoint to create a verification query.
tags:
- Verification
parameters:
- name: identifier
in: path
required: true
description: Issuer's DID Identifier
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateVerificationQueryRequest'
responses:
'200':
description: Verification query created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/GenericMessage'
'400':
$ref: '#/components/responses/400'
'500':
$ref: '#/components/responses/500'

/v2/identities/{identifier}/verification/check:
get:
summary: Check Verification Response or Provide Query
operationId: CheckVerification
Expand Down Expand Up @@ -2303,7 +2336,8 @@ components:
x-go-type-import:
name: protocol
path: github.com/iden3/iden3comm/v2/protocol


#Verification
VerificationResponse:
type: object
required:
Expand Down Expand Up @@ -2335,48 +2369,9 @@ components:
type: string
description: The ID of the verification query.
scopes:
type: array
items:
$ref: '#/components/schemas/VerificationScope'


VerificationScope:
type: object
required:
- scope_id
- query_type
- context
properties:
scope_id:
type: string
description: ID of the scope.
query_type:
type: string
description: Type of query for the verification.
context:
type: string
description: Additional context for the query.

VerificationResponseRequest:
type: object
required:
- verification_scope_id
- user_did
- response
properties:
verification_scope_id:
type: string
x-go-type: uuid.UUID
x-go-type-import:
name: uuid
path: github.com/google/uuid
description: Scope ID of the verification query.
user_did:
type: string
description: User's DID identifier.
response:
type: object
description: Response to the verification query request.
additionalProperties: true
description: "Dynamic JSON object for scopes"

VerificationResponseStatus:
type: object
Expand All @@ -2392,6 +2387,25 @@ components:
type: boolean
description: Whether the query response passed the check

CreateVerificationQueryRequest:
type: object
required:
- chain_id
- skip_revocation_check
- scopes
properties:
chain_id:
type: integer
example: 1
skip_revocation_check:
type: boolean
example: false
scopes:
type: object
additionalProperties: true
description: "Dynamic JSON object for scopes"


parameters:
credentialStatusType:
name: credentialStatusType
Expand Down
2 changes: 1 addition & 1 deletion cmd/platform/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func main() {
}
accountService := services.NewAccountService(*networkResolver)

verificationService := services.NewVerificationService(verifier, verificationRepository)
verificationService := services.NewVerificationService(networkResolver, cachex, verificationRepository, verifier)

publisherGateway, err := gateways.NewPublisherEthGateway(*networkResolver, keyStore, cfg.PublishingKeyPath)
if err != nil {
Expand Down
Loading

0 comments on commit 68a4ac3

Please sign in to comment.