mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 05:28:51 +00:00
bug fix, migration fix, frontend tweak
This commit is contained in:
@@ -4,9 +4,12 @@ import { TableName } from "../schemas";
|
|||||||
|
|
||||||
export async function up(knex: Knex): Promise<void> {
|
export async function up(knex: Knex): Promise<void> {
|
||||||
if (await knex.schema.hasTable(TableName.CertificateBody)) {
|
if (await knex.schema.hasTable(TableName.CertificateBody)) {
|
||||||
await knex.schema.alterTable(TableName.CertificateBody, (t) => {
|
const hasColumn = await knex.schema.hasColumn(TableName.CertificateBody, "encryptedCertificateChain");
|
||||||
t.binary("encryptedCertificateChain").nullable();
|
if (!hasColumn) {
|
||||||
});
|
await knex.schema.alterTable(TableName.CertificateBody, (t) => {
|
||||||
|
t.binary("encryptedCertificateChain").nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(await knex.schema.hasTable(TableName.CertificateSecret))) {
|
if (!(await knex.schema.hasTable(TableName.CertificateSecret))) {
|
||||||
@@ -26,8 +29,11 @@ export async function down(knex: Knex): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (await knex.schema.hasTable(TableName.CertificateBody)) {
|
if (await knex.schema.hasTable(TableName.CertificateBody)) {
|
||||||
await knex.schema.alterTable(TableName.CertificateBody, (t) => {
|
const hasColumn = await knex.schema.hasColumn(TableName.CertificateBody, "encryptedCertificateChain");
|
||||||
t.dropColumn("encryptedCertificateChain");
|
if (hasColumn) {
|
||||||
});
|
await knex.schema.alterTable(TableName.CertificateBody, (t) => {
|
||||||
|
t.dropColumn("encryptedCertificateChain");
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ export const certificateServiceFactory = ({
|
|||||||
|
|
||||||
await certificateSecretDAL.create(
|
await certificateSecretDAL.create(
|
||||||
{
|
{
|
||||||
certId: cert.id,
|
certId: txCert.id,
|
||||||
encryptedPrivateKey
|
encryptedPrivateKey
|
||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
|
|||||||
+3
-17
@@ -175,11 +175,7 @@ export const CertificateImportModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
errorText={error?.message}
|
errorText={error?.message}
|
||||||
isRequired
|
isRequired
|
||||||
>
|
>
|
||||||
<TextArea
|
<TextArea {...field} isDisabled={Boolean(cert)} />
|
||||||
{...field}
|
|
||||||
placeholder={"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"}
|
|
||||||
isDisabled={Boolean(cert)}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -194,13 +190,7 @@ export const CertificateImportModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
errorText={error?.message}
|
errorText={error?.message}
|
||||||
isRequired
|
isRequired
|
||||||
>
|
>
|
||||||
<TextArea
|
<TextArea {...field} isDisabled={Boolean(cert)} />
|
||||||
{...field}
|
|
||||||
placeholder={
|
|
||||||
"-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----"
|
|
||||||
}
|
|
||||||
isDisabled={Boolean(cert)}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -215,11 +205,7 @@ export const CertificateImportModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
errorText={error?.message}
|
errorText={error?.message}
|
||||||
isRequired
|
isRequired
|
||||||
>
|
>
|
||||||
<TextArea
|
<TextArea {...field} isDisabled={Boolean(cert)} />
|
||||||
{...field}
|
|
||||||
placeholder={"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"}
|
|
||||||
isDisabled={Boolean(cert)}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user