Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement: add commit endpoint schema constraints and revert license
Scott Wilson2c4265066d80
diff --git a/backend/src/ee/routes/v1/pit-router.ts b/backend/src/ee/routes/v1/pit-router.tsindex ed912a2170..55c2ef6572 100644--- a/backend/src/ee/routes/v1/pit-router.ts+++ b/backend/src/ee/routes/v1/pit-router.ts@@ -52,6 +52,15 @@ const folderStateSchema = z.array(}));+// Bounds match what the columns behind these actually permit, so no existing resource can be+// locked out: project ids are varchar(36) rather than uuid (they still hold pre-uuid ids), env+// slugs are varchar(255), and a path is at most buildFolderPath's 20 levels of varchar(255) names+const folderScopeQuerySchema = z.object({+ environment: z.string().trim().min(1).max(255),+ path: z.string().trim().max(6144).default("/").transform(removeTrailingSlash),+ projectId: z.string().trim().min(1).max(36)+});+export const registerPITRouter = async (server: FastifyZodProvider) => {// Get commits count for a folderserver.route({@@ -110,10 +119,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {rateLimit: readLimit},schema: {- querystring: z.object({- environment: z.string().trim(),- path: z.string().trim().default("/").transform(removeTrailingSlash),- projectId: z.string().trim(),+ querystring: folderScopeQuerySchema.extend({offset: z.coerce.number().min(0).default(0),limit: z.coerce.number().min(1).max(100).default(20),search: z@@ -158,6 +164,12 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {authorFilter: { actorId: req.query.actorId, actorType: req.query.actorType }});+ // Every commit on an author-filtered page belongs to that author, so the readable label+ // the audit log needs for the actor filter comes off the page without a second lookup+ const filteredActor = req.query.actorId+ ? (result.commits[0]?.actorMetadata as { name?: string; email?: string } | undefined)+ : undefined;+await server.services.auditLog.createAuditLog({...req.auditLogInfo,projectId: req.query.projectId,@@ -172,6 +184,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {search: req.query.search,sort: req.query.sort,filteredActorId: req.query.actorId,+ filteredActorName: filteredActor?.email || filteredActor?.name,filteredActorType: req.query.actorType}}@@ -189,11 +202,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {rateLimit: readLimit},schema: {- querystring: z.object({- environment: z.string().trim(),- path: z.string().trim().default("/").transform(removeTrailingSlash),- projectId: z.string().trim()- }),+ querystring: folderScopeQuerySchema,response: {200: z.object({authors: commitAuthorSchema.array()diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex b357f0fa1d..25895994c0 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -5181,6 +5181,7 @@ interface GetProjectPitCommitsEvent {search?: string;sort: string;filteredActorId?: string;+ filteredActorName?: string;filteredActorType?: string;};}diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.tsindex a72a36c279..5ed939f378 100644--- a/backend/src/ee/services/license/license-fns.ts+++ b/backend/src/ee/services/license/license-fns.ts@@ -67,7 +67,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({secretVersioning: true,pitRecovery: false,ipAllowlisting: false,- rbac: true,+ rbac: false,githubOrgSync: false,customRateLimits: false,subOrganization: false,