Merge pull request #2670 from Infisical/feat/added-key-id-column

feat: added key id column
This commit is contained in:
Sheen
2024-11-01 01:14:46 +08:00
committed by GitHub
4 changed files with 48 additions and 7 deletions
@@ -0,0 +1,5 @@
---
title: "Kubernetes Encryption with KMS"
sidebarTitle: "Kubernetes Encryption"
url: "https://github.com/Infisical/k8-kms-plugin"
---
@@ -1,6 +1,6 @@
--- ---
title: "Key Management Service (KMS)" title: "Key Management Service (KMS)"
sidebarTitle: "Key Management (KMS)" sidebarTitle: "Overview"
description: "Learn how to manage and use cryptographic keys with Infisical." description: "Learn how to manage and use cryptographic keys with Infisical."
--- ---
+7 -1
View File
@@ -113,7 +113,13 @@
"documentation/platform/pki/alerting" "documentation/platform/pki/alerting"
] ]
}, },
"documentation/platform/kms", {
"group": "Key Management (KMS)",
"pages": [
"documentation/platform/kms/overview",
"documentation/platform/kms/kubernetes-encryption"
]
},
{ {
"group": "KMS Configuration", "group": "KMS Configuration",
"pages": [ "pages": [
@@ -4,7 +4,9 @@ import {
faArrowUp, faArrowUp,
faArrowUpRightFromSquare, faArrowUpRightFromSquare,
faCancel, faCancel,
faCheck,
faCheckCircle, faCheckCircle,
faCopy,
faEdit, faEdit,
faEllipsis, faEllipsis,
faInfoCircle, faInfoCircle,
@@ -50,7 +52,7 @@ import {
useProjectPermission, useProjectPermission,
useWorkspace useWorkspace
} from "@app/context"; } from "@app/context";
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks"; import { usePagination, usePopUp, useResetPageHelper, useTimedReset } from "@app/hooks";
import { useGetCmeksByProjectId, useUpdateCmek } from "@app/hooks/api/cmeks"; import { useGetCmeksByProjectId, useUpdateCmek } from "@app/hooks/api/cmeks";
import { CmekOrderBy, TCmek } from "@app/hooks/api/cmeks/types"; import { CmekOrderBy, TCmek } from "@app/hooks/api/cmeks/types";
import { OrderByDirection } from "@app/hooks/api/generic/types"; import { OrderByDirection } from "@app/hooks/api/generic/types";
@@ -113,6 +115,11 @@ export const CmekTable = () => {
setPage setPage
}); });
const [, isCopyingCiphertext, setCopyCipherText] = useTimedReset<string>({
initialState: "",
delay: 1000
});
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([ const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([
"upsertKey", "upsertKey",
"deleteKey", "deleteKey",
@@ -220,7 +227,7 @@ export const CmekTable = () => {
<Table> <Table>
<THead> <THead>
<Tr className="h-14"> <Tr className="h-14">
<Th className="w-1/3"> <Th>
<div className="flex items-center"> <div className="flex items-center">
Name Name
<IconButton <IconButton
@@ -235,6 +242,7 @@ export const CmekTable = () => {
</IconButton> </IconButton>
</div> </div>
</Th> </Th>
<Th>Key ID</Th>
<Th>Algorithm</Th> <Th>Algorithm</Th>
<Th>Status</Th> <Th>Status</Th>
<Th>Version</Th> <Th>Version</Th>
@@ -242,7 +250,7 @@ export const CmekTable = () => {
</Tr> </Tr>
</THead> </THead>
<TBody> <TBody>
{isLoading && <TableSkeleton columns={4} innerKey="project-keys" />} {isLoading && <TableSkeleton columns={5} innerKey="project-keys" />}
{!isLoading && {!isLoading &&
keys.length > 0 && keys.length > 0 &&
keys.map((cmek) => { keys.map((cmek) => {
@@ -250,9 +258,15 @@ export const CmekTable = () => {
const { variant, label } = getStatusBadgeProps(isDisabled); const { variant, label } = getStatusBadgeProps(isDisabled);
return ( return (
<Tr className="group h-10 hover:bg-mineshaft-700" key={`st-v3-${id}`}> <Tr
className="group h-10 hover:bg-mineshaft-700"
key={`st-v3-${id}`}
onMouseLeave={() => {
setCopyCipherText("");
}}
>
<Td> <Td>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2 ">
{name} {name}
{description && ( {description && (
<Tooltip content={description}> <Tooltip content={description}>
@@ -264,6 +278,22 @@ export const CmekTable = () => {
)} )}
</div> </div>
</Td> </Td>
<Td>
<div>
<span> {id}</span>
<IconButton
ariaLabel="copy icon"
colorSchema="secondary"
className="group/copy duration:0 invisible relative ml-3 group-hover:visible"
onClick={() => {
navigator.clipboard.writeText(id);
setCopyCipherText("Copied");
}}
>
<FontAwesomeIcon icon={isCopyingCiphertext ? faCheck : faCopy} />
</IconButton>
</div>
</Td>
<Td className="uppercase">{encryptionAlgorithm}</Td> <Td className="uppercase">{encryptionAlgorithm}</Td>
<Td> <Td>
<Badge variant={variant}>{label}</Badge> <Badge variant={variant}>{label}</Badge>