Merge pull request #1273 from navi-infra/INFRA-4035-jit

INFRA-4035 | Saqib | Changes to allow onCall DB DAG to run.
This commit is contained in:
Saqib Perwaiz
2024-12-03 14:14:24 +05:30
committed by GitHub

View File

@@ -496,7 +496,9 @@ class JitServiceImpl implements JitService {
log.error("Invalid team : {} for jit request", jitRequestDto.getTeam());
throw new IllegalArgumentException("Invalid team");
}
if (jitRequestDto.getGrantWindow() > maxGrantWindow) {
if (!jitRequestDto.getRequestedBy().equals(onCallApproverEmail)
&& jitRequestDto.getGrantWindow() > maxGrantWindow
) {
log.error("Request forged. Invalid grant window by user: {}",
jitRequestDto.getRequestedFor());
throw new IllegalArgumentException("Invalid grant window");
@@ -735,4 +737,4 @@ class JitServiceImpl implements JitService {
)
throws IOException;
}
}
}