mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 12:29:26 +00:00
add interface for windmill request body
This commit is contained in:
@@ -1963,6 +1963,17 @@ const syncSecretsWindmill = async ({
|
|||||||
secrets: any;
|
secrets: any;
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
interface WindmilSecretUpdate {
|
||||||
|
path: string;
|
||||||
|
value: string;
|
||||||
|
is_secret: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface WindmillSecretCreate extends WindmilSecretUpdate {
|
||||||
|
description: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get secrets stored in windmill workspace
|
||||||
const { data: getSecretsRes } = await standardRequest.get(
|
const { data: getSecretsRes } = await standardRequest.get(
|
||||||
`${INTEGRATION_WINDMILL_API_URL}/w/${integration.app}/variables/list`,
|
`${INTEGRATION_WINDMILL_API_URL}/w/${integration.app}/variables/list`,
|
||||||
{
|
{
|
||||||
@@ -1977,9 +1988,9 @@ const syncSecretsWindmill = async ({
|
|||||||
const secretsResList = getSecretsRes.map((secretObj: any) => (secretObj.path));
|
const secretsResList = getSecretsRes.map((secretObj: any) => (secretObj.path));
|
||||||
|
|
||||||
// convert the secrets to [{}] format
|
// convert the secrets to [{}] format
|
||||||
const modifiedFormatForSecretInjection: any[] = [];
|
const modifiedFormatForCreateSecretInjection: WindmillSecretCreate[] = [];
|
||||||
const modifiedFormatForCreateSecretInjection: any[] = [];
|
const modifiedFormatForUpdateSecretInjection: WindmilSecretUpdate[] = [];
|
||||||
const modifiedFormatForUpdateSecretInjection: any[] = [];
|
|
||||||
Object.keys(secrets).forEach(
|
Object.keys(secrets).forEach(
|
||||||
(key) => {
|
(key) => {
|
||||||
if(key.startsWith("u/") || key.startsWith("f/")) {
|
if(key.startsWith("u/") || key.startsWith("f/")) {
|
||||||
@@ -2030,7 +2041,7 @@ const syncSecretsWindmill = async ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// create list of secrets to delete
|
// create list of secrets to delete
|
||||||
const secretsToDelete: any = [];
|
const secretsToDelete: string[] = [];
|
||||||
secretsResList.forEach((secret: string) => {
|
secretsResList.forEach((secret: string) => {
|
||||||
if(!(secret in secrets)) {
|
if(!(secret in secrets)) {
|
||||||
secretsToDelete.push(secret);
|
secretsToDelete.push(secret);
|
||||||
|
|||||||
Reference in New Issue
Block a user