feat: add integration access settings (#725)
* feat: add integration access settings * fix: typecheck and test issues * fix: test timeout * chore: address pull request feedback * chore: add throw if action forbidden for integration permissions * fix: unable to create new migrations because of duplicate prevId in sqlite snapshots * chore: add sqlite migration for integration permissions * test: add unit tests for integration access * test: add permission checks to integration router tests * test: add unit test for integration permissions * chore: add mysql migration * fix: format issues
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { integrationKinds, integrationSecretKinds } from "@homarr/definitions";
|
||||
import { integrationKinds, integrationPermissions, integrationSecretKinds } from "@homarr/definitions";
|
||||
|
||||
import { zodEnumFromArray } from "./enums";
|
||||
import { createSavePermissionsSchema } from "./permissions";
|
||||
|
||||
const integrationCreateSchema = z.object({
|
||||
name: z.string().nonempty().max(127),
|
||||
@@ -44,10 +45,13 @@ const testConnectionSchema = z.object({
|
||||
),
|
||||
});
|
||||
|
||||
const savePermissionsSchema = createSavePermissionsSchema(zodEnumFromArray(integrationPermissions));
|
||||
|
||||
export const integrationSchemas = {
|
||||
create: integrationCreateSchema,
|
||||
update: integrationUpdateSchema,
|
||||
delete: idSchema,
|
||||
byId: idSchema,
|
||||
testConnection: testConnectionSchema,
|
||||
savePermissions: savePermissionsSchema,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user