fix: let api handle signing key validation error (#38649)

* fix: let api handle signing key validation error

* Fix styles

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
This commit is contained in:
Han QiaoandJoshen Lim authored and GitHub committed 2025-09-12 17:50:27 +08:00
1 parent 00520ca1fe
commit 0487fbf625
3 files changed
+3 -11

No files matched your search

@@ -91,7 +91,7 @@ export function StorageTypeField({ form, disableInput }: StorageTypeFieldProps)
/>
) : (
<FormControl_Shadcn_>
<SelectTrigger_Shadcn_ className="h-14 max-w-[420px] [&>span]:w-full">
<SelectTrigger_Shadcn_ className="h-14 max-w-[420px]">
<SelectValue_Shadcn_ />
</SelectTrigger_Shadcn_>
</FormControl_Shadcn_>
@@ -25,10 +25,6 @@ import {
const RSA_JWK_REQUIRED_PROPERTIES = ['kty', 'n', 'e', 'p', 'q', 'd', 'dq', 'dp', 'qi']
const EC_JWK_REQUIRED_PROPERTIES = ['kty', 'crv', 'x', 'y', 'd']
const ALLOWED_JWK_PROPERTIES = new Set([
...RSA_JWK_REQUIRED_PROPERTIES,
...EC_JWK_REQUIRED_PROPERTIES,
])
export const CreateKeyDialog = ({
projectRef,
@@ -145,11 +141,7 @@ export const CreateKeyDialog = ({
.replace(/=/g, '')
: stringToBase64URL(privateKey),
}
: Object.fromEntries(
Object.entries(JSON.parse(privateKey)).filter(([prop]) =>
ALLOWED_JWK_PROPERTIES.has(prop)
)
)
: JSON.parse(privateKey)
: null,
})
}
@@ -50,7 +50,7 @@ const SelectTrigger = React.forwardRef<
'flex w-full items-center justify-between rounded-md border border-strong hover:border-stronger bg-alternative dark:bg-muted hover:bg-selection text-xs ring-offset-background-control data-[placeholder]:text-foreground-lighter focus:outline-none ring-border-control focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200',
'data-[state=open]:bg-selection data-[state=open]:border-stronger',
'gap-2',
'[&>span]:truncate [&>span]:w-[20ch] text-left', // [kemal] This is to prevent double lines rendering when a string is particularly long.
'[&>span]:truncate text-left', // [kemal] This is to prevent double lines rendering when a string is particularly long.
SelectTriggerVariants({ size }),
className
)}