mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-28 15:56:39 +00:00
add remove invitation to integration api
This commit is contained in:
@@ -1035,6 +1035,7 @@
|
|||||||
"updateOrgUser": "Update Org User",
|
"updateOrgUser": "Update Org User",
|
||||||
"createOrgUser": "Create Org User",
|
"createOrgUser": "Create Org User",
|
||||||
"actionUpdateOrg": "Update Organization",
|
"actionUpdateOrg": "Update Organization",
|
||||||
|
"actionRemoveInvitation": "Remove Invitation",
|
||||||
"actionUpdateUser": "Update User",
|
"actionUpdateUser": "Update User",
|
||||||
"actionGetUser": "Get User",
|
"actionGetUser": "Get User",
|
||||||
"actionGetOrgUser": "Get Organization User",
|
"actionGetOrgUser": "Get Organization User",
|
||||||
|
|||||||
@@ -352,6 +352,14 @@ authenticated.post(
|
|||||||
user.inviteUser
|
user.inviteUser
|
||||||
);
|
);
|
||||||
|
|
||||||
|
authenticated.delete(
|
||||||
|
"/org/:orgId/invitations/:inviteId",
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.removeInvitation),
|
||||||
|
logActionAudit(ActionsEnum.removeInvitation),
|
||||||
|
user.removeInvitation
|
||||||
|
);
|
||||||
|
|
||||||
authenticated.get(
|
authenticated.get(
|
||||||
"/resource/:resourceId/roles",
|
"/resource/:resourceId/roles",
|
||||||
verifyApiKeyResourceAccess,
|
verifyApiKeyResourceAccess,
|
||||||
|
|||||||
@@ -8,12 +8,24 @@ import HttpCode from "@server/types/HttpCode";
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const removeInvitationParamsSchema = z.strictObject({
|
const removeInvitationParamsSchema = z.strictObject({
|
||||||
orgId: z.string(),
|
orgId: z.string(),
|
||||||
inviteId: z.string()
|
inviteId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "delete",
|
||||||
|
path: "/org/{orgId}/invitations/{inviteId}",
|
||||||
|
description: "Remove an open invitation from an organization",
|
||||||
|
tags: [OpenAPITags.Org],
|
||||||
|
request: {
|
||||||
|
params: removeInvitationParamsSchema
|
||||||
|
},
|
||||||
|
responses: {}
|
||||||
|
});
|
||||||
|
|
||||||
export async function removeInvitation(
|
export async function removeInvitation(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ function getActionsCategories(root: boolean) {
|
|||||||
[t("actionUpdateOrg")]: "updateOrg",
|
[t("actionUpdateOrg")]: "updateOrg",
|
||||||
[t("actionGetOrgUser")]: "getOrgUser",
|
[t("actionGetOrgUser")]: "getOrgUser",
|
||||||
[t("actionInviteUser")]: "inviteUser",
|
[t("actionInviteUser")]: "inviteUser",
|
||||||
|
[t("actionRemoveInvitation")]: "removeInvitation",
|
||||||
[t("actionListInvitations")]: "listInvitations",
|
[t("actionListInvitations")]: "listInvitations",
|
||||||
[t("actionRemoveUser")]: "removeUser",
|
[t("actionRemoveUser")]: "removeUser",
|
||||||
[t("actionListUsers")]: "listUsers",
|
[t("actionListUsers")]: "listUsers",
|
||||||
|
|||||||
Reference in New Issue
Block a user