From ae0e5a60b954974157973a39bbb9adebb7d3d856 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 21 Oct 2025 01:56:16 +0530 Subject: [PATCH] feat: patchy patchy patchy --- backend/src/ee/routes/v1/license-router.ts | 2 +- .../services/dynamic-secret/dynamic-secret-service.ts | 4 ++-- .../ee/services/permission/permission-service-types.ts | 2 +- .../src/ee/services/saml-config/saml-config-types.ts | 2 +- backend/src/lib/types/index.ts | 2 +- backend/src/services/org/org-service.ts | 10 +++++----- backend/src/services/org/org-types.ts | 10 +++++----- backend/src/services/project/project-service.ts | 4 +++- backend/src/services/project/project-types.ts | 2 +- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/backend/src/ee/routes/v1/license-router.ts b/backend/src/ee/routes/v1/license-router.ts index 8ab31dbe4..2ccdce93a 100644 --- a/backend/src/ee/routes/v1/license-router.ts +++ b/backend/src/ee/routes/v1/license-router.ts @@ -58,7 +58,7 @@ export const registerLicenseRouter = async (server: FastifyZodProvider) => { const plan = await server.services.license.getOrgPlan({ actorId: req.permission.id, actor: req.permission.type, - actorOrgId: req.permission.parentOrgId, + actorOrgId: req.permission.rootOrgId, actorAuthMethod: req.permission.authMethod, orgId: req.params.organizationId, refreshCache: req.query.refreshCache diff --git a/backend/src/ee/services/dynamic-secret/dynamic-secret-service.ts b/backend/src/ee/services/dynamic-secret/dynamic-secret-service.ts index 974f5dd35..d2d683a84 100644 --- a/backend/src/ee/services/dynamic-secret/dynamic-secret-service.ts +++ b/backend/src/ee/services/dynamic-secret/dynamic-secret-service.ts @@ -138,7 +138,7 @@ export const dynamicSecretServiceFactory = ({ scope: OrganizationActionScope.Any, actor, actorId, - orgId: actorOrgId, + orgId: gateway?.orgId || gatewayv2?.orgId, actorAuthMethod, actorOrgId }); @@ -302,7 +302,7 @@ export const dynamicSecretServiceFactory = ({ scope: OrganizationActionScope.Any, actor, actorId, - orgId: actorOrgId, + orgId: gateway?.orgId || gatewayv2?.orgId, actorAuthMethod, actorOrgId }); diff --git a/backend/src/ee/services/permission/permission-service-types.ts b/backend/src/ee/services/permission/permission-service-types.ts index 34660d17d..c69564b31 100644 --- a/backend/src/ee/services/permission/permission-service-types.ts +++ b/backend/src/ee/services/permission/permission-service-types.ts @@ -39,7 +39,7 @@ export type TGetOrgPermissionArg = { actorId: string; orgId: string; actorAuthMethod: ActorAuthMethod; - actorOrgId?: string; + actorOrgId: string; scope: OrganizationActionScope; }; diff --git a/backend/src/ee/services/saml-config/saml-config-types.ts b/backend/src/ee/services/saml-config/saml-config-types.ts index bdf65b988..983ec4db7 100644 --- a/backend/src/ee/services/saml-config/saml-config-types.ts +++ b/backend/src/ee/services/saml-config/saml-config-types.ts @@ -37,7 +37,7 @@ export type TGetSamlCfgDTO = actor: ActorType; actorId: string; actorAuthMethod: ActorAuthMethod; - actorOrgId: string | undefined; + actorOrgId: string; } | { type: "orgSlug"; diff --git a/backend/src/lib/types/index.ts b/backend/src/lib/types/index.ts index f29de20f3..5fbe8ca79 100644 --- a/backend/src/lib/types/index.ts +++ b/backend/src/lib/types/index.ts @@ -5,7 +5,7 @@ export type TGenericPermission = { actor: ActorType; actorId: string; actorAuthMethod: ActorAuthMethod; - actorOrgId: string | undefined; + actorOrgId: string; }; /** diff --git a/backend/src/services/org/org-service.ts b/backend/src/services/org/org-service.ts index 265612d55..c56354e11 100644 --- a/backend/src/services/org/org-service.ts +++ b/backend/src/services/org/org-service.ts @@ -208,7 +208,7 @@ export const orgServiceFactory = ({ userId: string, orgId: string, actorAuthMethod: ActorAuthMethod, - actorOrgId: string | undefined + actorOrgId: string ) => { const { permission } = await permissionService.getOrgPermission({ actor: ActorType.USER, @@ -701,7 +701,7 @@ export const orgServiceFactory = ({ ipAddress: string; orgId: string; actorAuthMethod: ActorAuthMethod; - actorOrgId: string | undefined; + actorOrgId: string; }) => { const { hasRole } = await permissionService.getOrgPermission({ actor: ActorType.USER, @@ -1150,7 +1150,7 @@ export const orgServiceFactory = ({ userId: string, orgId: string, actorAuthMethod: ActorAuthMethod, - actorOrgId: string | undefined + actorOrgId: string ) => { const { permission } = await permissionService.getOrgPermission({ actor: ActorType.USER, @@ -1170,7 +1170,7 @@ export const orgServiceFactory = ({ orgId: string, email: string, actorAuthMethod: ActorAuthMethod, - actorOrgId: string | undefined + actorOrgId: string ) => { const { permission } = await permissionService.getOrgPermission({ actor: ActorType.USER, @@ -1198,7 +1198,7 @@ export const orgServiceFactory = ({ orgId: string, id: string, actorAuthMethod: ActorAuthMethod, - actorOrgId: string | undefined + actorOrgId: string ) => { const { permission } = await permissionService.getOrgPermission({ actor: ActorType.USER, diff --git a/backend/src/services/org/org-types.ts b/backend/src/services/org/org-types.ts index 1a27d131f..48680456c 100644 --- a/backend/src/services/org/org-types.ts +++ b/backend/src/services/org/org-types.ts @@ -8,7 +8,7 @@ export type TUpdateOrgMembershipDTO = { membershipId: string; role?: string; isActive?: boolean; - actorOrgId: string | undefined; + actorOrgId: string; metadata?: { key: string; value: string }[]; actorAuthMethod: ActorAuthMethod; }; @@ -21,7 +21,7 @@ export type TDeleteOrgMembershipDTO = { userId: string; orgId: string; membershipId: string; - actorOrgId: string | undefined; + actorOrgId: string; actorAuthMethod: ActorAuthMethod; }; @@ -29,7 +29,7 @@ export type TDeleteOrgMembershipsDTO = { userId: string; orgId: string; membershipIds: string[]; - actorOrgId: string | undefined; + actorOrgId: string; actorAuthMethod: ActorAuthMethod; }; @@ -54,7 +54,7 @@ export type TVerifyUserToOrgDTO = { export type TFindOrgMembersByEmailDTO = { actor: ActorType; - actorOrgId: string | undefined; + actorOrgId: string; actorId: string; actorAuthMethod: ActorAuthMethod; orgId: string; @@ -64,7 +64,7 @@ export type TFindOrgMembersByEmailDTO = { export type TFindAllWorkspacesDTO = { actor: ActorType; actorId: string; - actorOrgId: string | undefined; + actorOrgId: string; actorAuthMethod: ActorAuthMethod; orgId: string; }; diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.ts index 628e8891c..e29f18404 100644 --- a/backend/src/services/project/project-service.ts +++ b/backend/src/services/project/project-service.ts @@ -1830,7 +1830,8 @@ export const projectServiceFactory = ({ actorId: permission.id, orgId: permission.orgId, actorAuthMethod: permission.authMethod, - scope: OrganizationActionScope.Any + scope: OrganizationActionScope.Any, + actorOrgId: permission.orgId }); return projectDAL.searchProjects({ @@ -1854,6 +1855,7 @@ export const projectServiceFactory = ({ actorId: permission.id, orgId: permission.orgId, actorAuthMethod: permission.authMethod, + actorOrgId: permission.orgId, scope: OrganizationActionScope.Any }); diff --git a/backend/src/services/project/project-types.ts b/backend/src/services/project/project-types.ts index 74c7e95f4..18ae74350 100644 --- a/backend/src/services/project/project-types.ts +++ b/backend/src/services/project/project-types.ts @@ -41,7 +41,7 @@ export type TCreateProjectDTO = { actor: ActorType; actorAuthMethod: ActorAuthMethod; actorId: string; - actorOrgId?: string; + actorOrgId: string; projectName: string; projectDescription?: string; slug?: string;