This commit is contained in:
Daniel Hougaard
2024-08-30 01:08:45 +04:00
7 changed files with 72 additions and 306 deletions

View File

@@ -1,292 +0,0 @@
{
"openapi": "3.0.3",
"info": {
"title": "Infisical API",
"description": "List of all available APIs that can be consumed",
"version": "0.0.1"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT",
"description": "An access token in Infisical"
}
},
"schemas": {}
},
"paths": {
"/api/v1/identities": {
"get": {
"description": "List identities",
"parameters": [
{
"schema": {
"type": "string"
},
"in": "query",
"name": "orgId",
"required": true,
"description": "The ID of the organization to list identities."
}
],
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"identities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"role": {
"type": "string"
},
"roleId": {
"type": "string",
"format": "uuid",
"nullable": true
},
"orgId": {
"type": "string",
"format": "uuid"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"identityId": {
"type": "string",
"format": "uuid"
},
"customRole": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"slug": {
"type": "string"
},
"permissions": {},
"description": {
"type": "string",
"nullable": true
}
},
"required": [
"id",
"name",
"slug"
],
"additionalProperties": false
},
"identity": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"authMethod": {
"type": "string",
"nullable": true
}
},
"required": [
"name",
"id"
],
"additionalProperties": false
}
},
"required": [
"id",
"role",
"orgId",
"createdAt",
"updatedAt",
"identityId",
"identity"
],
"additionalProperties": false
}
}
},
"required": [
"identities"
],
"additionalProperties": false
}
}
}
}
}
}
},
"/api/v1/identities/{identityId}": {
"get": {
"description": "Get an identity by id",
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"name": "identityId",
"required": true,
"description": "The ID of the identity to get details."
}
],
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"identity": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"role": {
"type": "string"
},
"roleId": {
"type": "string",
"format": "uuid",
"nullable": true
},
"orgId": {
"type": "string",
"format": "uuid"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"identityId": {
"type": "string",
"format": "uuid"
},
"customRole": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"slug": {
"type": "string"
},
"permissions": {},
"description": {
"type": "string",
"nullable": true
}
},
"required": [
"id",
"name",
"slug"
],
"additionalProperties": false
},
"identity": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"authMethod": {
"type": "string",
"nullable": true
}
},
"required": [
"name",
"id"
],
"additionalProperties": false
}
},
"required": [
"id",
"role",
"orgId",
"createdAt",
"updatedAt",
"identityId",
"identity"
],
"additionalProperties": false
}
},
"required": [
"identity"
],
"additionalProperties": false
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://app.infisical.com",
"description": "Production server"
},
{
"url": "http://localhost:8080",
"description": "Local server"
}
]
}

17
test/index.js Normal file
View File

@@ -0,0 +1,17 @@
const { InfisicalSDK } = require("../lib");
(async () => {
const client = new InfisicalSDK();
await client.auth().universalAuth.login({
clientId: "CLIENT_ID",
clientSecret: "CLIENT_SECRET"
});
const secrets = await client.secrets().listSecrets({
environment: "dev",
workspaceId: "PROJECT_ID"
});
console.log(secrets.secrets);
})();

View File

@@ -1,7 +0,0 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.8.0"
}
}