diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e30c6b763..50115e58f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -108,6 +108,22 @@ brews: zsh_completion.install "completions/infisical.zsh" => "_infisical" fish_completion.install "completions/infisical.fish" man1.install "manpages/infisical.1.gz" + - name: 'infisical@{{.Version}}' + tap: + owner: Infisical + name: homebrew-get-cli + commit_author: + name: "Infisical" + email: ai@infisical.com + folder: Formula + homepage: "https://infisical.com" + description: "The official Infisical CLI" + install: |- + bin.install "infisical" + bash_completion.install "completions/infisical.bash" => "infisical" + zsh_completion.install "completions/infisical.zsh" => "_infisical" + fish_completion.install "completions/infisical.fish" + man1.install "manpages/infisical.1.gz" nfpms: - id: infisical diff --git a/backend/src/controllers/v1/secretImportController.ts b/backend/src/controllers/v1/secretImportController.ts index a55b20a94..4b6539930 100644 --- a/backend/src/controllers/v1/secretImportController.ts +++ b/backend/src/controllers/v1/secretImportController.ts @@ -30,7 +30,6 @@ export const createSecretImport = async (req: Request, res: Response) => { if (doesImportExist) { throw BadRequestError({ message: "Secret import already exist" }); } - importSecDoc.imports.push({ environment: secretImport.environment, secretPath: secretImport.secretPath diff --git a/backend/src/controllers/v2/secretsController.ts b/backend/src/controllers/v2/secretsController.ts index ea8098e37..284c69c09 100644 --- a/backend/src/controllers/v2/secretsController.ts +++ b/backend/src/controllers/v2/secretsController.ts @@ -830,7 +830,7 @@ export const getSecrets = async (req: Request, res: Response) => { // TODO(akhilmhdh) - secret-imp change this to org type let importedSecrets: any[] = []; - if (include_imports) { + if (include_imports === "true") { importedSecrets = await getAllImportedSecrets(workspaceId, environment, folderId as string); } diff --git a/backend/src/controllers/v3/secretsController.ts b/backend/src/controllers/v3/secretsController.ts index 4399b4be0..8a190f43a 100644 --- a/backend/src/controllers/v3/secretsController.ts +++ b/backend/src/controllers/v3/secretsController.ts @@ -25,14 +25,17 @@ export const getSecretsRaw = async (req: Request, res: Response) => { let secretPath = req.query.secretPath as string; const includeImports = req.query.include_imports as string; - // if the service token has single scope, it will get all secrets for that scope by default - const serviceTokenDetails: IServiceTokenData = req?.serviceTokenData + // if the service token has single scope, it will get all secrets for that scope by default + const serviceTokenDetails: IServiceTokenData = req?.serviceTokenData; if (serviceTokenDetails) { - if (serviceTokenDetails.scopes.length == 1 && !containsGlobPatterns(serviceTokenDetails.scopes[0].secretPath)) { - const scope = serviceTokenDetails.scopes[0] - secretPath = scope.secretPath - environment = scope.environment - workspaceId = serviceTokenDetails.workspace.toString() + if ( + serviceTokenDetails.scopes.length == 1 && + !containsGlobPatterns(serviceTokenDetails.scopes[0].secretPath) + ) { + const scope = serviceTokenDetails.scopes[0]; + secretPath = scope.secretPath; + environment = scope.environment; + workspaceId = serviceTokenDetails.workspace.toString(); } else { requireWorkspaceAuth({ acceptedRoles: [ADMIN, MEMBER], @@ -41,7 +44,7 @@ export const getSecretsRaw = async (req: Request, res: Response) => { requiredPermissions: [PERMISSION_READ_SECRETS], requireBlindIndicesEnabled: true, requireE2EEOff: true - }) + }); } } @@ -56,7 +59,7 @@ export const getSecretsRaw = async (req: Request, res: Response) => { workspaceId: new Types.ObjectId(workspaceId) }); - if (includeImports) { + if (includeImports === "true") { const folders = await Folder.findOne({ workspace: workspaceId, environment }); let folderId = "root"; // if folder exist get it and replace folderid with new one @@ -294,7 +297,7 @@ export const getSecrets = async (req: Request, res: Response) => { authData: req.authData }); - if (includeImports) { + if (includeImports === "true") { const folders = await Folder.findOne({ workspace: workspaceId, environment }); let folderId = "root"; // if folder exist get it and replace folderid with new one diff --git a/backend/src/routes/v1/secretImport.ts b/backend/src/routes/v1/secretImport.ts index 60ed16bc8..655fbd933 100644 --- a/backend/src/routes/v1/secretImport.ts +++ b/backend/src/routes/v1/secretImport.ts @@ -46,7 +46,7 @@ router.delete( body("secretImportPath").isString().exists().trim(), body("secretImportEnv").isString().exists().trim(), validateRequest, - secretImportController.updateSecretImport + secretImportController.deleteSecretImport ); router.get( diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go index 02fe16327..906723df8 100644 --- a/cli/packages/cmd/run.go +++ b/cli/packages/cmd/run.go @@ -143,13 +143,13 @@ var runCmd = &cobra.Command{ err = executeMultipleCommandWithEnvs(command, len(secretsByKey), env) if err != nil { - util.HandleError(err, "Unable to execute your chained command") + fmt.Println(err) } } else { err = executeSingleCommandWithEnvs(args, len(secretsByKey), env) if err != nil { - util.HandleError(err, "Unable to execute your single command") + fmt.Println(err) } } }, diff --git a/docs/contributing/developing.mdx b/docs/contributing/developing.mdx index 1c7708c99..bc1bc8dd5 100644 --- a/docs/contributing/developing.mdx +++ b/docs/contributing/developing.mdx @@ -82,4 +82,28 @@ Password: `testInfisical1` ```bash # To stop environment use Control+C (on Mac) CTRL+C (on Win) or docker-compose -f docker-compose.dev.yml down +``` + +## Starting Infisical docs locally + +We use [Mintlify](https://mintlify.com/) for our docs. + +#### Install Mintlify CLI. + +```bash +npm i -g mintlify +``` + +or + +```bash +yarn global add mintlify +``` + +#### Running the docs +Go to `docs` directory and run `mintlify dev`. This will start up the docs on `localhost:3000` + +```bash +# From the root directory +cd docs; mintlify dev; ``` \ No newline at end of file diff --git a/docs/documentation/platform/secret-reference.mdx b/docs/documentation/platform/secret-reference.mdx index 4192e1606..380facd94 100644 --- a/docs/documentation/platform/secret-reference.mdx +++ b/docs/documentation/platform/secret-reference.mdx @@ -45,8 +45,8 @@ To add an import, simply click on the `Add import` button and provide the enviro ![secret import change order](../../images/secret-import-add.png) The hierarchy of importing secrets is governed by a "last-one-wins" rule. This means the sequence in which you import matters - the final folder imported will override secrets from any prior folders. -Moreover, any secrets you define directly in your environment will take precedence over secrets from any imported folders. +Additionally, any secrets you define directly in your environment will override any secrets that are imported with the same name. -You can modify this sequence by dragging and rearranging the folders using the `Change Order` drag handle. +You can modify the order of folders to control overrides using the `Change Order` drag handle. ![secret import change order](../../images/secret-import-change-order.png) diff --git a/docs/integrations/platforms/kubernetes.mdx b/docs/integrations/platforms/kubernetes.mdx index 01e011f79..3d26536ba 100644 --- a/docs/integrations/platforms/kubernetes.mdx +++ b/docs/integrations/platforms/kubernetes.mdx @@ -66,12 +66,12 @@ metadata: spec: # The host that should be used to pull secrets from. If left empty, the value specified in Global configuration will be used hostAPI: https://app.infisical.com/api - resyncInterval: + resyncInterval: 60 authentication: serviceToken: serviceTokenSecretReference: secretName: service-token - secretNamespace: option + secretNamespace: default secretsScope: envSlug: dev secretsPath: "/" diff --git a/frontend/src/components/basic/dialog/AddProjectMemberDialog.tsx b/frontend/src/components/basic/dialog/AddProjectMemberDialog.tsx index 87004e0e8..e8049066b 100644 --- a/frontend/src/components/basic/dialog/AddProjectMemberDialog.tsx +++ b/frontend/src/components/basic/dialog/AddProjectMemberDialog.tsx @@ -127,7 +127,7 @@ const AddProjectMemberDialog = ({ ) : (