mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-09 20:26:40 +00:00
add logs routes to integration api routes closes #1963
This commit is contained in:
@@ -1093,6 +1093,8 @@
|
|||||||
"actionListSiteResources": "List Site Resources",
|
"actionListSiteResources": "List Site Resources",
|
||||||
"actionUpdateSiteResource": "Update Site Resource",
|
"actionUpdateSiteResource": "Update Site Resource",
|
||||||
"actionListInvitations": "List Invitations",
|
"actionListInvitations": "List Invitations",
|
||||||
|
"actionExportLogs": "Export Logs",
|
||||||
|
"actionViewLogs": "View Logs",
|
||||||
"noneSelected": "None selected",
|
"noneSelected": "None selected",
|
||||||
"orgNotFound2": "No organizations found.",
|
"orgNotFound2": "No organizations found.",
|
||||||
"searchProgress": "Search...",
|
"searchProgress": "Search...",
|
||||||
|
|||||||
@@ -17,3 +17,4 @@ export * from "./verifyIdpAccess";
|
|||||||
export * from "./verifyLoginPageAccess";
|
export * from "./verifyLoginPageAccess";
|
||||||
export * from "./logActionAudit";
|
export * from "./logActionAudit";
|
||||||
export * from "./verifySubscription";
|
export * from "./verifySubscription";
|
||||||
|
export * from "./verifyValidLicense";
|
||||||
|
|||||||
@@ -13,13 +13,17 @@
|
|||||||
|
|
||||||
import * as orgIdp from "#private/routers/orgIdp";
|
import * as orgIdp from "#private/routers/orgIdp";
|
||||||
import * as org from "#private/routers/org";
|
import * as org from "#private/routers/org";
|
||||||
|
import * as logs from "#private/routers/auditLogs";
|
||||||
|
|
||||||
import { Router } from "express";
|
|
||||||
import {
|
import {
|
||||||
verifyApiKey,
|
|
||||||
verifyApiKeyHasAction,
|
verifyApiKeyHasAction,
|
||||||
verifyApiKeyIsRoot,
|
verifyApiKeyIsRoot,
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
} from "@server/middlewares";
|
} from "@server/middlewares";
|
||||||
|
import {
|
||||||
|
verifyValidSubscription,
|
||||||
|
verifyValidLicense
|
||||||
|
} from "#private/middlewares";
|
||||||
import { ActionsEnum } from "@server/auth/actions";
|
import { ActionsEnum } from "@server/auth/actions";
|
||||||
|
|
||||||
import { unauthenticated as ua, authenticated as a } from "@server/routers/integration";
|
import { unauthenticated as ua, authenticated as a } from "@server/routers/integration";
|
||||||
@@ -43,3 +47,41 @@ authenticated.delete(
|
|||||||
logActionAudit(ActionsEnum.deleteIdp),
|
logActionAudit(ActionsEnum.deleteIdp),
|
||||||
orgIdp.deleteOrgIdp,
|
orgIdp.deleteOrgIdp,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/logs/action",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription,
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.exportLogs),
|
||||||
|
logs.queryActionAuditLogs
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/logs/action/export",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription,
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.exportLogs),
|
||||||
|
logActionAudit(ActionsEnum.exportLogs),
|
||||||
|
logs.exportActionAuditLogs
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/logs/access",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription,
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.exportLogs),
|
||||||
|
logs.queryAccessAuditLogs
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/logs/access/export",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription,
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.exportLogs),
|
||||||
|
logActionAudit(ActionsEnum.exportLogs),
|
||||||
|
logs.exportAccessAuditLogs
|
||||||
|
);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import * as client from "./client";
|
|||||||
import * as accessToken from "./accessToken";
|
import * as accessToken from "./accessToken";
|
||||||
import * as apiKeys from "./apiKeys";
|
import * as apiKeys from "./apiKeys";
|
||||||
import * as idp from "./idp";
|
import * as idp from "./idp";
|
||||||
|
import * as logs from "./auditLogs";
|
||||||
import * as siteResource from "./siteResource";
|
import * as siteResource from "./siteResource";
|
||||||
import {
|
import {
|
||||||
verifyApiKey,
|
verifyApiKey,
|
||||||
@@ -855,3 +856,18 @@ authenticated.put(
|
|||||||
logActionAudit(ActionsEnum.applyBlueprint),
|
logActionAudit(ActionsEnum.applyBlueprint),
|
||||||
blueprints.applyJSONBlueprint
|
blueprints.applyJSONBlueprint
|
||||||
);
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/logs/request",
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.viewLogs),
|
||||||
|
logs.queryRequestAuditLogs
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/logs/request/export",
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.exportLogs),
|
||||||
|
logActionAudit(ActionsEnum.exportLogs),
|
||||||
|
logs.exportRequestAuditLogs
|
||||||
|
);
|
||||||
|
|||||||
@@ -103,6 +103,11 @@ function getActionsCategories(root: boolean) {
|
|||||||
[t('actionUpdateClient')]: "updateClient",
|
[t('actionUpdateClient')]: "updateClient",
|
||||||
[t('actionListClients')]: "listClients",
|
[t('actionListClients')]: "listClients",
|
||||||
[t('actionGetClient')]: "getClient"
|
[t('actionGetClient')]: "getClient"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Logs": {
|
||||||
|
[t('actionExportLogs')]: "exportLogs",
|
||||||
|
[t('actionViewLogs')]: "viewLogs",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user