mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
review fixes
This commit is contained in:
@@ -52,7 +52,7 @@ export const HCVaultSyncFns = {
|
|||||||
const variables = await listHCVaultVariables({ instanceUrl, accessToken, mount, path });
|
const variables = await listHCVaultVariables({ instanceUrl, accessToken, mount, path });
|
||||||
let tainted = false;
|
let tainted = false;
|
||||||
|
|
||||||
for await (const entry of Object.entries(secretMap)) {
|
for (const entry of Object.entries(secretMap)) {
|
||||||
const [key, { value }] = entry;
|
const [key, { value }] = entry;
|
||||||
if (value !== variables[key]) {
|
if (value !== variables[key]) {
|
||||||
variables[key] = value;
|
variables[key] = value;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import RE2 from "re2";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { SecretSyncs } from "@app/lib/api-docs";
|
import { SecretSyncs } from "@app/lib/api-docs";
|
||||||
@@ -20,8 +21,8 @@ const HCVaultSyncDestinationConfigSchema = z.object({
|
|||||||
.string()
|
.string()
|
||||||
.trim()
|
.trim()
|
||||||
.min(1, "Path required")
|
.min(1, "Path required")
|
||||||
.transform((val) => val.trim().replace(/^\/+|\/+$/g, "")) // removes leading/trailing slashes
|
.transform((val) => val.replace(/^\/+|\/+$/g, "")) // removes leading/trailing slashes
|
||||||
.refine((val) => /^([a-zA-Z0-9._-]+\/)*[a-zA-Z0-9._-]+$/.test(val), {
|
.refine((val) => new RE2("^([a-zA-Z0-9._-]+/)*[a-zA-Z0-9._-]+$").test(val), {
|
||||||
message:
|
message:
|
||||||
"Invalid Vault path format. Use alphanumerics, dots, dashes, underscores, and single slashes between segments."
|
"Invalid Vault path format. Use alphanumerics, dots, dashes, underscores, and single slashes between segments."
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ Infisical supports two methods for connecting to Hashicorp Vault.
|
|||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<Tab title="Self Hosted">
|
<Tab title="Self Hosted">
|
||||||
On self-hosted instances, simply copy your vault's base URL. (Ex. `https://vault.mycompany.com`)
|
On self-hosted instances, simply copy your vault's base URL. (Ex. `https://vault.example.com`)
|
||||||
|
|
||||||
Save this value for later steps.
|
Save this value for later steps.
|
||||||
</Tab>
|
</Tab>
|
||||||
@@ -159,7 +159,7 @@ Infisical supports two methods for connecting to Hashicorp Vault.
|
|||||||
"name": "my-vault-connection",
|
"name": "my-vault-connection",
|
||||||
"method": "app-role",
|
"method": "app-role",
|
||||||
"credentials": {
|
"credentials": {
|
||||||
"instanceUrl": "https://vault.mycompany.com",
|
"instanceUrl": "https://vault.example.com",
|
||||||
"roleId": "4797c4fa-7794-71f0-c8b1-7c87759df5bf",
|
"roleId": "4797c4fa-7794-71f0-c8b1-7c87759df5bf",
|
||||||
"secretId": "ad24df93-19c8-c865-9997-6b8513253d3a"
|
"secretId": "ad24df93-19c8-c865-9997-6b8513253d3a"
|
||||||
}
|
}
|
||||||
@@ -180,7 +180,7 @@ Infisical supports two methods for connecting to Hashicorp Vault.
|
|||||||
"app": "hashicorp-vault",
|
"app": "hashicorp-vault",
|
||||||
"method": "app-role",
|
"method": "app-role",
|
||||||
"credentials": {
|
"credentials": {
|
||||||
"instanceUrl": "https://vault.mycompany.com",
|
"instanceUrl": "https://vault.example.com",
|
||||||
"roleId": "4797c4fa-7794-71f0-c8b1-7c87759df5bf"
|
"roleId": "4797c4fa-7794-71f0-c8b1-7c87759df5bf"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ description: "Learn how to configure a Hashicorp Vault Sync for Infisical."
|
|||||||

|

|
||||||
|
|
||||||
- **Hashicorp Vault Connection**: The Vault Connection to authenticate with.
|
- **Hashicorp Vault Connection**: The Vault Connection to authenticate with.
|
||||||
- **Secrets Engine Mount**: The Secrets Engine Mount to sync secrets to.
|
- **Secrets Engine Mount**: The type of secrets engine to use (e.g., 'secret', 'kv').
|
||||||
- **Path**: The Secrets Engine Mount path to sync secrets to.
|
- **Path**: The specific path within the secrets engine where secrets will be stored.
|
||||||
|
|
||||||
After configuring these parameters, click the **Next** button to continue to the Sync Options step.
|
After configuring these parameters, click the **Next** button to continue to the Sync Options step.
|
||||||
</Step>
|
</Step>
|
||||||
@@ -80,24 +80,24 @@ description: "Learn how to configure a Hashicorp Vault Sync for Infisical."
|
|||||||
|
|
||||||
```bash Request
|
```bash Request
|
||||||
curl --request POST \
|
curl --request POST \
|
||||||
--url https://app.infisical.com/api/v1/secret-syncs/hashicorp-vault \
|
--url https://app.infisical.com/api/v1/secret-syncs/hashicorp-vault \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data '{
|
--data '{
|
||||||
"name": "my-vault-sync",
|
"name": "my-vault-sync",
|
||||||
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||||
"description": "an example sync",
|
"description": "an example sync",
|
||||||
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||||
"environment": "dev",
|
"environment": "dev",
|
||||||
"secretPath": "/",
|
"secretPath": "/",
|
||||||
"isEnabled": true,
|
"isEnabled": true,
|
||||||
"syncOptions": {
|
"syncOptions": {
|
||||||
"initialSyncBehavior": "overwrite-destination"
|
"initialSyncBehavior": "overwrite-destination"
|
||||||
},
|
},
|
||||||
"destinationConfig": {
|
"destinationConfig": {
|
||||||
"mount": "secret",
|
"mount": "secret",
|
||||||
"path": "dev/nested"
|
"path": "dev/nested"
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Sample response
|
### Sample response
|
||||||
|
|||||||
+1
@@ -29,6 +29,7 @@ export const HCVaultSyncFields = () => {
|
|||||||
<SecretSyncConnectionField
|
<SecretSyncConnectionField
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
setValue("destinationConfig.mount", "");
|
setValue("destinationConfig.mount", "");
|
||||||
|
setValue("destinationConfig.path", "");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -122,7 +122,7 @@ export const HCVaultConnectionForm = ({ appConnection, onSubmit }: Props) => {
|
|||||||
tooltipClassName="max-w-sm"
|
tooltipClassName="max-w-sm"
|
||||||
tooltipText="The URL at which your Hashicorp Vault instance is hosted."
|
tooltipText="The URL at which your Hashicorp Vault instance is hosted."
|
||||||
>
|
>
|
||||||
<Input {...field} placeholder="https://vault.mycompany.com" />
|
<Input {...field} placeholder="https://vault.example.com" />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user