Continue api-reference docs

This commit is contained in:
Tuan Dang
2023-01-13 15:04:46 +07:00
parent 0f043605d9
commit 9d4ea2dcda
26 changed files with 1466 additions and 122 deletions

View File

@@ -4,7 +4,10 @@ info:
description: List of all available APIs that can be consumed
version: 1.0.0
servers:
- url: https://infisical.com
description: Production server
- url: http://localhost:8080
description: Local server
paths:
/api/v1/secret/{secretId}/secret-versions:
get:
@@ -1270,6 +1273,24 @@ paths:
description: OK
'400':
description: Bad Request
/api/v2/users/me:
get:
summary: Retrieve the current user on the request
description: Retrieve the current user on the request
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/CurrentUser'
description: Current user on request
'400':
description: Bad Request
security:
- apiKeyAuth: []
/api/v2/workspace/{workspaceId}/secrets:
post:
description: ''
@@ -1321,18 +1342,29 @@ paths:
description: Bad Request
/api/v2/workspace/{workspaceId}/encrypted-key:
get:
description: ''
summary: Return encrypted project key
description: Return encrypted project key
parameters:
- name: workspaceId
in: path
required: true
schema:
type: string
description: ID of project
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ProjectKey'
description: Encrypted project key for the given project
'400':
description: Bad Request
security:
- apiKeyAuth: []
/api/v2/workspace/{workspaceId}/service-token-data:
get:
description: ''
@@ -1513,57 +1545,122 @@ paths:
example: any
/api/v2/secrets/:
post:
description: ''
summary: Create new secret(s)
description: Create one or many secrets for a given project and environment.
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Secret'
description: >-
Array of newly-created secrets for the given project and
environment
security:
- apiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
secrets:
example: any
workspaceId:
example: any
type: string
description: ID of project
environment:
example: any
type: string
description: Environment within project
secrets:
$ref: '#/components/schemas/CreateSecret'
description: Secret(s) to create - object or array of objects
get:
description: ''
parameters:
- name: workspaceId
in: query
schema:
type: string
- name: environment
in: query
schema:
type: string
responses:
'200':
description: OK
patch:
description: ''
summary: Read secrets
description: Read secrets from a project and environment
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Secret'
description: Array of secrets for the given project and environment
security:
- apiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
workspaceId:
type: string
description: ID of project
environment:
type: string
description: Environment within project
patch:
summary: Update secret(s)
description: Update secret(s)
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Secret'
description: >-
Array of newly-updated secrets for the given project and
environment
security:
- apiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
secrets:
example: any
$ref: '#/components/schemas/UpdateSecret'
description: Secret(s) to update - object or array of objects
delete:
description: ''
summary: Delete secret(s)
description: Delete one or many secrets by their ID(s)
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Secret'
description: Array of deleted secrets
security:
- apiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
secretIds:
type: string
description: ID(s) of secrets - string or array of strings
/api/v2/service-token/:
get:
description: ''
@@ -1665,26 +1762,183 @@ paths:
description: OK
components:
schemas:
secret:
CurrentUser:
type: object
properties:
_id:
type: string
example: ''
email:
type: string
example: ''
firstName:
type: string
example: ''
lastName:
type: string
example: ''
publicKey:
type: string
example: ''
encryptedPrivateKey:
type: string
example: ''
updatedAt:
type: string
example: ''
createdAt:
type: string
example: ''
ProjectKey:
type: object
properties:
encryptedkey:
type: string
example: ''
nonce:
type: string
example: ''
sender:
type: object
properties:
publicKey:
type: string
example: ''
receiver:
type: string
example: ''
workspace:
type: string
example: ''
CreateSecret:
type: object
properties:
type:
type: string
example: object
properties:
type: object
properties:
test:
type: object
properties:
type:
type: string
example: integer
description:
type: string
example: '123'
example: shared
secretKeyCiphertext:
type: string
example: ''
secretKeyIV:
type: string
example: ''
secretKeyTag:
type: string
example: ''
secretValueCiphertext:
type: string
example: ''
secretValueIV:
type: string
example: ''
secretValueTag:
type: string
example: ''
secretCommentCiphertext:
type: string
example: ''
secretCommentIV:
type: string
example: ''
secretCommentTag:
type: string
example: ''
UpdateSecret:
type: object
properties:
id:
type: string
example: ''
secretKeyCiphertext:
type: string
example: ''
secretKeyIV:
type: string
example: ''
secretKeyTag:
type: string
example: ''
secretValueCiphertext:
type: string
example: ''
secretValueIV:
type: string
example: ''
secretValueTag:
type: string
example: ''
secretCommentCiphertext:
type: string
example: ''
secretCommentIV:
type: string
example: ''
secretCommentTag:
type: string
example: ''
Secret:
type: object
properties:
_id:
type: string
example: ''
version:
type: number
example: 1
workspace:
type: string
example: ''
type:
type: string
example: shared
user: {}
secretKeyCiphertext:
type: string
example: ''
secretKeyIV:
type: string
example: ''
secretKeyTag:
type: string
example: ''
secretValueCiphertext:
type: string
example: ''
secretValueIV:
type: string
example: ''
secretValueTag:
type: string
example: ''
secretCommentCiphertext:
type: string
example: ''
secretCommentIV:
type: string
example: ''
secretCommentTag:
type: string
example: ''
updatedAt:
type: string
example: ''
createdAt:
type: string
example: ''
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: >-
This security definition uses the HTTP 'bearer' scheme, which allows the
client to authenticate using a JSON Web Token (JWT) that is passed in
the Authorization header of the request.
apiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: >-
This security definition uses an API key, which is passed in the header
of the request as the value of the "X-API-Key" header. The client must
provide a valid key in order to access the API.