mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-22 21:06:37 +00:00
Merge dev into fix/log-analytics-adjustments
This commit is contained in:
@@ -41,7 +41,11 @@ async function getActionDays(orgId: string): Promise<number> {
|
||||
}
|
||||
|
||||
// store the result in cache
|
||||
cache.set(`org_${orgId}_actionDays`, org.settingsLogRetentionDaysAction, 300);
|
||||
cache.set(
|
||||
`org_${orgId}_actionDays`,
|
||||
org.settingsLogRetentionDaysAction,
|
||||
300
|
||||
);
|
||||
|
||||
return org.settingsLogRetentionDaysAction;
|
||||
}
|
||||
@@ -141,4 +145,3 @@ export function logActionAudit(action: ActionsEnum) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ export async function verifyCertificateAccess(
|
||||
try {
|
||||
// Assume user/org access is already verified
|
||||
const orgId = req.params.orgId;
|
||||
const certId = req.params.certId || req.body?.certId || req.query?.certId;
|
||||
const certId =
|
||||
req.params.certId || req.body?.certId || req.query?.certId;
|
||||
let domainId =
|
||||
req.params.domainId || req.body?.domainId || req.query?.domainId;
|
||||
|
||||
@@ -39,10 +40,12 @@ export async function verifyCertificateAccess(
|
||||
}
|
||||
|
||||
if (!domainId) {
|
||||
|
||||
if (!certId) {
|
||||
return next(
|
||||
createHttpError(HttpCode.BAD_REQUEST, "Must provide either certId or domainId")
|
||||
createHttpError(
|
||||
HttpCode.BAD_REQUEST,
|
||||
"Must provide either certId or domainId"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -75,7 +78,10 @@ export async function verifyCertificateAccess(
|
||||
|
||||
if (!domainId) {
|
||||
return next(
|
||||
createHttpError(HttpCode.BAD_REQUEST, "Must provide either certId or domainId")
|
||||
createHttpError(
|
||||
HttpCode.BAD_REQUEST,
|
||||
"Must provide either certId or domainId"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ export async function verifyIdpAccess(
|
||||
) {
|
||||
try {
|
||||
const userId = req.user!.userId;
|
||||
const idpId =
|
||||
req.params.idpId || req.body.idpId || req.query.idpId;
|
||||
const idpId = req.params.idpId || req.body.idpId || req.query.idpId;
|
||||
const orgId = req.params.orgId;
|
||||
|
||||
if (!userId) {
|
||||
@@ -50,9 +49,7 @@ export async function verifyIdpAccess(
|
||||
.select()
|
||||
.from(idp)
|
||||
.innerJoin(idpOrg, eq(idp.idpId, idpOrg.idpId))
|
||||
.where(
|
||||
and(eq(idp.idpId, idpId), eq(idpOrg.orgId, orgId))
|
||||
)
|
||||
.where(and(eq(idp.idpId, idpId), eq(idpOrg.orgId, orgId)))
|
||||
.limit(1);
|
||||
|
||||
if (!idpRes || !idpRes.idp || !idpRes.idpOrg) {
|
||||
|
||||
@@ -26,7 +26,8 @@ export const verifySessionRemoteExitNodeMiddleware = async (
|
||||
// get the token from the auth header
|
||||
const token = req.headers["authorization"]?.split(" ")[1] || "";
|
||||
|
||||
const { session, remoteExitNode } = await validateRemoteExitNodeSessionToken(token);
|
||||
const { session, remoteExitNode } =
|
||||
await validateRemoteExitNodeSessionToken(token);
|
||||
|
||||
if (!session || !remoteExitNode) {
|
||||
if (config.getRawConfig().app.log_failed_attempts) {
|
||||
|
||||
Reference in New Issue
Block a user