Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
[OSE-166] Scaffolding for /v1/presentations/submissions (#171)
Browse files Browse the repository at this point in the history
* Initial create, delete, get for submissions

* Basic tests for the router

* Added the rest of the scaffolding

* Added List and Review

* Removed the delete method

* Simplified for scaffolding

* spec

* zero structs

* Consolidate under the same API

* mage spec

* Minor updates

* [OSE-167] Scaffolding for /v1/operations (#172)

* The simplest scaffolding possible

* rename

Co-authored-by: Gabe <[email protected]>

* Fix lint and compilation

* PR fixes

* rename

* regen

* spec

* Removed unused config

* reviews

Co-authored-by: Gabe <[email protected]>
  • Loading branch information
andresuribe87 and Gabe authored Nov 15, 2022
1 parent 3c91cb6 commit 114818b
Show file tree
Hide file tree
Showing 11 changed files with 440 additions and 51 deletions.
216 changes: 203 additions & 13 deletions doc/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,13 @@ definitions:
schemaJwt:
type: string
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.CreateSubmissionRequest:
properties:
submissionJwt:
type: string
required:
- submissionJwt
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.GetApplicationResponse:
properties:
application:
Expand Down Expand Up @@ -725,7 +732,38 @@ definitions:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetSchemaResponse'
type: array
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.GetSubmissionResponse:
properties:
submission:
$ref: '#/definitions/exchange.PresentationSubmission'
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.ListSubmissionRequest:
properties:
filter:
type: string
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.ListSubmissionResponse:
properties:
submissions:
items:
$ref: '#/definitions/exchange.PresentationSubmission'
type: array
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.Operation:
properties:
done:
type: boolean
id:
type: string
result:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.OperationResult'
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.OperationResult:
properties:
error:
type: string
response:
$ref: '#/definitions/exchange.PresentationSubmission'
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.ResolveDIDResponse:
properties:
Expand All @@ -736,6 +774,20 @@ definitions:
didResolutionMetadata:
$ref: '#/definitions/did.DIDResolutionMetadata'
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.ReviewSubmissionRequest:
properties:
approved:
type: boolean
reason:
type: string
required:
- approved
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.ReviewSubmissionResponse:
properties:
submission:
$ref: '#/definitions/exchange.PresentationSubmission'
type: object
github.com_tbd54566975_ssi-service_pkg_server_router.StoreKeyRequest:
properties:
base58PrivateKey:
Expand Down Expand Up @@ -1041,6 +1093,13 @@ definitions:
schemaJwt:
type: string
type: object
pkg_server_router.CreateSubmissionRequest:
properties:
submissionJwt:
type: string
required:
- submissionJwt
type: object
pkg_server_router.GetApplicationResponse:
properties:
application:
Expand Down Expand Up @@ -1169,7 +1228,38 @@ definitions:
$ref: '#/definitions/pkg_server_router.GetSchemaResponse'
type: array
type: object
pkg_server_router.GetSubmissionResponse:
properties:
submission:
$ref: '#/definitions/exchange.PresentationSubmission'
type: object
pkg_server_router.ListSubmissionRequest:
properties:
filter:
type: string
type: object
pkg_server_router.ListSubmissionResponse:
properties:
submissions:
items:
$ref: '#/definitions/exchange.PresentationSubmission'
type: array
type: object
pkg_server_router.Operation:
properties:
done:
type: boolean
id:
type: string
result:
$ref: '#/definitions/pkg_server_router.OperationResult'
type: object
pkg_server_router.OperationResult:
properties:
error:
type: string
response:
$ref: '#/definitions/exchange.PresentationSubmission'
type: object
pkg_server_router.ResolveDIDResponse:
properties:
Expand All @@ -1180,6 +1270,20 @@ definitions:
didResolutionMetadata:
$ref: '#/definitions/did.DIDResolutionMetadata'
type: object
pkg_server_router.ReviewSubmissionRequest:
properties:
approved:
type: boolean
reason:
type: string
required:
- approved
type: object
pkg_server_router.ReviewSubmissionResponse:
properties:
submission:
$ref: '#/definitions/exchange.PresentationSubmission'
type: object
pkg_server_router.StoreKeyRequest:
properties:
base58PrivateKey:
Expand Down Expand Up @@ -1757,7 +1861,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetManifestsResponse'
$ref: '#/definitions/pkg_server_router.GetManifestsResponse'
"400":
description: Bad request
schema:
Expand All @@ -1779,14 +1883,14 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.CreateManifestRequest'
$ref: '#/definitions/pkg_server_router.CreateManifestRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.CreateManifestResponse'
$ref: '#/definitions/pkg_server_router.CreateManifestResponse'
"400":
description: Bad request
schema:
Expand Down Expand Up @@ -1843,7 +1947,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetManifestResponse'
$ref: '#/definitions/pkg_server_router.GetManifestResponse'
"400":
description: Bad request
schema:
Expand All @@ -1863,7 +1967,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetApplicationsResponse'
$ref: '#/definitions/pkg_server_router.GetApplicationsResponse'
"400":
description: Bad request
schema:
Expand All @@ -1886,14 +1990,14 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.SubmitApplicationRequest'
$ref: '#/definitions/pkg_server_router.SubmitApplicationRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.SubmitApplicationResponse'
$ref: '#/definitions/pkg_server_router.SubmitApplicationResponse'
"400":
description: Bad request
schema:
Expand Down Expand Up @@ -1950,7 +2054,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetApplicationResponse'
$ref: '#/definitions/pkg_server_router.GetApplicationResponse'
"400":
description: Bad request
schema:
Expand All @@ -1970,7 +2074,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetResponsesResponse'
$ref: '#/definitions/pkg_server_router.GetResponsesResponse'
"400":
description: Bad request
schema:
Expand Down Expand Up @@ -2027,7 +2131,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetResponseResponse'
$ref: '#/definitions/pkg_server_router.GetResponseResponse'
"400":
description: Bad request
schema:
Expand Down Expand Up @@ -2104,14 +2208,14 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.CreatePresentationDefinitionRequest'
$ref: '#/definitions/pkg_server_router.CreatePresentationDefinitionRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.CreatePresentationDefinitionResponse'
$ref: '#/definitions/pkg_server_router.CreatePresentationDefinitionResponse'
"400":
description: Bad request
schema:
Expand Down Expand Up @@ -2168,14 +2272,100 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/github.com_tbd54566975_ssi-service_pkg_server_router.GetPresentationDefinitionResponse'
$ref: '#/definitions/pkg_server_router.GetPresentationDefinitionResponse'
"400":
description: Bad request
schema:
type: string
summary: Get PresentationDefinition
tags:
- PresentationDefinitionAPI
/v1/presentations/submission/{id}:
get:
consumes:
- application/json
description: Get a submission by its ID
parameters:
- description: ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/pkg_server_router.GetSubmissionResponse'
"400":
description: Bad request
schema:
type: string
summary: Get Submission
tags:
- SubmissionAPI
/v1/presentations/submissions:
get:
consumes:
- application/json
description: Reviews a pending submission. After this method is called, the
operation with `id==presentations/submissions/{submission_id}` will be updated
with the result of this invocation.
parameters:
- description: request body
in: body
name: request
required: true
schema:
$ref: '#/definitions/pkg_server_router.ReviewSubmissionRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/pkg_server_router.ReviewSubmissionResponse'
"400":
description: Bad request
schema:
type: string
"500":
description: Internal server error
schema:
type: string
summary: Review a pending submissions
tags:
- SubmissionAPI
put:
consumes:
- application/json
description: Creates a submission in this server ready to be reviewed.
parameters:
- description: request body
in: body
name: request
required: true
schema:
$ref: '#/definitions/pkg_server_router.CreateSubmissionRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/pkg_server_router.Operation'
"400":
description: Bad request
schema:
type: string
"500":
description: Internal server error
schema:
type: string
summary: Create Submission
tags:
- SubmissionAPI
/v1/schemas:
get:
consumes:
Expand Down
3 changes: 0 additions & 3 deletions pkg/server/router/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ func NewOperationRouter(s svcframework.Service) (*OperationRouter, error) {
return &OperationRouter{service: service}, nil
}

type Operation struct {
}

// GetOperation godoc
// @Summary Get an operation
// @Description Get operation by its ID
Expand Down
Loading

0 comments on commit 114818b

Please sign in to comment.