mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 12:27:28 +00:00
feat: create secret with password
This commit is contained in:
@@ -21,7 +21,7 @@ export const SecretSharingSchema = z.object({
|
|||||||
expiresAfterViews: z.number().nullable().optional(),
|
expiresAfterViews: z.number().nullable().optional(),
|
||||||
accessType: z.string().default("anyone"),
|
accessType: z.string().default("anyone"),
|
||||||
name: z.string().nullable().optional(),
|
name: z.string().nullable().optional(),
|
||||||
password: z.string().optional(),
|
password: z.string().nullable().optional(),
|
||||||
lastViewedAt: z.date().nullable().optional()
|
lastViewedAt: z.date().nullable().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export const secretSharingServiceFactory = ({
|
|||||||
iv,
|
iv,
|
||||||
tag,
|
tag,
|
||||||
name,
|
name,
|
||||||
|
password,
|
||||||
accessType,
|
accessType,
|
||||||
expiresAt,
|
expiresAt,
|
||||||
expiresAfterViews
|
expiresAfterViews
|
||||||
@@ -62,6 +63,7 @@ export const secretSharingServiceFactory = ({
|
|||||||
|
|
||||||
const newSharedSecret = await secretSharingDAL.create({
|
const newSharedSecret = await secretSharingDAL.create({
|
||||||
name,
|
name,
|
||||||
|
password,
|
||||||
encryptedValue,
|
encryptedValue,
|
||||||
hashedHex,
|
hashedHex,
|
||||||
iv,
|
iv,
|
||||||
@@ -77,6 +79,7 @@ export const secretSharingServiceFactory = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const createPublicSharedSecret = async ({
|
const createPublicSharedSecret = async ({
|
||||||
|
password,
|
||||||
encryptedValue,
|
encryptedValue,
|
||||||
hashedHex,
|
hashedHex,
|
||||||
iv,
|
iv,
|
||||||
@@ -103,6 +106,7 @@ export const secretSharingServiceFactory = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const newSharedSecret = await secretSharingDAL.create({
|
const newSharedSecret = await secretSharingDAL.create({
|
||||||
|
password,
|
||||||
encryptedValue,
|
encryptedValue,
|
||||||
hashedHex,
|
hashedHex,
|
||||||
iv,
|
iv,
|
||||||
@@ -111,6 +115,7 @@ export const secretSharingServiceFactory = ({
|
|||||||
expiresAfterViews,
|
expiresAfterViews,
|
||||||
accessType
|
accessType
|
||||||
});
|
});
|
||||||
|
|
||||||
return { id: newSharedSecret.id };
|
return { id: newSharedSecret.id };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user