Skip to content

Commit

Permalink
Update API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Nov 18, 2023
1 parent e54001e commit eb11d4f
Show file tree
Hide file tree
Showing 45 changed files with 789 additions and 1,382 deletions.
145 changes: 79 additions & 66 deletions nethsm-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,10 @@ paths:
post:
responses:
"201":
headers:
location:
description: Where to find the newly added key.
content:
application/json:
schema:
type: string
$ref: "#/components/schemas/CreateResourceId"
description: |
Successful import of a private key.
The response contains a Location header,
Expand All @@ -279,23 +278,13 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/PrivateKey"
application/x-pem-file:
multipart/form-data:
schema:
$ref: "#/components/schemas/PemPrivateKey"
$ref: "#/components/schemas/PrivateKeyPem"
encoding:
key_file:
contentType: application/x-pem-file
required: true
parameters:
- name: mechanisms
in: query
schema:
type: array
items:
$ref: "#/components/schemas/KeyMechanism"
- name: tags
in: query
schema:
type: array
items:
$ref: "#/components/schemas/ID"
security:
- basic: []
x-annotation-role:
Expand All @@ -309,11 +298,10 @@ paths:
description: |
Successful creation of new public and private key pair.
Set Location header to the new KeyID.
headers:
location:
description: Where to find the newly added key.
content:
application/json:
schema:
type: string
$ref: "#/components/schemas/CreateResourceId"
"400":
description: Bad request (specified properties are invalid).
"401":
Expand Down Expand Up @@ -364,7 +352,7 @@ paths:
restrictions:
tags:
- berlin
key:
public:
modulus: FhJQl11CiY0ifRHXeAqFh4rdSl6
publicExponent: FhJQl11CiY0ifRHXeAqFh4rdSl6
operations: 242
Expand All @@ -379,7 +367,7 @@ paths:
restrictions:
tags:
- berlin
key:
public:
data: BMKlPJ60PNFgsekRwg7n5mTIJkWWy6XLy0ORj14HumKi5qH63JaJzFOWLxYiaB6KH0NOgEKb7rUt
eddsa:
summary: "Curve25519"
Expand All @@ -391,7 +379,7 @@ paths:
restrictions:
tags:
- berlin
key:
public:
data: htnjTKRUz3XnLys5YD2+bKvzXZuu9cvXKwsCnWdzR+4=
generic:
summary: Generic
Expand Down Expand Up @@ -465,7 +453,7 @@ paths:
type: RSA
mechanisms:
- RSA_Signature_PSS_SHA256
key:
private:
primeP: AOnWFZ+JrI/xOXJU04uYCZOiPVUWd6CSbVseEYrYQYxc7dVroePshz29tc+VEOUP5T0O8lXMEkjFAwjW6C9QTAsPyl6jwyOQluMRIkdN4/7BAg3HAMuGd7VmkGyYrnZWW54sLWp1JD6XJG33kF+9OSar9ETPoVyBgK5punfiUFEL
primeQ: ANT1kWDdP9hZoFKT49dwdM/S+3ZDnxQa7kZk9p+JKU5RaU9e8pS2GOJljHwkES1FH6CUGeIaUi81tRKe2XZhe/163sEyMcxkaaRbBbTc1v6ZDKILFKKt4eX7LAQfhL/iFlgi6pcyUM8QDrm1QeFgGz11ChM0JuQw1WwkX06lg8iv
publicExponent: AQAB
Expand All @@ -478,7 +466,7 @@ paths:
type: EC_P224
mechanisms:
- ECDSA_Signature
key:
private:
data: "BgcqhkjOPQIBBgUrgQQAIQM6AATZOhHS/Sed4w=="
restrictions:
tags:
Expand All @@ -489,28 +477,18 @@ paths:
type: Curve25519
mechanisms:
- EdDSA_Signature
key:
private:
data: "m0o4HHT5tiwxxJ3hCzK6H9pXt9R854qyJ+q4Lmei/Kg="
restrictions:
tags:
- berlin
application/x-pem-file:
multipart/form-data:
schema:
$ref: "#/components/schemas/PemPrivateKey"
$ref: "#/components/schemas/PrivateKeyPem"
encoding:
key_file:
contentType: application/x-pem-file
required: true
parameters:
- name: mechanisms
in: query
schema:
type: array
items:
$ref: "#/components/schemas/KeyMechanism"
- name: tags
in: query
schema:
type: array
items:
$ref: "#/components/schemas/ID"
security:
- basic: []
x-annotation-role:
Expand Down Expand Up @@ -972,6 +950,10 @@ paths:
Successful creation of user.
The response contains a Location header,
e.g. "https://nethsm.local/v1/users/I8mhHYJ1T3uk2lXrwXehVaw9KZzg7K".
content:
application/json:
schema:
$ref: "#/components/schemas/CreateResourceId"
"400":
description: Bad request (specified properties are invalid, e.g. weak passphrase).
"401":
Expand Down Expand Up @@ -1841,19 +1823,7 @@ paths:
content:
multipart/form-data:
schema:
type: object
properties:
arguments:
type: object
properties:
backupPassphrase:
$ref: "#/components/schemas/Passphrase"
systemTime:
type: string
format: date-time
backup_file:
type: string
format: binary
$ref: "#/components/schemas/RestoreRequest"
x-annotation-role:
- Public
x-annotation-state:
Expand Down Expand Up @@ -1897,6 +1867,15 @@ components:
- warning
- error
type: string
CreateResourceId:
example:
id: ab0d5df406ddad1075ab
type: object
properties:
id:
type: string
required:
- id
KeyType:
enum:
- RSA
Expand Down Expand Up @@ -1968,19 +1947,19 @@ components:
type: string
KeyList:
example:
- key: KeyID
- id: KeyID
type: array
items:
$ref: "#/components/schemas/KeyItem"
KeyItem:
example:
key: KeyID
id: KeyID
type: object
properties:
key:
id:
$ref: "#/components/schemas/ID"
required:
- key
- id
KeyRestrictions:
type: object
properties:
Expand Down Expand Up @@ -2018,7 +1997,7 @@ components:
mechanisms:
- RSA_Signature_PSS_SHA256
type: RSA
key:
private:
primeP: AOnWFZ+JrI/xOXJU04uYCZOiPVUWd6CSbVseEYrYQYxc7dVroePshz29tc+VEOUP5T0O8lXMEkjFAwjW6C9QTAsPyl6jwyOQluMRIkdN4/7BAg3HAMuGd7VmkGyYrnZWW54sLWp1JD6XJG33kF+9OSar9ETPoVyBgK5punfiUFEL
primeQ: ANT1kWDdP9hZoFKT49dwdM/S+3ZDnxQa7kZk9p+JKU5RaU9e8pS2GOJljHwkES1FH6CUGeIaUi81tRKe2XZhe/163sEyMcxkaaRbBbTc1v6ZDKILFKKt4eX7LAQfhL/iFlgi6pcyUM8QDrm1QeFgGz11ChM0JuQw1WwkX06lg8iv
publicExponent: AQAB
Expand All @@ -2031,14 +2010,34 @@ components:
$ref: "#/components/schemas/KeyMechanisms"
type:
$ref: "#/components/schemas/KeyType"
key:
private:
$ref: "#/components/schemas/KeyPrivateData"
restrictions:
$ref: "#/components/schemas/KeyRestrictions"
required:
- mechanisms
- type
- key
- private
PrivateKeyPem:
example:
arguments:
mechanisms:
- RSA_Signature_PSS_SHA256
restrictions:
tags:
- munich
key_file: privatekey.pem
type: object
properties:
arguments:
type: object
properties:
mechanisms:
$ref: "#/components/schemas/KeyMechanisms"
restrictions:
$ref: "#/components/schemas/KeyRestrictions"
key_file:
$ref: "#/components/schemas/PemPrivateKey"
KeyPrivateData:
type: object
properties:
Expand All @@ -2058,7 +2057,7 @@ components:
restrictions:
tags:
- berlin
key:
public:
modulus: FhJQl11CiY0ifRHXeAqFh4rdSl6
publicExponent: FhJQl11CiY0ifRHXeAqFh4rdSl6
operations: 242
Expand All @@ -2070,7 +2069,7 @@ components:
$ref: "#/components/schemas/KeyType"
restrictions:
$ref: "#/components/schemas/KeyRestrictions"
key:
public:
$ref: "#/components/schemas/KeyPublicData"
operations:
type: integer
Expand Down Expand Up @@ -2414,6 +2413,20 @@ components:
required:
- newPassphrase
- currentPassphrase
RestoreRequest:
type: object
properties:
arguments:
type: object
properties:
backupPassphrase:
$ref: "#/components/schemas/Passphrase"
systemTime:
type: string
format: date-time
backup_file:
type: string
format: binary
TimeConfig:
example:
time: "2018-10-30T11:20:50Z"
Expand Down
Loading

0 comments on commit eb11d4f

Please sign in to comment.