mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 12:38:36 +00:00
feature: add support for kms key, tags, and syncing secret metadata to aws parameter store sync
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
export * from "./queries";
|
||||
export * from "./types";
|
||||
@@ -0,0 +1,42 @@
|
||||
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
import { appConnectionKeys } from "@app/hooks/api/appConnections";
|
||||
|
||||
import {
|
||||
TAwsConnectionKmsKey,
|
||||
TAwsConnectionListKmsKeysResponse,
|
||||
TListAwsConnectionKmsKeys
|
||||
} from "./types";
|
||||
|
||||
const awsConnectionKeys = {
|
||||
all: [...appConnectionKeys.all, "aws"] as const,
|
||||
listKmsKeys: (params: TListAwsConnectionKmsKeys) =>
|
||||
[...awsConnectionKeys.all, "kms-keys", params] as const
|
||||
};
|
||||
|
||||
export const useListAwsConnectionKmsKeys = (
|
||||
{ connectionId, ...params }: TListAwsConnectionKmsKeys,
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
TAwsConnectionKmsKey[],
|
||||
unknown,
|
||||
TAwsConnectionKmsKey[],
|
||||
ReturnType<typeof awsConnectionKeys.listKmsKeys>
|
||||
>,
|
||||
"queryKey" | "queryFn"
|
||||
>
|
||||
) => {
|
||||
return useQuery({
|
||||
queryKey: awsConnectionKeys.listKmsKeys({ connectionId, ...params }),
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.get<TAwsConnectionListKmsKeysResponse>(
|
||||
`/api/v1/app-connections/aws/${connectionId}/kms-keys`,
|
||||
{ params }
|
||||
);
|
||||
|
||||
return data.kmsKeys;
|
||||
},
|
||||
...options
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import { SecretSync } from "@app/hooks/api/secretSyncs";
|
||||
|
||||
export type TDatabricksSecretScope = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type TDatabricksConnectionListSecretScopesResponse = {
|
||||
secretScopes: TDatabricksSecretScope[];
|
||||
};
|
||||
|
||||
export type TListAwsConnectionKmsKeys = {
|
||||
connectionId: string;
|
||||
region: string;
|
||||
destination: SecretSync.AWSParameterStore | SecretSync.AWSSecretsManager;
|
||||
};
|
||||
|
||||
export type TAwsConnectionKmsKey = {
|
||||
alias: string;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type TAwsConnectionListKmsKeysResponse = {
|
||||
kmsKeys: TAwsConnectionKmsKey[];
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
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";
|
||||
import { RootSyncOptions, TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
|
||||
|
||||
export type TAwsParameterStoreSync = TRootSecretSync & {
|
||||
destination: SecretSync.AWSParameterStore;
|
||||
@@ -13,4 +13,9 @@ export type TAwsParameterStoreSync = TRootSecretSync & {
|
||||
name: string;
|
||||
id: string;
|
||||
};
|
||||
syncOptions: RootSyncOptions & {
|
||||
keyId?: string;
|
||||
tags?: { key: string; value?: string }[];
|
||||
syncSecretMetadataAsTags?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
import { SecretSyncInitialSyncBehavior, SecretSyncStatus } from "@app/hooks/api/secretSyncs";
|
||||
|
||||
export type RootSyncOptions = {
|
||||
initialSyncBehavior: SecretSyncInitialSyncBehavior;
|
||||
// prependPrefix?: string;
|
||||
// appendSuffix?: string;
|
||||
};
|
||||
|
||||
export type TRootSecretSync = {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -24,11 +30,7 @@ export type TRootSecretSync = {
|
||||
lastRemoveJobId: string | null;
|
||||
lastRemovedAt: Date | null;
|
||||
lastRemoveMessage: string | null;
|
||||
syncOptions: {
|
||||
initialSyncBehavior: SecretSyncInitialSyncBehavior;
|
||||
// prependPrefix?: string;
|
||||
// appendSuffix?: string;
|
||||
};
|
||||
syncOptions: RootSyncOptions;
|
||||
connection: {
|
||||
app: AppConnection;
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user