Skip to content

Commit

Permalink
Merge pull request #14 from permitio/asaf/per-5606-rebac-java-sdk-sup…
Browse files Browse the repository at this point in the history
…port

Java SDK ReBAC support
  • Loading branch information
Asaf Cohen authored Jun 26, 2023
2 parents fcba221 + 1f6164b commit 0b8b9b8
Show file tree
Hide file tree
Showing 88 changed files with 5,288 additions and 80 deletions.
25 changes: 25 additions & 0 deletions schemas/derivedrole.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"title": "DerivedRole",
"required": [
"settings",
"rules"
],
"type": "object",
"properties": {
"conditions": {
"title": "Conditions",
"type": "string"
},
"settings": {
"existingJavaType": "io.permit.sdk.openapi.models.DerivedRoleSettings"
},
"rules": {
"title": "Rules",
"type": "array",
"items": {
"$ref": "DerivedRoleRule.json"
}
}
},
"$schema": "http://json-schema.org/schema#"
}
34 changes: 34 additions & 0 deletions schemas/derivedroleblockedit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title": "DerivedRoleBlockEdit",
"type": "object",
"properties": {
"when": {
"title": "When",
"existingJavaType": "io.permit.sdk.openapi.models.DerivedRoleSettings",
"description": "the settings of the derived role",
"default": {
"no_direct_roles_on_object": false
}
},
"users_with_role": {
"title": "Users With Role",
"type": "array",
"items": {
"$ref": "DerivedRoleRuleCreate.json"
},
"description": "the rules of the derived role",
"default": []
}
},
"additionalProperties": false,
"example": {
"users_with_role": [
{
"role": "Admin",
"on_resource": "organization",
"linked_by_relation": "owner"
}
]
},
"$schema": "http://json-schema.org/schema#"
}
44 changes: 44 additions & 0 deletions schemas/derivedroleblockread.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"title": "DerivedRoleBlockRead",
"required": ["id"],
"type": "object",
"properties": {
"when": {
"title": "When",
"existingJavaType": "io.permit.sdk.openapi.models.DerivedRoleSettings",
"description": "the settings of the derived role",
"default": {
"no_direct_roles_on_object": false
}
},
"id": {
"title": "Id",
"type": "string",
"description": "The unique id of the derived_role"
},
"users_with_role": {
"title": "Users With Role",
"type": "array",
"items": {
"$ref": "DerivedRoleRuleRead.json"
},
"description": "the rules of the derived role",
"default": []
}
},
"additionalProperties": false,
"example": {
"id": "2a19e318-1965-4170-9045-a1c83bf2d821",
"users_with_role": [
{
"role": "Admin",
"on_resource": "organization",
"linked_by_relation": "owner",
"role_id": "bf01c795-c36a-4a3a-8cab-34253e9a9b25",
"resource_id": "b436cb2d-a0f9-4a59-a97c-57d8a2a61d49",
"relation_id": "d7fa434c-3c90-44ae-a811-e39a84337135"
}
]
},
"$schema": "http://json-schema.org/schema#"
}
24 changes: 24 additions & 0 deletions schemas/derivedrolerule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"title": "DerivedRoleRule",
"required": [
"relation",
"related_resource",
"related_role"
],
"type": "object",
"properties": {
"relation": {
"title": "Relation",
"type": "string"
},
"related_resource": {
"title": "Related Resource",
"type": "string"
},
"related_role": {
"title": "Related Role",
"type": "string"
}
},
"$schema": "http://json-schema.org/schema#"
}
33 changes: 33 additions & 0 deletions schemas/derivedrolerulecreate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"title": "DerivedRoleRuleCreate",
"required": [
"role",
"on_resource",
"linked_by_relation"
],
"type": "object",
"properties": {
"role": {
"title": "Role",
"type": "string",
"description": "the role key that needs to exist on the related resource (from the relation)"
},
"on_resource": {
"title": "On Resource",
"type": "string",
"description": "the resource key that needs to exist on the related role (from the relation)"
},
"linked_by_relation": {
"title": "Linked By Relation",
"type": "string",
"description": "the relation key that needs to exist between the resource and the related resource"
}
},
"additionalProperties": false,
"example": {
"role": "Admin",
"on_resource": "organization",
"linked_by_relation": "owner"
},
"$schema": "http://json-schema.org/schema#"
}
33 changes: 33 additions & 0 deletions schemas/derivedroleruledelete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"title": "DerivedRoleRuleDelete",
"required": [
"role",
"on_resource",
"linked_by_relation"
],
"type": "object",
"properties": {
"role": {
"title": "Role",
"type": "string",
"description": "the role key that needs to exist on the related resource (from the relation)"
},
"on_resource": {
"title": "On Resource",
"type": "string",
"description": "the resource key that needs to exist on the related role (from the relation)"
},
"linked_by_relation": {
"title": "Linked By Relation",
"type": "string",
"description": "the relation key that needs to exist between the resource and the related resource"
}
},
"additionalProperties": false,
"example": {
"role": "Admin",
"on_resource": "organization",
"linked_by_relation": "owner"
},
"$schema": "http://json-schema.org/schema#"
}
54 changes: 54 additions & 0 deletions schemas/derivedroleruleread.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"title": "DerivedRoleRuleRead",
"required": [
"role_id",
"resource_id",
"relation_id",
"role",
"on_resource",
"linked_by_relation"
],
"type": "object",
"properties": {
"role_id": {
"title": "Role Id",
"type": "string",
"description": "the role id that needs to exist on the related resource (from the relation)"
},
"resource_id": {
"title": "Resource Id",
"type": "string",
"description": "the resource id that needs to exist on the related role (from the relation)"
},
"relation_id": {
"title": "Relation Id",
"type": "string",
"description": "the relation id that needs to exist between the resource and the related resource"
},
"role": {
"title": "Role",
"type": "string",
"description": "the role key that needs to exist on the related resource (from the relation)"
},
"on_resource": {
"title": "On Resource",
"type": "string",
"description": "the resource key that needs to exist on the related role (from the relation)"
},
"linked_by_relation": {
"title": "Linked By Relation",
"type": "string",
"description": "the relation key that needs to exist between the resource and the related resource"
}
},
"additionalProperties": false,
"example": {
"role": "Admin",
"on_resource": "organization",
"linked_by_relation": "owner",
"role_id": "bf01c795-c36a-4a3a-8cab-34253e9a9b25",
"resource_id": "b436cb2d-a0f9-4a59-a97c-57d8a2a61d49",
"relation_id": "d7fa434c-3c90-44ae-a811-e39a84337135"
},
"$schema": "http://json-schema.org/schema#"
}
31 changes: 31 additions & 0 deletions schemas/paginatedresult_conditionsetread_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"title": "PaginatedResult[ConditionSetRead]",
"required": [
"data",
"total_count"
],
"type": "object",
"properties": {
"data": {
"title": "Data",
"type": "array",
"items": {
"$ref": "ConditionSetRead.json"
},
"description": "List of Condition Sets"
},
"total_count": {
"title": "Total Count",
"minimum": 0.0,
"type": "integer"
},
"page_count": {
"title": "Page Count",
"minimum": 0.0,
"type": "integer",
"default": 0
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/schema#"
}
31 changes: 31 additions & 0 deletions schemas/paginatedresult_relationread_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"title": "PaginatedResult[RelationRead]",
"required": [
"data",
"total_count"
],
"type": "object",
"properties": {
"data": {
"title": "Data",
"type": "array",
"items": {
"$ref": "RelationRead.json"
},
"description": "List of Relations"
},
"total_count": {
"title": "Total Count",
"minimum": 0.0,
"type": "integer"
},
"page_count": {
"title": "Page Count",
"minimum": 0.0,
"type": "integer",
"default": 0
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/schema#"
}
31 changes: 31 additions & 0 deletions schemas/paginatedresult_resourceread_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"title": "PaginatedResult[ResourceRead]",
"required": [
"data",
"total_count"
],
"type": "object",
"properties": {
"data": {
"title": "Data",
"type": "array",
"items": {
"$ref": "ResourceRead.json"
},
"description": "List of Resources"
},
"total_count": {
"title": "Total Count",
"minimum": 0.0,
"type": "integer"
},
"page_count": {
"title": "Page Count",
"minimum": 0.0,
"type": "integer",
"default": 0
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/schema#"
}
31 changes: 31 additions & 0 deletions schemas/paginatedresult_roleread_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"title": "PaginatedResult[RoleRead]",
"required": [
"data",
"total_count"
],
"type": "object",
"properties": {
"data": {
"title": "Data",
"type": "array",
"items": {
"$ref": "RoleRead.json"
},
"description": "List of Roles"
},
"total_count": {
"title": "Total Count",
"minimum": 0.0,
"type": "integer"
},
"page_count": {
"title": "Page Count",
"minimum": 0.0,
"type": "integer",
"default": 0
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/schema#"
}
Loading

0 comments on commit 0b8b9b8

Please sign in to comment.