Merge branch 'main' into feat/azureClientSecretsRotation

This commit is contained in:
carlosmonastyrski
2025-04-21 10:27:56 -03:00
175 changed files with 2608 additions and 249 deletions
@@ -12,5 +12,6 @@ export enum AppConnection {
Postgres = "postgres",
MsSql = "mssql",
Camunda = "camunda",
Windmill = "windmill",
Auth0 = "auth0"
}
@@ -64,6 +64,10 @@ export type TCamundaConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Camunda;
};
export type TWindmillConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Windmill;
};
export type TAuth0ConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Auth0;
};
@@ -82,6 +86,7 @@ export type TAppConnectionOption =
| TPostgresConnectionOption
| TMsSqlConnectionOption
| TCamundaConnectionOption
| TWindmillConnectionOption
| TAuth0ConnectionOption;
export type TAppConnectionOptionMap = {
@@ -98,5 +103,6 @@ export type TAppConnectionOptionMap = {
[AppConnection.Postgres]: TPostgresConnectionOption;
[AppConnection.MsSql]: TMsSqlConnectionOption;
[AppConnection.Camunda]: TCamundaConnectionOption;
[AppConnection.Windmill]: TWindmillConnectionOption;
[AppConnection.Auth0]: TAuth0ConnectionOption;
};
@@ -14,6 +14,7 @@ import { TMsSqlConnection } from "./mssql-connection";
import { TPostgresConnection } from "./postgres-connection";
import { TTerraformCloudConnection } from "./terraform-cloud-connection";
import { TVercelConnection } from "./vercel-connection";
import { TWindmillConnection } from "./windmill-connection";
export * from "./auth0-connection";
export * from "./aws-connection";
@@ -29,6 +30,7 @@ export * from "./mssql-connection";
export * from "./postgres-connection";
export * from "./terraform-cloud-connection";
export * from "./vercel-connection";
export * from "./windmill-connection";
export type TAppConnection =
| TAwsConnection
@@ -44,6 +46,7 @@ export type TAppConnection =
| TPostgresConnection
| TMsSqlConnection
| TCamundaConnection
| TWindmillConnection
| TAuth0Connection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id">;
@@ -85,5 +88,6 @@ export type TAppConnectionMap = {
[AppConnection.MsSql]: TMsSqlConnection;
[AppConnection.Camunda]: TCamundaConnection;
[AppConnection.AzureClientSecrets]: TAzureClientSecretsConnection;
[AppConnection.Windmill]: TWindmillConnection;
[AppConnection.Auth0]: TAuth0Connection;
};
@@ -0,0 +1,14 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum WindmillConnectionMethod {
AccessToken = "access-token"
}
export type TWindmillConnection = TRootAppConnection & { app: AppConnection.Windmill } & {
method: WindmillConnectionMethod.AccessToken;
credentials: {
accessToken: string;
instanceUrl?: string;
};
};
@@ -0,0 +1,2 @@
export * from "./queries";
export * from "./types";
@@ -0,0 +1,37 @@
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { appConnectionKeys } from "../queries";
import { TWindmillWorkspace } from "./types";
const windmillConnectionKeys = {
all: [...appConnectionKeys.all, "windmill"] as const,
listWorkspaces: (connectionId: string) =>
[...windmillConnectionKeys.all, "workspaces", connectionId] as const
};
export const useWindmillConnectionListWorkspaces = (
connectionId: string,
options?: Omit<
UseQueryOptions<
TWindmillWorkspace[],
unknown,
TWindmillWorkspace[],
ReturnType<typeof windmillConnectionKeys.listWorkspaces>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: windmillConnectionKeys.listWorkspaces(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<TWindmillWorkspace[]>(
`/api/v1/app-connections/windmill/${connectionId}/workspaces`
);
return data;
},
...options
});
};
@@ -0,0 +1,4 @@
export type TWindmillWorkspace = {
id: string;
name: string;
};
@@ -4,6 +4,7 @@ import { apiRequest } from "@app/config/request";
import { organizationKeys } from "../organization/queries";
import { oidcConfigKeys } from "./queries";
import { OIDCJWTSignatureAlgorithm } from "./types";
export const useUpdateOIDCConfig = () => {
const queryClient = useQueryClient();
@@ -21,7 +22,8 @@ export const useUpdateOIDCConfig = () => {
clientSecret,
isActive,
orgSlug,
manageGroupMemberships
manageGroupMemberships,
jwtSignatureAlgorithm
}: {
allowedEmailDomains?: string;
issuer?: string;
@@ -36,6 +38,7 @@ export const useUpdateOIDCConfig = () => {
configurationType?: string;
orgSlug: string;
manageGroupMemberships?: boolean;
jwtSignatureAlgorithm?: OIDCJWTSignatureAlgorithm;
}) => {
const { data } = await apiRequest.patch("/api/v1/sso/oidc/config", {
issuer,
@@ -50,7 +53,8 @@ export const useUpdateOIDCConfig = () => {
orgSlug,
clientSecret,
isActive,
manageGroupMemberships
manageGroupMemberships,
jwtSignatureAlgorithm
});
return data;
@@ -78,7 +82,8 @@ export const useCreateOIDCConfig = () => {
clientSecret,
isActive,
orgSlug,
manageGroupMemberships
manageGroupMemberships,
jwtSignatureAlgorithm
}: {
issuer?: string;
configurationType: string;
@@ -93,6 +98,7 @@ export const useCreateOIDCConfig = () => {
orgSlug: string;
allowedEmailDomains?: string;
manageGroupMemberships?: boolean;
jwtSignatureAlgorithm?: OIDCJWTSignatureAlgorithm;
}) => {
const { data } = await apiRequest.post("/api/v1/sso/oidc/config", {
issuer,
@@ -107,7 +113,8 @@ export const useCreateOIDCConfig = () => {
clientSecret,
isActive,
orgSlug,
manageGroupMemberships
manageGroupMemberships,
jwtSignatureAlgorithm
});
return data;
@@ -13,4 +13,11 @@ export type OIDCConfigData = {
clientSecret: string;
allowedEmailDomains?: string;
manageGroupMemberships: boolean;
jwtSignatureAlgorithm: OIDCJWTSignatureAlgorithm;
};
export enum OIDCJWTSignatureAlgorithm {
RS256 = "RS256",
HS256 = "HS256",
RS512 = "RS512"
}
@@ -110,7 +110,8 @@ export const useUpdateOrg = () => {
defaultMembershipRoleSlug,
enforceMfa,
selectedMfaMethod,
allowSecretSharingOutsideOrganization
allowSecretSharingOutsideOrganization,
bypassOrgAuthEnabled
}) => {
return apiRequest.patch(`/api/v1/organization/${orgId}`, {
name,
@@ -120,7 +121,8 @@ export const useUpdateOrg = () => {
defaultMembershipRoleSlug,
enforceMfa,
selectedMfaMethod,
allowSecretSharingOutsideOrganization
allowSecretSharingOutsideOrganization,
bypassOrgAuthEnabled
});
},
onSuccess: () => {
@@ -9,6 +9,7 @@ export type Organization = {
createAt: string;
updatedAt: string;
authEnforced: boolean;
bypassOrgAuthEnabled: boolean;
orgAuthMethod: string;
scimEnabled: boolean;
slug: string;
@@ -17,6 +18,7 @@ export type Organization = {
selectedMfaMethod?: MfaMethod;
shouldUseNewPrivilegeSystem: boolean;
allowSecretSharingOutsideOrganization?: boolean;
userRole: string;
};
export type UpdateOrgDTO = {
@@ -29,6 +31,7 @@ export type UpdateOrgDTO = {
enforceMfa?: boolean;
selectedMfaMethod?: MfaMethod;
allowSecretSharingOutsideOrganization?: boolean;
bypassOrgAuthEnabled?: boolean;
};
export type BillingDetails = {
+2 -1
View File
@@ -9,7 +9,8 @@ export enum SecretSync {
Humanitec = "humanitec",
TerraformCloud = "terraform-cloud",
Camunda = "camunda",
Vercel = "vercel"
Vercel = "vercel",
Windmill = "windmill"
}
export enum SecretSyncStatus {
@@ -1,17 +1,18 @@
import { SecretSync, SecretSyncImportBehavior } from "@app/hooks/api/secretSyncs";
import { TAwsParameterStoreSync } from "@app/hooks/api/secretSyncs/types/aws-parameter-store-sync";
import { TDatabricksSync } from "@app/hooks/api/secretSyncs/types/databricks-sync";
import { TGitHubSync } from "@app/hooks/api/secretSyncs/types/github-sync";
import { DiscriminativePick } from "@app/types";
import { TAwsParameterStoreSync } from "./aws-parameter-store-sync";
import { TAwsSecretsManagerSync } from "./aws-secrets-manager-sync";
import { TAzureAppConfigurationSync } from "./azure-app-configuration-sync";
import { TAzureKeyVaultSync } from "./azure-key-vault-sync";
import { TCamundaSync } from "./camunda-sync";
import { TDatabricksSync } from "./databricks-sync";
import { TGcpSync } from "./gcp-sync";
import { TGitHubSync } from "./github-sync";
import { THumanitecSync } from "./humanitec-sync";
import { TTerraformCloudSync } from "./terraform-cloud-sync";
import { TVercelSync } from "./vercel-sync";
import { TWindmillSync } from "./windmill-sync";
export type TSecretSyncOption = {
name: string;
@@ -30,7 +31,8 @@ export type TSecretSync =
| THumanitecSync
| TTerraformCloudSync
| TCamundaSync
| TVercelSync;
| TVercelSync
| TWindmillSync;
export type TListSecretSyncs = { secretSyncs: TSecretSync[] };
@@ -0,0 +1,16 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { SecretSync } from "@app/hooks/api/secretSyncs";
import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
export type TWindmillSync = TRootSecretSync & {
destination: SecretSync.Windmill;
destinationConfig: {
workspace: string;
path: string;
};
connection: {
app: AppConnection.Windmill;
name: string;
id: string;
};
};
+22 -2
View File
@@ -33,6 +33,7 @@ import {
TGetUpgradeProjectStatusDTO,
TListProjectIdentitiesDTO,
ToggleAutoCapitalizationDTO,
ToggleDeleteProjectProtectionDTO,
TSearchProjectsDTO,
TUpdateWorkspaceIdentityRoleDTO,
TUpdateWorkspaceUserRoleDTO,
@@ -306,6 +307,25 @@ export const useToggleAutoCapitalization = () => {
});
};
export const useToggleDeleteProjectProtection = () => {
const queryClient = useQueryClient();
return useMutation<Workspace, object, ToggleDeleteProjectProtectionDTO>({
mutationFn: async ({ workspaceID, state }) => {
const { data } = await apiRequest.post<{ workspace: Workspace }>(
`/api/v1/workspace/${workspaceID}/delete-protection`,
{
hasDeleteProtection: state
}
);
return data.workspace;
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace() });
}
});
};
export const useUpdateWorkspaceVersionLimit = () => {
const queryClient = useQueryClient();
@@ -316,8 +336,8 @@ export const useUpdateWorkspaceVersionLimit = () => {
});
return data.workspace;
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace() });
onSuccess: (dto) => {
queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace(dto.type) });
}
});
};
@@ -36,6 +36,7 @@ export type Workspace = {
slug: string;
createdAt: string;
roles?: TProjectRole[];
hasDeleteProtection: boolean;
};
export type WorkspaceEnv = {
@@ -80,6 +81,7 @@ export type UpdateProjectDTO = {
export type UpdatePitVersionLimitDTO = { projectSlug: string; pitVersionLimit: number };
export type UpdateAuditLogsRetentionDTO = { projectSlug: string; auditLogsRetentionDays: number };
export type ToggleAutoCapitalizationDTO = { workspaceID: string; state: boolean };
export type ToggleDeleteProjectProtectionDTO = { workspaceID: string; state: boolean };
export type DeleteWorkspaceDTO = { workspaceID: string };