Skip to content

Commit

Permalink
chore: solved conflicts with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsaporiti committed Dec 19, 2024
2 parents a66fece + 241ad97 commit 0a2ec94
Show file tree
Hide file tree
Showing 43 changed files with 4,048 additions and 170 deletions.
1 change: 1 addition & 0 deletions .env-ui.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ ISSUER_UI_BUILD_TAG=
ISSUER_UI_WARNING_MESSAGE=
ISSUER_UI_IPFS_GATEWAY_URL=https://ipfs-proxy-cache.privado.id
ISSUER_UI_SCHEMA_EXPLORER_AND_BUILDER_URL=https://tools.privado.id
ISSUER_UI_SCHEMA_EXPLORER_AND_BUILDER_URL=https://display-method-dev.privado.id
ISSUER_UI_INSECURE=false
236 changes: 234 additions & 2 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,183 @@ paths:
'500':
$ref: '#/components/responses/500'

# Display Methods
/v2/identities/{identifier}/display-method:
post:
summary: Create Display Method
operationId: CreateDisplayMethod
description: Create a display method for the provided identity.
security:
- basicAuth: [ ]
tags:
- Display Methods
parameters:
- $ref: '#/components/parameters/pathIdentifier'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateDisplayMethodRequest'
responses:
'201':
description: Display Method Created
content:
application/json:
schema:
$ref: '#/components/schemas/UUIDResponse'
'400':
$ref: '#/components/responses/400'
'500':
$ref: '#/components/responses/500'

get:
summary: Get All Display Methods
operationId: GetAllDisplayMethods
description: |
Get all the display methods for the provided identity.
security:
- basicAuth: [ ]
tags:
- Display Methods
parameters:
- $ref: '#/components/parameters/pathIdentifier'
- in: query
name: page
schema:
type: integer
format: uint
minimum: 1
example: 1
- in: query
name: max_results
schema:
type: integer
format: uint
example: 50
default: 50
description: Number of items to fetch on each page. Minimum is 10. Default is 50. No maximum by the moment.
- in: query
name: sort
style: form
explode: false
schema:
type: array
items:
type: string
enum: [ "created_at", "-created_at", "name", "-name", "type", "-type" ]
default: "-created_at"
description: >
The minus sign (-) before field means descending order.
responses:
'200':
description: Display Method list response
content:
application/json:
schema:
$ref: '#/components/schemas/DisplayMethodPaginated'
'400':
$ref: '#/components/responses/400'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'

/v2/identities/{identifier}/display-method/{id}:
get:
summary: Get Display Method
operationId: GetDisplayMethod
description: |
Get a specific display method for the provided identity.
security:
- basicAuth: [ ]
tags:
- Display Methods
parameters:
- $ref: '#/components/parameters/pathIdentifier'
- $ref: '#/components/parameters/id'
responses:
'200':
description: Display Method response
content:
application/json:
schema:
$ref: '#/components/schemas/DisplayMethodEntity'
'400':
$ref: '#/components/responses/400'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'

patch:
summary: Update Display Method
operationId: UpdateDisplayMethod
description: |
Update a specific display method for the provided identity.
security:
- basicAuth: [ ]
tags:
- Display Methods
parameters:
- $ref: '#/components/parameters/pathIdentifier'
- $ref: '#/components/parameters/id'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
example: "New Display Method Name"
url:
type: string
example: "https://new-display-method.com"
type:
type: string
example: "Iden3BasicDisplayMethodV1"

responses:
'200':
description: Display Method updated
content:
application/json:
schema:
$ref: '#/components/schemas/GenericMessage'
'400':
$ref: '#/components/responses/400'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'

delete:
summary: Delete Display Method
operationId: DeleteDisplayMethod
description: |
Delete a specific display method for the provided identity.
security:
- basicAuth: [ ]
tags:
- Display Methods
parameters:
- $ref: '#/components/parameters/pathIdentifier'
- $ref: '#/components/parameters/id'
responses:
'200':
description: Display Method updated
content:
application/json:
schema:
$ref: '#/components/schemas/GenericMessage'
'400':
$ref: '#/components/responses/400'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
/v2/identities/{identifier}/keys:
post:
summary: Create a Key
Expand Down Expand Up @@ -1516,7 +1693,7 @@ paths:
$ref: '#/components/responses/500'



