add clients enabled middleware

This commit is contained in:
miloschwartz 2025-07-30 23:18:51 -07:00
parent d38656e026
commit b351520e92
No known key found for this signature in database

View file

@ -21,7 +21,8 @@ import {
verifyApiKeySetResourceUsers, verifyApiKeySetResourceUsers,
verifyApiKeyAccessTokenAccess, verifyApiKeyAccessTokenAccess,
verifyApiKeyIsRoot, verifyApiKeyIsRoot,
verifyApiKeyClientAccess verifyApiKeyClientAccess,
verifyClientsEnabled
} from "@server/middlewares"; } from "@server/middlewares";
import HttpCode from "@server/types/HttpCode"; import HttpCode from "@server/types/HttpCode";
import { Router } from "express"; import { Router } from "express";
@ -517,6 +518,7 @@ authenticated.get(
authenticated.get( authenticated.get(
"/org/:orgId/pick-client-defaults", "/org/:orgId/pick-client-defaults",
verifyClientsEnabled,
verifyApiKeyOrgAccess, verifyApiKeyOrgAccess,
verifyApiKeyHasAction(ActionsEnum.createClient), verifyApiKeyHasAction(ActionsEnum.createClient),
client.pickClientDefaults client.pickClientDefaults
@ -524,6 +526,7 @@ authenticated.get(
authenticated.get( authenticated.get(
"/org/:orgId/clients", "/org/:orgId/clients",
verifyClientsEnabled,
verifyApiKeyOrgAccess, verifyApiKeyOrgAccess,
verifyApiKeyHasAction(ActionsEnum.listClients), verifyApiKeyHasAction(ActionsEnum.listClients),
client.listClients client.listClients
@ -531,6 +534,7 @@ authenticated.get(
authenticated.get( authenticated.get(
"/org/:orgId/client/:clientId", "/org/:orgId/client/:clientId",
verifyClientsEnabled,
verifyApiKeyOrgAccess, verifyApiKeyOrgAccess,
verifyApiKeyHasAction(ActionsEnum.getClient), verifyApiKeyHasAction(ActionsEnum.getClient),
client.getClient client.getClient
@ -538,6 +542,7 @@ authenticated.get(
authenticated.put( authenticated.put(
"/org/:orgId/client", "/org/:orgId/client",
verifyClientsEnabled,
verifyApiKeyOrgAccess, verifyApiKeyOrgAccess,
verifyApiKeyHasAction(ActionsEnum.createClient), verifyApiKeyHasAction(ActionsEnum.createClient),
client.createClient client.createClient
@ -545,6 +550,7 @@ authenticated.put(
authenticated.delete( authenticated.delete(
"/client/:clientId", "/client/:clientId",
verifyClientsEnabled,
verifyApiKeyClientAccess, verifyApiKeyClientAccess,
verifyApiKeyHasAction(ActionsEnum.deleteClient), verifyApiKeyHasAction(ActionsEnum.deleteClient),
client.deleteClient client.deleteClient
@ -552,6 +558,7 @@ authenticated.delete(
authenticated.post( authenticated.post(
"/client/:clientId", "/client/:clientId",
verifyClientsEnabled,
verifyApiKeyClientAccess, verifyApiKeyClientAccess,
verifyApiKeyHasAction(ActionsEnum.updateClient), verifyApiKeyHasAction(ActionsEnum.updateClient),
client.updateClient client.updateClient