Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtony98 committed Jan 16, 2023
2 parents 7c7c9de + eabe406 commit b3816bd
Show file tree
Hide file tree
Showing 33 changed files with 759 additions and 445 deletions.
64 changes: 32 additions & 32 deletions backend/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3582,39 +3582,39 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
},
"publicKey": {
"type": "string",
"example": ""
"example": "johns_nacl_public_key"
},
"encryptedPrivateKey": {
"type": "string",
"example": ""
"example": "johns_enc_nacl_private_key"
},
"iv": {
"type": "string",
"example": ""
"example": "iv_of_enc_nacl_private_key"
},
"tag": {
"type": "string",
"example": ""
"example": "tag_of_enc_nacl_private_key"
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
Expand All @@ -3630,27 +3630,27 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
},
"publicKey": {
"type": "string",
"example": ""
"example": "johns_nacl_public_key"
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
Expand All @@ -3676,27 +3676,27 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
},
"publicKey": {
"type": "string",
"example": ""
"example": "johns_nacl_public_key"
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
Expand All @@ -3723,7 +3723,7 @@
},
"name": {
"type": "string",
"example": ""
"example": "Acme Corp."
},
"customerId": {
"type": "string",
Expand Down Expand Up @@ -3776,7 +3776,7 @@
"properties": {
"publicKey": {
"type": "string",
"example": ""
"example": "senders_nacl_public_key"
}
}
},
Expand Down Expand Up @@ -3938,11 +3938,11 @@
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
Expand All @@ -3962,15 +3962,15 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
}
}
},
Expand Down Expand Up @@ -4033,11 +4033,11 @@
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
Expand Down Expand Up @@ -4087,15 +4087,15 @@
},
"type": {
"type": "string",
"example": ""
"example": "shared"
},
"user": {
"type": "string",
"example": ""
},
"environment": {
"type": "string",
"example": ""
"example": "dev"
},
"isDeleted": {
"type": "string",
Expand Down
65 changes: 32 additions & 33 deletions backend/swagger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' });
const fs = require('fs').promises;
const yaml = require('js-yaml');
const { secretSchema } = require('./schemas/index.ts');

/**
* Generates OpenAPI specs for all Infisical API endpoints:
Expand Down Expand Up @@ -43,46 +42,46 @@ const generateOpenAPISpec = async () => {
definitions: {
CurrentUser: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
encryptedPrivateKey: '',
iv: '',
tag: '',
updatedAt: '',
createdAt: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe',
publicKey: 'johns_nacl_public_key',
encryptedPrivateKey: 'johns_enc_nacl_private_key',
iv: 'iv_of_enc_nacl_private_key',
tag: 'tag_of_enc_nacl_private_key',
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
Membership: {
user: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
updatedAt: '',
createdAt: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe',
publicKey: 'johns_nacl_public_key',
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
workspace: '',
role: 'admin'
},
MembershipOrg: {
user: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
updatedAt: '',
createdAt: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe',
publicKey: 'johns_nacl_public_key',
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
organization: '',
role: 'owner',
status: 'accepted'
},
Organization: {
_id: '',
name: '',
name: 'Acme Corp.',
customerId: ''
},
Project: {
Expand All @@ -97,7 +96,7 @@ const generateOpenAPISpec = async () => {
encryptedkey: '',
nonce: '',
sender: {
publicKey: ''
publicKey: 'senders_nacl_public_key'
},
receiver: '',
workspace: ''
Expand Down Expand Up @@ -141,16 +140,16 @@ const generateOpenAPISpec = async () => {
secretCommentCiphertext: '',
secretCommentIV: '',
secretCommentTag: '',
updatedAt: '',
createdAt: ''
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
Log: {
_id: '',
user: {
_id: '',
email: '',
firstName: '',
lastName: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe'
},
workspace: '',
actionNames: [
Expand All @@ -171,8 +170,8 @@ const generateOpenAPISpec = async () => {
],
channel: 'cli',
ipAddress: '192.168.0.1',
updatedAt: '',
createdAt: ''
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
SecretSnapshot: {
workspace: '',
Expand All @@ -188,9 +187,9 @@ const generateOpenAPISpec = async () => {
secret: '',
version: 1,
workspace: '',
type: '',
type: 'shared',
user: '',
environment: '',
environment: 'dev',
isDeleted: '',
secretKeyCiphertext: '',
secretKeyIV: '',
Expand Down
6 changes: 0 additions & 6 deletions backend/swagger/schemas/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions backend/swagger/schemas/secretSchema.ts

This file was deleted.

7 changes: 7 additions & 0 deletions docs/api-reference/endpoints/secrets/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
title: "Create"
openapi: "POST /api/v2/secrets/"
---

<Tip>
Using this route requires understanding Infisical's system and cryptography.
It may be helpful to read through the
[introduction](/api-reference/overview/introduction) and [guide for creating
secrets](/api-reference/overview/examples/create-secrets).
</Tip>
7 changes: 7 additions & 0 deletions docs/api-reference/endpoints/secrets/read.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
title: "Retrieve"
openapi: "GET /api/v2/secrets/"
---

<Tip>
Using this route requires understanding Infisical's system and cryptography.
It may be helpful to read through the
[introduction](/api-reference/overview/introduction) and [guide for retrieving
secrets](/api-reference/overview/examples/retrieve-secrets).
</Tip>
7 changes: 7 additions & 0 deletions docs/api-reference/endpoints/secrets/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
title: "Update"
openapi: "PATCH /api/v2/secrets/"
---

<Tip>
Using this route requires understanding Infisical's system and cryptography.
It may be helpful to read through the
[introduction](/api-reference/overview/introduction) and [guide for updating
secrets](/api-reference/overview/examples/update-secrets).
</Tip>

0 comments on commit b3816bd

Please sign in to comment.