Skip to content
Merged
16 changes: 16 additions & 0 deletions specs/search/common/schemas/Vault.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sourceObject:
title: sourceObject
type: object
description: A vault source.
additionalProperties: false
required:
- source
properties:
source:
type: string
description: 'The IP range of the source'
example: "10.0.0.1/32"
description:
type: string
description: 'A description of the source'
example: "Office IP range"
24 changes: 24 additions & 0 deletions specs/search/paths/vault/appendSource.yml
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
post:
tags:
- vault
operationId: appendSource
description: Add a single source to the list of allowed sources.
requestBody:
required: true
description: The sources to allow
content:
application/json:
schema:
$ref: '../../common/schemas/Vault.yml#/sourceObject'
responses:
'200':
description: OK
content:
application/json:
schema:
title: appendSourceResponse
type: object
additionalProperties: false
properties:
createdAt:
type: string
format: date-time
25 changes: 25 additions & 0 deletions specs/search/paths/vault/deleteSource.yml
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
delete:
tags:
- vault
operationId: deleteSource
description: Remove a single source from the list of allowed sources.
parameters:
- name: source
in: path
required: true
description: The IP range of the source
schema:
type: string
example: "10.0.0.1/32"
responses:
'200':
description: OK
content:
application/json:
schema:
title: deleteSourceResponse
type: object
additionalProperties: false
properties:
deletedAt:
type: string
format: date-time
42 changes: 42 additions & 0 deletions specs/search/paths/vault/vaultSources.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
get:
tags:
- vault
operationId: getSources
description: List all allowed sources.
responses:
'200':
description: OK
content:
application/json:
schema:
title: listSourceResponse
type: array
items:
$ref: '../../common/schemas/Vault.yml#/sourceObject'

put:
tags:
- vault
operationId: getSources
description: List all allowed sources.
requestBody:
required: true
description: The sources to allow
content:
application/json:
schema:
title: sourceObjectList
type: array
items:
$ref: '../../common/schemas/Vault.yml#/sourceObject'
responses:
'200':
description: OK
content:
application/json:
schema:
title: appendSourceResponse
type: object
additionalProperties: false
properties:
updatedAt:
type: string
format: date-time
12 changes: 6 additions & 6 deletions specs/search/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ paths:
# #######################
# ### Vault Endpoints ###
# #######################
# /1/security/sources:
# $ref: './paths/vault/vaultSources.yml'
# /1/security/sources/append:
# $ref: './paths/vault/appendSource.yml'
# /1/security/sources/{source}:
# $ref: './paths/vault/deleteSource.yml'
/1/security/sources:
$ref: './paths/vault/vaultSources.yml'
/1/security/sources/append:
$ref: './paths/vault/appendSource.yml'
/1/security/sources/{source}:
$ref: './paths/vault/deleteSource.yml'

# ##########################
# ### Advanced Endpoints ###
Expand Down