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
Merge branch 'main' of https://github.com/Infisical/infisical into chore/remove-mention-of-pki-projects
Sheen Capadngan1bfb67855e83
diff --cc CLAUDE.mdindex 42ae0793f9,89c6e41ed3..f451f5683d--- a/CLAUDE.md+++ b/CLAUDE.md@@@ -111,6 -111,10 +111,10 @@@ Auth modes (JWT, IDENTITY_ACCESS_TOKENPAM and Agent Vault are products over one implicit project per organization, not projects a user creates. Their URLs are `/organizations/$orgId/<product>/…` with no `$projectId`, the frontend resolves the project from the org (`useImplicitProjectId`), the backend bootstraps it lazily and blocks generic create and delete, their roles are admin or member only, and each has its own metered identities dimension (`pam_identities`, `agent_vault_identities`). When you add a `ProjectType.PAM` arm anywhere, add the Agent Vault arm beside it. See `backend/src/ee/services/pam/CLAUDE.md` and `backend/src/ee/services/agent-vault/CLAUDE.md`.+ ### Single-Project Products+-Secret Scanning has one active project per organization (the newest) but keeps `$projectId` in its URLs, like Certificate Manager. It is created lazily by `GET /api/v2/secret-scanning/project`, and `projectId` is optional on its API (`inject-secret-scanning-project-id`). Do not add a project picker or a way to create more Secret Scanning projects.++Secret Scanning has one active project per organization (the newest) but, unlike Certificate Manager, keeps `$projectId` in its URLs. It is created lazily by `GET /api/v2/secret-scanning/project`, and `projectId` is optional on its API (`inject-secret-scanning-project-id`). Do not add a project picker or a way to create more Secret Scanning projects.+### Service Factory + Manual DI (Backend)No IoC container in either backend. Every service is a factory function with explicit dependencies.diff --cc frontend/CLAUDE.mdindex 5f4e3281d3,bc41f278c1..c84f686f79--- a/frontend/CLAUDE.md+++ b/frontend/CLAUDE.md@@@ -105,8 -105,10 +105,12 @@@ PAM and Agent Vault live at `/organizatA new org-scoped product therefore needs: a `<product>ProjectId` on the `Organization` type, an entry in `ORG_SCOPED_PRODUCT_TYPES` and `getOrgScopedProductFromPath` (`helpers/project.ts`), and a layout `beforeLoad` that bootstraps the id, patches it into the cached org, and returns both `implicitProjectId` and `implicitProductType` (see `pages/agent-vault/layout.tsx`). Use `isOrgScopedProduct(type)` rather than adding another pathname check; the sidebar, navbar, project switcher and nav links all key off it.+Certificate Manager is org-scoped too (`/organizations/$orgId/cert-manager/...`), but legacy orgs can hold several instances, so its layout resolves the project from instance state instead of an org field, through `resolveCertManagerProjectId` (`helpers/certManagerActiveProject.ts`): the `infisical-cm-active-project-<orgId>` cookie while the user is a member of that instance, else the active instance. The product switcher and the 403 page use the same helper. The layout writes the resolved id back to the cookie, because `inject-cert-manager-project-id.ts` resolves requests that name no project from it, and reloads the page when the resolved instance changes within one page load, since several cert-manager queries are not keyed by project. Consequences: anything that sends someone into a *specific* instance (the instance picker, a project-scoped identity row, a gateway's discovery row) sets that cookie first, since the URL can't say which; old `/projects/cert-manager/$projectId/...` URLs (emails and alerts sent before the move, bookmarks; the backend now links to `/cert-manager/...`, except legacy PKI Alerts V2 and the legacy-deprecation email) go through `redirects/cert-manager-project-url-redirect.tsx`, which pins the named instance and strips the id. In multi-instance orgs each tab also tags its Certificate Manager API requests with the instance it shows (`setTabCertManagerProjectId`, read by the `apiRequest` interceptor), because the cookie is shared across tabs; single-instance orgs send no project id. Shared views that pick project vs org scope from the URL use `useRouteProjectId()`, which also returns Certificate Manager's implicit project.++ ### Single-project products++ Secret Scanning has one active project per org (see the root `CLAUDE.md`). Members are sent straight into it, and UI for orgs with older projects is gated on `isMultiInstance` from `useGetSecretScanningInstanceState`.+## Conventions- ESLint flat config (ESLint 9+) with airbnb-typescript + prettier. Double quotes enforced.diff --cc frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsxindex a29ec75a17,b3490a21e6..e8d95cda55--- a/frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsx+++ b/frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsx@@@ -230,7 -207,30 +233,17 @@@ export const TypeSelect = () =>if (params.projectId) {const project = projects.find((p) => p.id === params.projectId);if (project) {- return <TypeSelectInner currentType={project.type} showDivider />;- const applicationName =- (params as { applicationName?: string }).applicationName ?? search.fromApplication;- const hasApplicationSelect =- project.type === ProjectType.CertificateManager && Boolean(applicationName);- const hasSiblingProjectSelect =- project.type !== ProjectType.CertificateManager &&- project.type !== ProjectType.SecretScanning;- const isLegacyCertManagerProject =- project.type === ProjectType.CertificateManager &&- !isCertManagerInstancePending &&- certManagerInstance?.activeProjectId !== project.id;+ const isLegacySecretScanningProject =+ project.type === ProjectType.SecretScanning &&+ Boolean(secretScanningInstance?.isMultiInstance) &&+ secretScanningInstance?.activeProjectId !== project.id;+ return (+ <TypeSelectInner+ currentType={project.type}- currentProjectName={- isLegacyCertManagerProject || isLegacySecretScanningProject ? project.name : undefined- }- showDivider={hasSiblingProjectSelect || hasApplicationSelect}++ currentProjectName={isLegacySecretScanningProject ? project.name : undefined}++ showDivider={project.type !== ProjectType.SecretScanning}+ />+ );}}