components:
securitySchemes:
basicAuth:
Expand Down Expand Up @@ -1963,7 +2140,7 @@ components:
type: string
x-omitempty: false
enum:
- "Iden3BasicDisplayMethodv2"
- "Iden3BasicDisplayMethodV1"

#Credentials
CreateCredentialRequest:
Expand Down Expand Up @@ -2297,6 +2474,43 @@ components:
x-omitempty: false
example: https://wallet.privado.id#request_uri=url


DisplayMethodEntity:
type: object
required:
- id
- name
- url
- type
properties:
id:
type: string
x-go-type: uuid.UUID
x-go-type-import:
name: uuid
path: github.com/google/uuid
example: 8edd8112-c415-11ed-b036-debe37e1cbd6
name:
type: string
example: "a display method name"
url:
type: string
example: "https://someValidURL.com"
type:
type: string
example: "Iden3BasicDisplayMethodV1"

DisplayMethodPaginated:
type: object
required: [ items, meta ]
properties:
items:
type: array
items:
$ref: '#/components/schemas/DisplayMethodEntity'
meta:
$ref: '#/components/schemas/PaginatedMetadata'

CredentialSubject:
type: object
x-omitempty: false
Expand Down Expand Up @@ -2461,6 +2675,23 @@ components:
name: protocol
path: github.com/iden3/iden3comm/v2/protocol

CreateDisplayMethodRequest:
type: object
required:
- name
- url
properties:
name:
type: string
example: "My Display Method"
url:
type: string
example: "https://my-display-method.com"
type:
type: string
example: "Iden3BasicDisplayMethodV1"
description: "Display method type (Iden3BasicDisplayMethodV1 is default value)"

CreateKeyRequest:
type: object
required:
Expand Down Expand Up @@ -2531,6 +2762,7 @@ components:
$ref: '#/components/schemas/PaginatedMetadata'



parameters:
credentialStatusType:
name: credentialStatusType
Expand Down
4 changes: 2 additions & 2 deletions cmd/platform/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func main() {
proofService := services.NewProver(circuitsLoaderService)
schemaService := services.NewSchema(schemaRepository, schemaLoader)
linkService := services.NewLinkService(storage, claimsService, qrService, claimsRepository, linkRepository, schemaRepository, schemaLoader, sessionRepository, ps, identityService, *networkResolver, cfg.UniversalLinks)
displayMethodService := services.NewDisplayMethod(repositories.NewDisplayMethod(*storage))
keyService := services.NewKey(keyStore, claimsService, keyRepository)
transactionService, err := gateways.NewTransaction(*networkResolver)
if err != nil {
Expand Down Expand Up @@ -195,9 +196,8 @@ func main() {

api.HandlerWithOptions(
api.NewStrictHandlerWithOptions(
api.NewServer(cfg, identityService, accountService, connectionsService, claimsService, qrService, publisher, packageManager, *networkResolver, serverHealth, schemaService, linkService, keyService),
api.NewServer(cfg, identityService, accountService, connectionsService, claimsService, qrService, publisher, packageManager, *networkResolver, serverHealth, schemaService, linkService, displayMethodService, keyService),
middlewares(ctx, cfg.HTTPBasicAuth),

api.StrictHTTPServerOptions{
RequestErrorHandlerFunc: errors.RequestErrorHandlerFunc,
ResponseErrorHandlerFunc: errors.ResponseErrorHandlerFunc,
Expand Down
1 change: 1 addition & 0 deletions internal/api/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func (s *Server) Agent(ctx context.Context, request AgentRequestObject) (AgentRe
log.Error(ctx, "agent error", "err", err)
return Agent400JSONResponse{N400JSONResponse{err.Error()}}, nil
}

return Agent200JSONResponse{
Body: agent.Body,
From: agent.From,
Expand Down
Loading

0 comments on commit 0a2ec94

Please sign in to comment.