improvements: address feedback

This commit is contained in:
Scott Wilson
2025-04-16 15:28:29 -07:00
parent 875ec6a24e
commit d9bd1ac878
8 changed files with 26 additions and 16 deletions
+1 -1
View File
@@ -1803,7 +1803,7 @@ export const AppConnections = {
clientSecret: "The client secret used to authenticate with Camunda." clientSecret: "The client secret used to authenticate with Camunda."
}, },
WINDMILL: { WINDMILL: {
instanceUrl: "The Windmill instance URL to connect with (defaults to https://dev.windmill.app).", instanceUrl: "The Windmill instance URL to connect with (defaults to https://app.windmill.dev).",
accessToken: "The access token to use to connect with Windmill." accessToken: "The access token to use to connect with Windmill."
} }
} }
@@ -44,7 +44,7 @@ export const ValidateWindmillConnectionCredentialsSchema = z.discriminatedUnion(
z.object({ z.object({
method: z method: z
.literal(WindmillConnectionMethod.AccessToken) .literal(WindmillConnectionMethod.AccessToken)
.describe(AppConnections?.CREATE(AppConnection.Windmill).method), .describe(AppConnections.CREATE(AppConnection.Windmill).method),
credentials: WindmillConnectionAccessTokenCredentialsSchema.describe( credentials: WindmillConnectionAccessTokenCredentialsSchema.describe(
AppConnections.CREATE(AppConnection.Windmill).credentials AppConnections.CREATE(AppConnection.Windmill).credentials
) )
@@ -36,11 +36,11 @@ const listWindmillVariables = async ({ instanceUrl, workspace, accessToken, path
} }
); );
// eslint-disable-next-line no-await-in-loop for (const variable of variablesPage) {
for await (const variable of variablesPage) {
const variableName = variable.path.replace(path, ""); const variableName = variable.path.replace(path, "");
if (variable.is_secret) { if (variable.is_secret) {
// eslint-disable-next-line no-await-in-loop
const { data: variableValue } = await request.get<string>( const { data: variableValue } = await request.get<string>(
`${instanceUrl}/api/w/${workspace}/variables/get_value/${variable.path}`, `${instanceUrl}/api/w/${workspace}/variables/get_value/${variable.path}`,
{ {
@@ -30,9 +30,9 @@ const WindmillSyncDestinationConfigSchema = z.object({
val.split("/").length >= 3 && val.split("/").length >= 3 &&
val val
.split("/") .split("/")
.filter(Boolean) .slice(0, -1) // Remove last empty segment from trailing slash
.every((segment) => pathCharacterValidator(segment)), .every((segment) => segment && pathCharacterValidator(segment)),
'Invalid path - must follow Windmill path format. ex: "/f/folder/path/"' 'Invalid path - must follow Windmill path format. ex: "f/folder/path/"'
) )
.describe(SecretSyncs.DESTINATION_CONFIG.WINDMILL.path) .describe(SecretSyncs.DESTINATION_CONFIG.WINDMILL.path)
}); });
+12 -2
View File
@@ -7,8 +7,18 @@ Infisical supports connecting to Windmill using an **Access Token** to securely
## Get a Windmill Access Token ## Get a Windmill Access Token
Ensure the user generating the access token has the required role and permissions based on your use-case:
<Tabs>
<Tab title="Secret Sync">
<Note>
The user generating the access token should be at least a `Developer` in the configured workspace and have `write` permissions for the workspace path secrets will be synced to.
</Note>
</Tab>
</Tabs>
<Steps> <Steps>
<Step title="Navigate to Account Setting"> <Step title="Navigate to Account Settings">
In Windmill, click on your user in the sidebar and select **Account Settings**. In Windmill, click on your user in the sidebar and select **Account Settings**.
![Windmill Account Settings](/images/app-connections/windmill/windmill-account-settings.png) ![Windmill Account Settings](/images/app-connections/windmill/windmill-account-settings.png)
</Step> </Step>
@@ -25,7 +35,7 @@ Infisical supports connecting to Windmill using an **Access Token** to securely
</Step> </Step>
<Step title="Copy Access Token"> <Step title="Copy Access Token">
Copy your new access token and save it for the steps below. Copy your new access token and save it for the steps below.
![Windmill Create Token](/images/app-connections/windmill/windmill-copy-token.png) ![Windmill Copy Token](/images/app-connections/windmill/windmill-copy-token.png)
</Step> </Step>
</Steps> </Steps>
+2 -2
View File
@@ -6,7 +6,7 @@ description: "Learn how to configure a Windmill Sync for Infisical."
**Prerequisites:** **Prerequisites:**
- Set up and add secrets to [Infisical Cloud](https://app.infisical.com) - Set up and add secrets to [Infisical Cloud](https://app.infisical.com)
- Create a [Windmill Connection](/integrations/app-connections/windmill) - Create a [Windmill Connection](/integrations/app-connections/windmill) with the required **Secret Sync** permissions
<Tabs> <Tabs>
<Tab title="Infisical UI"> <Tab title="Infisical UI">
@@ -42,7 +42,7 @@ description: "Learn how to configure a Windmill Sync for Infisical."
- **Initial Sync Behavior**: Determines how Infisical should resolve the initial sync. - **Initial Sync Behavior**: Determines how Infisical should resolve the initial sync.
- **Overwrite Destination Secrets**: Removes any secrets at the destination endpoint not present in Infisical. - **Overwrite Destination Secrets**: Removes any secrets at the destination endpoint not present in Infisical.
- **Import Secrets (Prioritize Infisical)**: Imports secrets from the destination endpoint before syncing, prioritizing values from Infisical over Vercel when keys conflict. - **Import Secrets (Prioritize Infisical)**: Imports secrets from the destination endpoint before syncing, prioritizing values from Infisical over Windmill when keys conflict.
- **Import Secrets (Prioritize Windmill)**: Imports secrets from the destination endpoint before syncing, prioritizing values from Windmill over Infisical when keys conflict. - **Import Secrets (Prioritize Windmill)**: Imports secrets from the destination endpoint before syncing, prioritizing values from Windmill over Infisical when keys conflict.
- **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only. - **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.
- **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical. - **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical.
@@ -72,6 +72,8 @@ export const WindmillSyncFields = () => {
)} )}
/> />
<Controller <Controller
name="destinationConfig.path"
control={control}
render={({ field: { value, onChange }, fieldState: { error } }) => ( render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl <FormControl
tooltipClassName="max-w-sm" tooltipClassName="max-w-sm"
@@ -97,8 +99,6 @@ export const WindmillSyncFields = () => {
<Input value={value} onChange={onChange} placeholder="f/folder-name/" /> <Input value={value} onChange={onChange} placeholder="f/folder-name/" />
</FormControl> </FormControl>
)} )}
control={control}
name="destinationConfig.path"
/> />
</> </>
); );
@@ -7,14 +7,14 @@ export const WindmillSyncDestinationSchema = BaseSecretSyncSchema().merge(
z.object({ z.object({
destination: z.literal(SecretSync.Windmill), destination: z.literal(SecretSync.Windmill),
destinationConfig: z.object({ destinationConfig: z.object({
workspace: z.string().trim().min(1, "Project required"), workspace: z.string().trim().min(1, "Workspace required"),
path: z path: z
.string() .string()
.trim() .trim()
.min(1, "Project required") .min(1, "Path required")
.regex( .regex(
/^([uf])\/([a-zA-Z0-9_-]+)(\/[a-zA-Z0-9_-]+)*\/$/, /^([uf])\/([a-zA-Z0-9_-]+)(\/[a-zA-Z0-9_-]+)*\/$/,
'Invalid path - must follow Windmill path format. ex: "/f/folder/path/"' 'Invalid path - must follow Windmill path format. ex: "f/folder/path/"'
) )
}) })
}) })