Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

nits

Daniel Hougaardb4fbc83e3f97
diff --git a/backend/src/db/migrations/20260210210927_secret-sharing-identity-support.ts b/backend/src/db/migrations/20260210210927_secret-sharing-identity-support.ts
index 441f61610a..5db35a1c23 100644
--- a/backend/src/db/migrations/20260210210927_secret-sharing-identity-support.ts
+++ b/backend/src/db/migrations/20260210210927_secret-sharing-identity-support.ts
@@ -16,7 +16,7 @@ export async function down(knex: Knex): Promise<void> {
const hasIdentityIdColumn = await knex.schema.hasColumn(TableName.SecretSharing, "identityId");
if (hasIdentityIdColumn) {
await knex.schema.alterTable(TableName.SecretSharing, (t) => {
- t.dropForeign("identityId");
+ t.dropForeign(["identityId"]);
t.dropColumn("identityId");
});
}
diff --git a/backend/src/server/routes/v1/secret-requests-router.ts b/backend/src/server/routes/v1/secret-requests-router.ts
index 42ac61fc58..4528032b93 100644
--- a/backend/src/server/routes/v1/secret-requests-router.ts
+++ b/backend/src/server/routes/v1/secret-requests-router.ts
@@ -295,6 +295,14 @@ export const registerSecretRequestsRouter = async (server: FastifyZodProvider) =
.superRefine((data, ctx) => {
const duration = ms(data.expiresIn);
+ if (duration === undefined) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: "Invalid duration format",
+ path: ["expiresIn"]
+ });
+ }
+
if (duration > ms("30d")) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
diff --git a/backend/src/server/routes/v1/secret-sharing-router.ts b/backend/src/server/routes/v1/secret-sharing-router.ts
index e4d6d72750..1225203732 100644
--- a/backend/src/server/routes/v1/secret-sharing-router.ts
+++ b/backend/src/server/routes/v1/secret-sharing-router.ts
@@ -180,6 +180,14 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>
.superRefine((data, ctx) => {
const duration = ms(data.expiresIn);
+ if (duration === undefined) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: "Invalid duration format",
+ path: ["expiresIn"]
+ });
+ }
+
if (duration > ms("30d")) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
@@ -245,6 +253,14 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>
.superRefine((data, ctx) => {
const duration = ms(data.expiresIn);
+ if (duration === undefined) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: "Invalid duration format",
+ path: ["expiresIn"]
+ });
+ }
+
if (duration > ms("30d")) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
diff --git a/backend/src/services/secret-sharing/secret-sharing-dal.ts b/backend/src/services/secret-sharing/secret-sharing-dal.ts
index 95651af40e..61a2ce767f 100644
--- a/backend/src/services/secret-sharing/secret-sharing-dal.ts
+++ b/backend/src/services/secret-sharing/secret-sharing-dal.ts
@@ -55,14 +55,9 @@ export const secretSharingDALFactory = (db: TDbClient) => {
}: {
orgId: string;
type: SecretSharingType;
- } & (
- | {
- userId: string;
- }
- | {
- identityId: string;
- }
- )) => {
+ userId?: string;
+ identityId?: string;
+ }) => {
try {
interface CountResult {
count: string;
diff --git a/backend/src/services/secret-sharing/secret-sharing-service.ts b/backend/src/services/secret-sharing/secret-sharing-service.ts
index 1a27940e53..f39714117c 100644
--- a/backend/src/services/secret-sharing/secret-sharing-service.ts
+++ b/backend/src/services/secret-sharing/secret-sharing-service.ts
@@ -514,7 +514,6 @@ export const secretSharingServiceFactory = ({
const count = await secretSharingDAL.countAllUserOrgSharedSecrets({
orgId: actorOrgId,
- userId: actorId,
type,
...(actor === ActorType.USER && { userId: actorId }),
...(actor === ActorType.IDENTITY && { identityId: actorId })
@@ -725,6 +724,8 @@ export const secretSharingServiceFactory = ({
message: "Identity does not have permission to delete shared secret"
});
}
+ } else {
+ throw new ForbiddenRequestError({ message: "User does not have permission to delete shared secret" });
}
if (sharedSecret.orgId && sharedSecret.orgId !== orgId) {
diff --git a/docs/docs.json b/docs/docs.json
index f3ec65b21a..defea8442f 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -337,10 +337,10 @@
"self-hosting/deployment-options/linux-upgrade"
]
},
- "self-hosting/guides/replication",
- "self-hosting/guides/upgrading-infisical",
- "self-hosting/configuration/envars",
- "self-hosting/configuration/requirements",
+ "self-hosting/guides/replication",
+ "self-hosting/guides/upgrading-infisical",
+ "self-hosting/configuration/envars",
+ "self-hosting/configuration/requirements",
{
"group": "Guides",
"pages": [
@@ -3047,7 +3047,7 @@
"href": "https://infisical.com"
},
"api": {
- "openapi": "https://abbigail-rotund-harmonically.ngrok-free.dev/api/docs/json",
+ "openapi": "https://app.infisical.com/api/docs/json",
"mdx": {
"server": ["https://app.infisical.com"]
}
diff --git a/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx b/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx
index b3f74e6a35..1d8c1cbdd8 100644
--- a/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx
+++ b/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx
@@ -123,10 +123,11 @@ export const ViewSharedSecretByIDPage = () => {
}
}, [activeError]);
- // UI state
const secret = accessMutation.data;
const isPasswordProtected = secretDetails?.isPasswordProtected ?? false;
- const showPasswordPrompt = isPasswordProtected && !secret;
+ // only show password prompt if no critical error (403/404) occurred after submission
+ const hasCriticalError = accessMutation.isError && (isForbidden || isNotFound);
+ const showPasswordPrompt = isPasswordProtected && !secret && !hasCriticalError;
const isLoading = isLoadingDetails || (!isPasswordProtected && accessMutation.isPending);
const hasCustomBranding = !!brandingConfig;