Skip to content

Commit

Permalink
updated key models
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA committed Aug 28, 2023
1 parent c6dff2d commit bb121e4
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 541 deletions.
231 changes: 30 additions & 201 deletions src/main/resources/interface-specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ClientKeys'
$ref: '#/components/schemas/Keys'
'400':
description: Bad Request
content:
Expand Down Expand Up @@ -552,7 +552,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ReadClientKeys'
$ref: '#/components/schemas/Keys'
'401':
description: Unauthorized
content:
Expand Down Expand Up @@ -601,7 +601,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ReadClientKey'
$ref: '#/components/schemas/Key'
'401':
description: Unauthorized
content:
Expand Down Expand Up @@ -661,55 +661,6 @@ paths:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'/clients/{clientId}/encoded/keys/{keyId}':
parameters:
- $ref: '#/components/parameters/CorrelationIdHeader'
- $ref: '#/components/parameters/IpAddress'
get:
tags:
- client
summary: Returns a base64 encoded key by client and key identifier (kid).
description: 'Given a client and key identifiers it returns the corresponding encoded key, if any'
operationId: getEncodedClientKeyById
parameters:
- name: clientId
in: path
description: ID of the client to look up
required: true
schema:
type: string
format: uuid
- name: keyId
in: path
description: the unique identifier of the key (kid) to lookup
required: true
schema:
type: string
responses:
'200':
description: returns the corresponding base 64 encoded key
content:
application/json:
schema:
$ref: '#/components/schemas/EncodedClientKey'
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Key not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'/clients/{clientId}/operators/{operatorId}/keys':
parameters:
- $ref: '#/components/parameters/CorrelationIdHeader'
Expand Down Expand Up @@ -740,7 +691,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ClientKeys'
$ref: '#/components/schemas/Keys'
'401':
description: Unauthorized
content:
Expand Down Expand Up @@ -984,34 +935,6 @@ components:
enum:
- CONSUMER
- API
KeyEntry:
type: object
description: 'Models Persistent Key'
properties:
id:
type: string
key:
type: string
use:
$ref: '#/components/schemas/KeyUse'
alg:
type: string
name:
type: string
createdAt:
type: string
format: date-time
relationshipId:
type: string
format: uuid
required:
- id
- key
- use
- alg
- name
- relationshipId
- createdAt
ClientWithKeys:
type: object
properties:
Expand All @@ -1020,7 +943,7 @@ components:
keys:
type: array
items:
$ref: '#/components/schemas/KeyEntry'
$ref: '#/components/schemas/Key'
required:
- client
- keys
Expand Down Expand Up @@ -1050,21 +973,6 @@ components:
required:
- results
- totalCount
OperatorDetails:
description: Contains some details about operator
type: object
properties:
relationshipId:
type: string
format: uuid
name:
type: string
familyName:
type: string
required:
- relationshipId
- name
- familyName
Operator:
description: Models a Client Operator
type: object
Expand Down Expand Up @@ -1112,65 +1020,43 @@ components:
- role
- createdAt
Key:
description: 'Models a JWK'
description: 'Models the PersistentKey'
type: object
properties:
kty:
type: string
key_ops:
type: array
items:
type: string
use:
type: string
alg:
relationshipId:
type: string
format: uuid
description: 'Represents the identifier of the party relationship whose platform security operator is uploading the key'
kid:
type: string
x5u:
type: string
minLength: 1
x5t:
type: string
'x5t#S256':
type: string
x5c:
type: array
items:
type: string
crv:
type: string
x:
type: string
'y':
type: string
d:
type: string
k:
type: string
'n':
type: string
e:
type: string
p:
type: string
q:
name:
type: string
dp:
encodedPem:
type: string
dq:
algorithm:
type: string
qi:
use:
$ref: '#/components/schemas/KeyUse'
createdAt:
type: string
oth:
uniqueItems: false
minItems: 1
format: date-time
required:
- relationshipId
- kid
- name
- encodedPem
- algorithm
- use
- createdAt
Keys:
type: object
properties:
keys:
type: array
items:
$ref: '#/components/schemas/OtherPrimeInfo'
$ref: '#/components/schemas/Key'
required:
- kty
- kid
- keys
OtherPrimeInfo:
title: OtherPrimeInfo
type: object
Expand All @@ -1185,63 +1071,6 @@ components:
- r
- d
- t
ReadClientKey:
type: object
properties:
key:
$ref: '#/components/schemas/Key'
name:
type: string
operator:
$ref: '#/components/schemas/OperatorDetails'
createdAt:
type: string
format: date-time
required:
- key
- name
- createdAt
- operator
ClientKey:
type: object
properties:
key:
$ref: '#/components/schemas/Key'
name:
type: string
createdAt:
type: string
format: date-time
required:
- key
- name
- createdAt
EncodedClientKey:
type: object
properties:
key:
type: string
description: 'base64 encoded key'
required:
- key
ReadClientKeys:
type: object
properties:
keys:
type: array
items:
$ref: '#/components/schemas/ReadClientKey'
required:
- keys
ClientKeys:
type: object
properties:
keys:
type: array
items:
$ref: '#/components/schemas/ClientKey'
required:
- keys
KeysSeed:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ case object ClientApiMarshallerImpl extends ClientApiMarshaller with SprayJsonSu
override implicit def fromEntityUnmarshallerClientSeed: FromEntityUnmarshaller[ClientSeed] =
sprayJsonUnmarshaller[ClientSeed]

override implicit def toEntityMarshallerEncodedClientKey: ToEntityMarshaller[EncodedClientKey] =
sprayJsonMarshaller[EncodedClientKey]

override implicit def fromEntityUnmarshallerKeySeedList: FromEntityUnmarshaller[Seq[KeySeed]] =
sprayJsonUnmarshaller[Seq[KeySeed]]

override implicit def toEntityMarshallerClientKeys: ToEntityMarshaller[ClientKeys] = sprayJsonMarshaller[ClientKeys]

override implicit def toEntityMarshallerClient: ToEntityMarshaller[Client] = sprayJsonMarshaller[Client]

override implicit def toEntityMarshallerClients: ToEntityMarshaller[Clients] =
Expand All @@ -32,13 +27,10 @@ case object ClientApiMarshallerImpl extends ClientApiMarshaller with SprayJsonSu
override implicit def fromEntityUnmarshallerPurposeAdditionDetails: FromEntityUnmarshaller[PurposeAdditionDetails] =
sprayJsonUnmarshaller[PurposeAdditionDetails]

override implicit def toEntityMarshallerReadClientKey: ToEntityMarshaller[ReadClientKey] =
sprayJsonMarshaller[ReadClientKey]

override implicit def toEntityMarshallerReadClientKeys: ToEntityMarshaller[ReadClientKeys] =
sprayJsonMarshaller[ReadClientKeys]

override implicit def toEntityMarshallerClientsWithKeys: ToEntityMarshaller[ClientsWithKeys] =
sprayJsonMarshaller[ClientsWithKeys]

override implicit def toEntityMarshallerKeys: ToEntityMarshaller[Keys] = sprayJsonMarshaller[Keys]

override implicit def toEntityMarshallerKey: ToEntityMarshaller[Key] = sprayJsonMarshaller[Key]
}
Loading

0 comments on commit bb121e4

Please sign in to comment.