Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: display aws connection credentials error and sync status on details page

Scott Wilson81420198cbec
diff --git a/backend/src/services/app-connection/aws/aws-connection-fns.ts b/backend/src/services/app-connection/aws/aws-connection-fns.ts
index d814215298..8877295020 100644
--- a/backend/src/services/app-connection/aws/aws-connection-fns.ts
+++ b/backend/src/services/app-connection/aws/aws-connection-fns.ts
@@ -81,11 +81,14 @@ export const getAwsConnectionConfig = async (appConnection: TAwsConnectionConfig
};
export const validateAwsConnectionCredentials = async (appConnection: TAwsConnectionConfig) => {
- const awsConfig = await getAwsConnectionConfig(appConnection);
- const sts = new AWS.STS(awsConfig);
- let resp: Awaited<ReturnType<ReturnType<typeof sts.getCallerIdentity>["promise"]>>;
+ let resp: AWS.STS.GetCallerIdentityResponse & {
+ $response: AWS.Response<AWS.STS.GetCallerIdentityResponse, AWS.AWSError>;
+ };
try {
+ const awsConfig = await getAwsConnectionConfig(appConnection);
+ const sts = new AWS.STS(awsConfig);
+
resp = await sts.getCallerIdentity().promise();
} catch (e: unknown) {
throw new BadRequestError({
@@ -93,7 +96,7 @@ export const validateAwsConnectionCredentials = async (appConnection: TAwsConnec
});
}
- if (resp.$response.httpResponse.statusCode !== 200)
+ if (resp?.$response.httpResponse.statusCode !== 200)
throw new InternalServerError({
message: `Unable to validate credentials: ${
resp.$response.error?.message ??
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncsTable.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncsTable.tsx
index a5e7d270d4..fefb1ad41e 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncsTable.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncTable/SecretSyncsTable.tsx
@@ -289,34 +289,36 @@ export const SecretSyncsTable = ({ secretSyncs }: Props) => {
</DropdownMenuTrigger>
<DropdownMenuContent className="thin-scrollbar max-h-[70vh] overflow-y-auto" align="end">
<DropdownMenuLabel>Status</DropdownMenuLabel>
- {Object.values(SecretSyncStatus).map((status) => (
- <DropdownMenuItem
- onClick={(e) => {
- e.preventDefault();
- setFilters((prev) => ({
- ...prev,
- status: prev.status.includes(status)
- ? prev.status.filter((s) => s !== status)
- : [...prev.status, status]
- }));
- }}
- key={status}
- icon={
- filters.status.includes(status) && (
- <FontAwesomeIcon className="text-primary" icon={faCheckCircle} />
- )
- }
- iconPos="right"
- >
- <div className="flex items-center gap-2">
- <FontAwesomeIcon
- icon={STATUS_ICON_MAP[status].icon}
- className={STATUS_ICON_MAP[status].className}
- />
- <span className="capitalize">{STATUS_ICON_MAP[status].name}</span>
- </div>
- </DropdownMenuItem>
- ))}
+ {[SecretSyncStatus.Running, SecretSyncStatus.Succeeded, SecretSyncStatus.Failed].map(
+ (status) => (
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.preventDefault();
+ setFilters((prev) => ({
+ ...prev,
+ status: prev.status.includes(status)
+ ? prev.status.filter((s) => s !== status)
+ : [...prev.status, status]
+ }));
+ }}
+ key={status}
+ icon={
+ filters.status.includes(status) && (
+ <FontAwesomeIcon className="text-primary" icon={faCheckCircle} />
+ )
+ }
+ iconPos="right"
+ >
+ <div className="flex items-center gap-2">
+ <FontAwesomeIcon
+ icon={STATUS_ICON_MAP[status].icon}
+ className={STATUS_ICON_MAP[status].className}
+ />
+ <span className="capitalize">{STATUS_ICON_MAP[status].name}</span>
+ </div>
+ </DropdownMenuItem>
+ )
+ )}
<DropdownMenuLabel>Service</DropdownMenuLabel>
{secretSyncs.length ? (
[...new Set(secretSyncs.map(({ destination }) => destination))].map((destination) => {
diff --git a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDetailsSection.tsx b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDetailsSection.tsx
index 5491d53ab4..609780362b 100644
--- a/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDetailsSection.tsx
+++ b/frontend/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDetailsSection.tsx
@@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { format } from "date-fns";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { SecretSyncLabel } from "@app/components/secret-syncs";
+import { SecretSyncLabel, SecretSyncStatusBadge } from "@app/components/secret-syncs";
import { IconButton } from "@app/components/v2";
import { ProjectPermissionSub } from "@app/context";
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
@@ -57,6 +57,11 @@ export const SecretSyncDetailsSection = ({ secretSync, onEditDetails }: Props) =
<div className="space-y-3">
<SecretSyncLabel label="Name">{name}</SecretSyncLabel>
<SecretSyncLabel label="Description">{description}</SecretSyncLabel>
+ {syncStatus && (
+ <SecretSyncLabel label="Status">
+ <SecretSyncStatusBadge status={syncStatus} />
+ </SecretSyncLabel>
+ )}
{lastSyncedAt && (
<SecretSyncLabel label="Last Synced">
{format(new Date(lastSyncedAt), "yyyy-MM-dd, hh:mm aaa")}