feat: add schema user create and remove (#8494)

# Which Problems Are Solved

Added functionality that user with a userschema can be created and
removed.

# How the Problems Are Solved

Added logic and moved APIs so that everything is API v3 conform.

# Additional Changes

- move of user and userschema API to resources folder
- changed testing and parameters
- some renaming

# Additional Context

closes #7308

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
Stefan Benz
2024-08-28 21:46:45 +02:00
committed by GitHub
parent 90b908c361
commit 41ae35f2ef
61 changed files with 5766 additions and 2247 deletions

View File

@@ -14,7 +14,7 @@ import (
func TestPermissionExtension(t *testing.T) {
type args struct {
role role
role Role
schema string
instance string
}
@@ -83,7 +83,7 @@ func TestPermissionExtension(t *testing.T) {
},
},
{
"invalid role, compilation err",
"invalid Role, compilation err",
args{
schema: `{
"type": "object",
@@ -98,13 +98,13 @@ func TestPermissionExtension(t *testing.T) {
}`,
},
want{
compilationErr: zerrors.ThrowInvalidArgument(nil, "SCHEMA-GFjio", "invalid permission role"),
compilationErr: zerrors.ThrowInvalidArgument(nil, "SCHEMA-GFjio", "invalid permission Role"),
},
},
{
"invalid permission self, validation err",
args{
role: roleSelf,
role: RoleSelf,
schema: `{
"type": "object",
"properties": {
@@ -126,7 +126,7 @@ func TestPermissionExtension(t *testing.T) {
{
"invalid permission owner, validation err",
args{
role: roleOwner,
role: RoleOwner,
schema: `{
"type": "object",
"properties": {
@@ -148,7 +148,7 @@ func TestPermissionExtension(t *testing.T) {
{
"valid permission self, ok",
args{
role: roleSelf,
role: RoleSelf,
schema: `{
"type": "object",
"properties": {
@@ -170,7 +170,7 @@ func TestPermissionExtension(t *testing.T) {
{
"valid permission owner, ok",
args{
role: roleOwner,
role: RoleOwner,
schema: `{
"type": "object",
"properties": {
@@ -190,9 +190,9 @@ func TestPermissionExtension(t *testing.T) {
},
},
{
"no role, validation err",
"no Role, validation err",
args{
role: roleUnspecified,
role: RoleUnspecified,
schema: `{
"type": "object",
"properties": {
@@ -214,7 +214,7 @@ func TestPermissionExtension(t *testing.T) {
{
"no permission required, ok",
args{
role: roleSelf,
role: RoleSelf,
schema: `{
"type": "object",
"properties": {