From 527bb42440bab8dda5efbd9f65d18f8ab775c6ef Mon Sep 17 00:00:00 2001 From: "tom.fitzpatrick" Date: Mon, 1 Jul 2024 11:08:32 +0100 Subject: [PATCH] CORE-20721: Add avro definitions to support new Group RestResource (#1666) This adds new avro schemas to support the new RBAC Group Rest Resource. --- .../management/PermissionManagementRequest.avsc | 6 ++++++ .../management/PermissionManagementResponse.avsc | 1 + .../management/group/AddRoleToGroupRequest.avsc | 15 +++++++++++++++ .../group/ChangeGroupParentIdRequest.avsc | 15 +++++++++++++++ .../management/group/CreateGroupRequest.avsc | 15 +++++++++++++++ .../management/group/DeleteGroupRequest.avsc | 11 +++++++++++ .../group/RemoveRoleFromGroupRequest.avsc | 15 +++++++++++++++ .../user/ChangeUserParentGroupIdRequest.avsc | 15 +++++++++++++++ 8 files changed, 93 insertions(+) create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/AddRoleToGroupRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/ChangeGroupParentIdRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/CreateGroupRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/DeleteGroupRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/RemoveRoleFromGroupRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/user/ChangeUserParentGroupIdRequest.avsc diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementRequest.avsc index c3241812ac..edb59b44e8 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementRequest.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementRequest.avsc @@ -19,7 +19,13 @@ { "name": "request", "type": [ + "net.corda.data.permissions.management.group.AddRoleToGroupRequest", + "net.corda.data.permissions.management.group.ChangeGroupParentIdRequest", + "net.corda.data.permissions.management.group.CreateGroupRequest", + "net.corda.data.permissions.management.group.DeleteGroupRequest", + "net.corda.data.permissions.management.group.RemoveRoleFromGroupRequest", "net.corda.data.permissions.management.user.CreateUserRequest", + "net.corda.data.permissions.management.user.ChangeUserParentGroupIdRequest", "net.corda.data.permissions.management.user.ChangeUserPasswordRequest", "net.corda.data.permissions.management.user.AddRoleToUserRequest", "net.corda.data.permissions.management.user.RemoveRoleFromUserRequest", diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementResponse.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementResponse.avsc index 937646ac0c..69356ea577 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementResponse.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/PermissionManagementResponse.avsc @@ -9,6 +9,7 @@ "boolean", "net.corda.data.ExceptionEnvelope", "net.corda.data.permissions.User", + "net.corda.data.permissions.Group", "net.corda.data.permissions.Role", "net.corda.data.permissions.Permission", "net.corda.data.permissions.management.permission.BulkCreatePermissionsResponse" diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/AddRoleToGroupRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/AddRoleToGroupRequest.avsc new file mode 100644 index 0000000000..c79a9fedf9 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/AddRoleToGroupRequest.avsc @@ -0,0 +1,15 @@ +{ + "type": "record", + "name": "AddRoleToGroupRequest", + "namespace": "net.corda.data.permissions.management.group", + "fields": [ + { + "name": "groupId", + "type": "string" + }, + { + "name": "roleId", + "type": "string" + } + ] +} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/ChangeGroupParentIdRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/ChangeGroupParentIdRequest.avsc new file mode 100644 index 0000000000..ae689b837d --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/ChangeGroupParentIdRequest.avsc @@ -0,0 +1,15 @@ +{ + "type": "record", + "name": "ChangeGroupParentIdRequest", + "namespace": "net.corda.data.permissions.management.group", + "fields": [ + { + "name": "groupId", + "type": "string" + }, + { + "name": "newParentGroupId", + "type": [ "null", "string" ] + } + ] +} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/CreateGroupRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/CreateGroupRequest.avsc new file mode 100644 index 0000000000..8859d67c2b --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/CreateGroupRequest.avsc @@ -0,0 +1,15 @@ +{ + "type": "record", + "name": "CreateGroupRequest", + "namespace": "net.corda.data.permissions.management.group", + "fields": [ + { + "name": "groupName", + "type": "string" + }, + { + "name": "parentGroupId", + "type": [ "null", "string" ] + } + ] +} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/DeleteGroupRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/DeleteGroupRequest.avsc new file mode 100644 index 0000000000..cc71917cf0 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/DeleteGroupRequest.avsc @@ -0,0 +1,11 @@ +{ + "type": "record", + "name": "DeleteGroupRequest", + "namespace": "net.corda.data.permissions.management.group", + "fields": [ + { + "name": "groupId", + "type": "string" + } + ] +} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/RemoveRoleFromGroupRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/RemoveRoleFromGroupRequest.avsc new file mode 100644 index 0000000000..0d7c1bdfc7 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/group/RemoveRoleFromGroupRequest.avsc @@ -0,0 +1,15 @@ +{ + "type": "record", + "name": "RemoveRoleFromGroupRequest", + "namespace": "net.corda.data.permissions.management.group", + "fields": [ + { + "name": "groupId", + "type": "string" + }, + { + "name": "roleId", + "type": "string" + } + ] +} \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/user/ChangeUserParentGroupIdRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/user/ChangeUserParentGroupIdRequest.avsc new file mode 100644 index 0000000000..706b4add3f --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/permissions/management/user/ChangeUserParentGroupIdRequest.avsc @@ -0,0 +1,15 @@ +{ + "type": "record", + "name": "ChangeUserParentGroupIdRequest", + "namespace": "net.corda.data.permissions.management.user", + "fields": [ + { + "name": "userId", + "type": "string" + }, + { + "name": "newParentGroupId", + "type": [ "null", "string" ] + } + ] +}