Skip to content

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

rename to avoid conflict

Thiago Araujo da Silvae32a3fa7576e
diff --git a/backend/src/server/routes/v2/identity-router.ts b/backend/src/server/routes/v2/identity-router.ts
index 11019c1539..c98a794572 100644
--- a/backend/src/server/routes/v2/identity-router.ts
+++ b/backend/src/server/routes/v2/identity-router.ts
@@ -81,7 +81,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
scope: z
.array(z.nativeEnum(SearchIdentitiesScope))
.min(1)
- .default([SearchIdentitiesScope.Organization])
+ .default([SearchIdentitiesScope.OrganizationScope])
.describe(IDENTITIES.SEARCH_V2.scope)
.optional(),
orderBy: z
@@ -145,7 +145,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
actorOrgId: req.permission.orgId,
orgId: req.permission.orgId,
searchFilter: req.body.search,
- scope: req.body.scope ?? [SearchIdentitiesScope.Organization],
+ scope: req.body.scope ?? [SearchIdentitiesScope.OrganizationScope],
limit: req.body.limit,
offset: req.body.offset,
orderBy: req.body.orderBy,
@@ -178,7 +178,7 @@ export const registerIdentityRouter = async (server: FastifyZodProvider) => {
scope: z
.array(z.nativeEnum(SearchIdentitiesScope))
.min(1)
- .default([SearchIdentitiesScope.Organization, SearchIdentitiesScope.Project])
+ .default([SearchIdentitiesScope.OrganizationScope, SearchIdentitiesScope.ProjectScope])
.describe(IDENTITIES.SEARCH_COUNT_V2.scope),
search: buildSearchZodSchema(
z
diff --git a/backend/src/services/identity/identity-org-dal.ts b/backend/src/services/identity/identity-org-dal.ts
index ee20ac28c5..25c7e4f584 100644
--- a/backend/src/services/identity/identity-org-dal.ts
+++ b/backend/src/services/identity/identity-org-dal.ts
@@ -716,8 +716,8 @@ export const identityOrgDALFactory = (db: TDbClient) => {
tx?: Knex
) => {
try {
- const includeOrgScope = scope.includes(SearchIdentitiesScope.Organization);
- const includeProjectScope = scope.includes(SearchIdentitiesScope.Project);
+ const includeOrgScope = scope.includes(SearchIdentitiesScope.OrganizationScope);
+ const includeProjectScope = scope.includes(SearchIdentitiesScope.ProjectScope);
const applyScopeFilter = (qb: Knex.QueryBuilder) => {
void qb.whereNotNull(`${TableName.Membership}.actorIdentityId`);
@@ -1052,8 +1052,8 @@ export const identityOrgDALFactory = (db: TDbClient) => {
tx?: Knex
) => {
try {
- const includeOrgScope = scope.includes(SearchIdentitiesScope.Organization);
- const includeProjectScope = scope.includes(SearchIdentitiesScope.Project);
+ const includeOrgScope = scope.includes(SearchIdentitiesScope.OrganizationScope);
+ const includeProjectScope = scope.includes(SearchIdentitiesScope.ProjectScope);
const query = (tx || db.replicaNode())(TableName.Membership)
.join(TableName.Identity, `${TableName.Identity}.id`, `${TableName.Membership}.actorIdentityId`)
diff --git a/backend/src/services/identity/identity-service.ts b/backend/src/services/identity/identity-service.ts
index 3088234515..c8020c75e0 100644
--- a/backend/src/services/identity/identity-service.ts
+++ b/backend/src/services/identity/identity-service.ts
@@ -526,12 +526,12 @@ export const identityServiceFactory = ({
actorOrgId
});
const canReadOrgIdentities = orgPermission.can(OrgPermissionIdentityActions.Read, OrgPermissionSubjects.Identity);
- if (uniqueScope.has(SearchIdentitiesScope.Organization) && !canReadOrgIdentities) {
- uniqueScope.delete(SearchIdentitiesScope.Organization);
+ if (uniqueScope.has(SearchIdentitiesScope.OrganizationScope) && !canReadOrgIdentities) {
+ uniqueScope.delete(SearchIdentitiesScope.OrganizationScope);
}
let accessibleProjectIds: string[] = [];
- if (uniqueScope.has(SearchIdentitiesScope.Project)) {
+ if (uniqueScope.has(SearchIdentitiesScope.ProjectScope)) {
const canAccessAllProjects = orgPermission.can(
OrgPermissionAdminConsoleAction.AccessAllProjects,
OrgPermissionSubjects.AdminConsole
@@ -563,7 +563,7 @@ export const identityServiceFactory = ({
accessibleProjectIds = projectAccessChecks.filter((id): id is string => Boolean(id));
}
if (accessibleProjectIds.length === 0) {
- uniqueScope.delete(SearchIdentitiesScope.Project);
+ uniqueScope.delete(SearchIdentitiesScope.ProjectScope);
}
}
@@ -616,8 +616,8 @@ export const identityServiceFactory = ({
scope,
searchFilter = {}
}: TCountIdentitiesV2DTO) => {
- const requestedOrg = scope.includes(SearchIdentitiesScope.Organization);
- const requestedProject = scope.includes(SearchIdentitiesScope.Project);
+ const requestedOrg = scope.includes(SearchIdentitiesScope.OrganizationScope);
+ const requestedProject = scope.includes(SearchIdentitiesScope.ProjectScope);
const { uniqueScope, accessibleProjectIds } = await resolveIdentitySearchScope({
actor,
diff --git a/backend/src/services/identity/identity-types.ts b/backend/src/services/identity/identity-types.ts
index bd34b6c05d..b6ff0334c4 100644
--- a/backend/src/services/identity/identity-types.ts
+++ b/backend/src/services/identity/identity-types.ts
@@ -67,8 +67,8 @@ export type TSearchOrgIdentitiesByOrgIdDAL = {
export type TSearchOrgIdentitiesByOrgIdDTO = TSearchOrgIdentitiesByOrgIdDAL & TOrgPermission;
export enum SearchIdentitiesScope {
- Organization = "organization",
- Project = "project"
+ OrganizationScope = "organization",
+ ProjectScope = "project"
}
// Translate a raw `Membership.scope` value into a SearchIdentitiesScope. The two enums share
@@ -77,9 +77,9 @@ export enum SearchIdentitiesScope {
export const accessScopeToSearchIdentitiesScope = (scope: string): SearchIdentitiesScope => {
switch (scope) {
case AccessScope.Organization:
- return SearchIdentitiesScope.Organization;
+ return SearchIdentitiesScope.OrganizationScope;
case AccessScope.Project:
- return SearchIdentitiesScope.Project;
+ return SearchIdentitiesScope.ProjectScope;
default:
throw new Error(`Unexpected membership scope for identity search: ${scope}`);
}
diff --git a/frontend/src/hooks/api/identities/queries.tsx b/frontend/src/hooks/api/identities/queries.tsx
index f1f6ab4318..bc698516b8 100644
--- a/frontend/src/hooks/api/identities/queries.tsx
+++ b/frontend/src/hooks/api/identities/queries.tsx
@@ -89,7 +89,7 @@ export const useSearchOrgIdentityMemberships = (dto: TSearchIdentitiesDTO) => {
offset,
orderBy,
orderDirection,
- scope: scope ?? [SearchIdentitiesScope.Organization],
+ scope: scope ?? [SearchIdentitiesScope.OrganizationScope],
search
});
return data;
diff --git a/frontend/src/hooks/api/identities/types.ts b/frontend/src/hooks/api/identities/types.ts
index 8c0bd51637..66017fc32f 100644
--- a/frontend/src/hooks/api/identities/types.ts
+++ b/frontend/src/hooks/api/identities/types.ts
@@ -950,9 +950,8 @@ export type TProjectIdentityMembershipsListV2 = {
};
export enum SearchIdentitiesScope {
- Organization = "organization",
- // eslint-disable-next-line @typescript-eslint/no-shadow
- Project = "project"
+ OrganizationScope = "organization",
+ ProjectScope = "project"
}
export type TSearchIdentitiesDTO = {
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx
index 49facad054..46b5757bb9 100644
--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx
@@ -97,9 +97,9 @@ type ScopeTab = "all" | "organization" | "project";
const MAX_ROLES_TO_BE_SHOWN_IN_TABLE = 2;
const TAB_TO_SCOPE: Record<ScopeTab, SearchIdentitiesScope[]> = {
- all: [SearchIdentitiesScope.Organization, SearchIdentitiesScope.Project],
- organization: [SearchIdentitiesScope.Organization],
- project: [SearchIdentitiesScope.Project]
+ all: [SearchIdentitiesScope.OrganizationScope, SearchIdentitiesScope.ProjectScope],
+ organization: [SearchIdentitiesScope.OrganizationScope],
+ project: [SearchIdentitiesScope.ProjectScope]
};
const formatLastUsed = (lastLoginTime?: string | null) => {
@@ -215,7 +215,7 @@ const ManagedByCell = ({
isSubOrganization,
isSubOrgIdentity
}: ManagedByCellProps) => {
- if (scope === SearchIdentitiesScope.Project) {
+ if (scope === SearchIdentitiesScope.ProjectScope) {
return (
<Badge variant="project">
<ProjectIcon />
@@ -380,7 +380,7 @@ const IdentityRow = ({ membership, onDelete }: IdentityRowProps) => {
} = membership;
const isSubOrgIdentity = currentOrg.id === orgId;
- const isProjectScoped = scope === SearchIdentitiesScope.Project;
+ const isProjectScoped = scope === SearchIdentitiesScope.ProjectScope;
const navigateToIdentity = () => {
if (isProjectScoped && project) {
@@ -534,12 +534,21 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
const orgWord = isSubOrganization ? "sub-organization" : "organization";
const orgVariant = isSubOrganization ? "sub-org" : "org";
- const emptyTitle = isFiltered
- ? `No ${orgWord} machine identities match search filter`
- : `No machine identities have been added to this ${orgWord}`;
- const emptyDescription = isFiltered
- ? "Adjust your search or filter criteria."
- : "Add a machine identity to get started.";
+ const isProjectTab = scopeTab === "project";
+ const scopeLabel = isProjectTab ? "project" : orgWord;
+
+ let emptyTitle: string;
+ let emptyDescription: string;
+ if (isFiltered) {
+ emptyTitle = `No ${scopeLabel} machine identities match search filter`;
+ emptyDescription = "Adjust your search or filter criteria.";
+ } else if (isProjectTab) {
+ emptyTitle = "No project machine identities found";
+ emptyDescription = "Machine identities scoped to a project will appear here.";
+ } else {
+ emptyTitle = `No machine identities have been added to this ${orgWord}`;
+ emptyDescription = "Add a machine identity to get started.";
+ }
return (
<>