feature secret rotations v2

This commit is contained in:
Scott Wilson
2025-03-31 20:34:48 -07:00
parent da094383b8
commit 766c1242fd
275 changed files with 9692 additions and 783 deletions
@@ -1,4 +1,4 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { Badge } from "@app/components/v2";
import { AWS_REGIONS } from "@app/helpers/appConnections";
import { TAwsParameterStoreSync } from "@app/hooks/api/secretSyncs/types/aws-parameter-store-sync";
@@ -16,13 +16,13 @@ export const AwsParameterStoreSyncDestinationSection = ({ secretSync }: Props) =
return (
<>
<SecretSyncLabel label="Region">
<GenericFieldLabel label="Region">
{awsRegion?.name}
<Badge className="ml-1" variant="success">
{awsRegion?.slug}{" "}
</Badge>
</SecretSyncLabel>
<SecretSyncLabel label="Path">{path}</SecretSyncLabel>
</GenericFieldLabel>
<GenericFieldLabel label="Path">{path}</GenericFieldLabel>
</>
);
};
@@ -1,4 +1,4 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { Badge } from "@app/components/v2";
import { AWS_REGIONS } from "@app/helpers/appConnections";
import {
@@ -17,17 +17,17 @@ export const AwsSecretsManagerSyncDestinationSection = ({ secretSync }: Props) =
return (
<>
<SecretSyncLabel label="Region">
<GenericFieldLabel label="Region">
{awsRegion?.name}
<Badge className="ml-1" variant="success">
{awsRegion?.slug}{" "}
</Badge>
</SecretSyncLabel>
<SecretSyncLabel label="Mapping Behavior" className="capitalize">
</GenericFieldLabel>
<GenericFieldLabel label="Mapping Behavior" className="capitalize">
{destinationConfig.mappingBehavior}
</SecretSyncLabel>
</GenericFieldLabel>
{destinationConfig.mappingBehavior === AwsSecretsManagerSyncMappingBehavior.ManyToOne && (
<SecretSyncLabel label="Secret Name">{destinationConfig.secretName}</SecretSyncLabel>
<GenericFieldLabel label="Secret Name">{destinationConfig.secretName}</GenericFieldLabel>
)}
</>
);
@@ -1,4 +1,4 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { TAzureAppConfigurationSync } from "@app/hooks/api/secretSyncs/types/azure-app-configuration-sync";
type Props = {
@@ -12,8 +12,8 @@ export const AzureAppConfigurationSyncDestinationSection = ({ secretSync }: Prop
return (
<>
<SecretSyncLabel label="Configuration URL">{configurationUrl}</SecretSyncLabel>
<SecretSyncLabel label="Label">{label}</SecretSyncLabel>
<GenericFieldLabel label="Configuration URL">{configurationUrl}</GenericFieldLabel>
<GenericFieldLabel label="Label">{label}</GenericFieldLabel>
</>
);
};
@@ -1,4 +1,4 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { TAzureKeyVaultSync } from "@app/hooks/api/secretSyncs/types/azure-key-vault-sync";
type Props = {
@@ -10,5 +10,5 @@ export const AzureKeyVaultSyncDestinationSection = ({ secretSync }: Props) => {
destinationConfig: { vaultBaseUrl }
} = secretSync;
return <SecretSyncLabel label="Vault URL">{vaultBaseUrl}</SecretSyncLabel>;
return <GenericFieldLabel label="Vault URL">{vaultBaseUrl}</GenericFieldLabel>;
};
@@ -1,4 +1,4 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { TDatabricksSync } from "@app/hooks/api/secretSyncs/types/databricks-sync";
type Props = {
@@ -10,5 +10,5 @@ export const DatabricksSyncDestinationSection = ({ secretSync }: Props) => {
destinationConfig: { scope }
} = secretSync;
return <SecretSyncLabel label="Secret Scope">{scope}</SecretSyncLabel>;
return <GenericFieldLabel label="Secret Scope">{scope}</GenericFieldLabel>;
};
@@ -1,4 +1,4 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { TGcpSync } from "@app/hooks/api/secretSyncs/types/gcp-sync";
type Props = {
@@ -10,5 +10,5 @@ export const GcpSyncDestinationSection = ({ secretSync }: Props) => {
destinationConfig: { projectId }
} = secretSync;
return <SecretSyncLabel label="Project ID">{projectId}</SecretSyncLabel>;
return <GenericFieldLabel label="Project ID">{projectId}</GenericFieldLabel>;
};
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { GitHubSyncSelectedRepositoriesTooltipContent } from "@app/components/secret-syncs/github";
import { Tooltip } from "@app/components/v2";
import {
@@ -23,12 +23,12 @@ export const GitHubSyncDestinationSection = ({ secretSync }: Props) => {
case GitHubSyncScope.Organization:
Components = (
<>
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
<SecretSyncLabel label="Visibility" className="capitalize">
<GenericFieldLabel label="Organization">{destinationConfig.org}</GenericFieldLabel>
<GenericFieldLabel label="Visibility" className="capitalize">
{destinationConfig.visibility} Repositories
</SecretSyncLabel>
</GenericFieldLabel>
{destinationConfig.visibility === GitHubSyncVisibility.Selected && (
<SecretSyncLabel label="Selected Repositories">
<GenericFieldLabel label="Selected Repositories">
{destinationConfig.selectedRepositoryIds?.length ?? 0} Repositories
<Tooltip
side="bottom"
@@ -36,25 +36,25 @@ export const GitHubSyncDestinationSection = ({ secretSync }: Props) => {
>
<FontAwesomeIcon size="xs" className="ml-1 text-bunker-300" icon={faInfoCircle} />
</Tooltip>
</SecretSyncLabel>
</GenericFieldLabel>
)}
</>
);
break;
case GitHubSyncScope.Repository:
Components = (
<SecretSyncLabel label="Repository">
<GenericFieldLabel label="Repository">
{destinationConfig.owner}/{destinationConfig.repo}
</SecretSyncLabel>
</GenericFieldLabel>
);
break;
case GitHubSyncScope.RepositoryEnvironment:
Components = (
<>
<SecretSyncLabel label="Repository">
<GenericFieldLabel label="Repository">
{destinationConfig.owner}/{destinationConfig.repo}
</SecretSyncLabel>
<SecretSyncLabel label="Environment">{destinationConfig.env}</SecretSyncLabel>
</GenericFieldLabel>
<GenericFieldLabel label="Environment">{destinationConfig.env}</GenericFieldLabel>
</>
);
break;
@@ -66,9 +66,9 @@ export const GitHubSyncDestinationSection = ({ secretSync }: Props) => {
return (
<>
<SecretSyncLabel className="capitalize" label="Scope">
<GenericFieldLabel className="capitalize" label="Scope">
{destinationConfig.scope.replace("-", " ")}
</SecretSyncLabel>
</GenericFieldLabel>
{Components}
</>
);
@@ -1,6 +1,6 @@
import { ReactNode } from "react";
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import {
HumanitecSyncScope,
THumanitecSync
@@ -18,17 +18,17 @@ export const HumanitecSyncDestinationSection = ({ secretSync }: Props) => {
case HumanitecSyncScope.Application:
Components = (
<>
<SecretSyncLabel label="Application">{destinationConfig.app}</SecretSyncLabel>
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
<GenericFieldLabel label="Application">{destinationConfig.app}</GenericFieldLabel>
<GenericFieldLabel label="Organization">{destinationConfig.org}</GenericFieldLabel>
</>
);
break;
case HumanitecSyncScope.Environment:
Components = (
<>
<SecretSyncLabel label="Application">{destinationConfig.app}</SecretSyncLabel>
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
<SecretSyncLabel label="Environment">{destinationConfig.env}</SecretSyncLabel>
<GenericFieldLabel label="Application">{destinationConfig.app}</GenericFieldLabel>
<GenericFieldLabel label="Organization">{destinationConfig.org}</GenericFieldLabel>
<GenericFieldLabel label="Environment">{destinationConfig.env}</GenericFieldLabel>
</>
);
break;
@@ -40,9 +40,9 @@ export const HumanitecSyncDestinationSection = ({ secretSync }: Props) => {
return (
<>
<SecretSyncLabel className="capitalize" label="Scope">
<GenericFieldLabel className="capitalize" label="Scope">
{destinationConfig.scope.replace("-", " ")}
</SecretSyncLabel>
</GenericFieldLabel>
{Components}
</>
);
@@ -3,7 +3,7 @@ import { faEdit } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { ProjectPermissionCan } from "@app/components/permissions";
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { GenericFieldLabel } from "@app/components/secret-syncs";
import { IconButton } from "@app/components/v2";
import { ProjectPermissionSub } from "@app/context";
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
@@ -83,7 +83,7 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
</ProjectPermissionCan>
</div>
<div className="flex w-full flex-wrap gap-8">
<SecretSyncLabel label={`${app} Connection`}>{connection.name}</SecretSyncLabel>
<GenericFieldLabel label={`${app} Connection`}>{connection.name}</GenericFieldLabel>
{DestinationComponents}
</div>
</div>