Skip to content

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

move windows recording config check lower

x0322056243cbdc4020
diff --git a/backend/src/ee/services/pam-web-access/pam-web-access-service.ts b/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
index b61addde1e..6ca705751f 100644
--- a/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
+++ b/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
@@ -214,16 +214,6 @@ export const pamWebAccessServiceFactory = ({
});
}
- if (resource.resourceType === PamResource.Windows) {
- const recordingConfig = await pamProjectRecordingConfigDAL.findByProjectId(projectId);
- if (!recordingConfig || recordingConfig.storageBackend === PamRecordingStorageBackend.Postgres) {
- throw new BadRequestError({
- message:
- "Windows resources require an external (S3) session recording configuration. Postgres storage is not supported for RDP sessions. Configure an S3 bucket in project settings before accessing Windows accounts."
- });
- }
- }
-
const activeWebSessionCount = await pamSessionDAL.countActiveWebSessions(actor.id, projectId);
if (activeWebSessionCount >= MAX_WEB_SESSIONS_PER_USER) {
throw new BadRequestError({
@@ -300,6 +290,16 @@ export const pamWebAccessServiceFactory = ({
}
}
+ if (resource.resourceType === PamResource.Windows) {
+ const recordingConfig = await pamProjectRecordingConfigDAL.findByProjectId(projectId);
+ if (!recordingConfig || recordingConfig.storageBackend === PamRecordingStorageBackend.Postgres) {
+ throw new BadRequestError({
+ message:
+ "Windows resources require an external (S3) session recording configuration. Postgres storage is not supported for RDP sessions. Configure an S3 bucket in project settings before accessing Windows accounts."
+ });
+ }
+ }
+
// MFA check
if (account.requireMfa && !mfaSessionId) {
const project = await requestMemoize(requestMemoKeys.projectFindById(account.projectId), () =>