diff --git a/README.md b/README.md index a86d943..46050af 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,51 @@ Converts directory check assertions into authorizer check_decision assertions +## Usage + +``` +Usage: check2decision [flags] + +converts directory check assertions into authorizer check_decision assertions + +Flags: + -h, --help Show context-sensitive help. + -i, --input=STRING assertions file path + -o, --output=STRING decisions file path + --policy-name="policy-rebac" policy name + --policy-path="rebac.check" policy package path + --policy-rule="allowed" policy rule name + --identity-type="sub" identity type (sub|jwt|manual|none) + --stdin read input from StdIn + --version version info +``` + +## Example + +Install the gdrive template using: + +``` +topaz templates install gdrive --force +``` + +Execute directory check assertions + +``` +topaz ds test exec $(topaz config info config.topaz_tmpl_dir -r)/gdrive/assertions/gdrive_assertions.json +``` + +Convert directory check assertions into authorizer decisions + +``` +GDRIVE_ASSERTIONS_DIR=$(topaz config info config.topaz_tmpl_dir -r)/gdrive/assertions +check2decision -i ${GDRIVE_ASSERTIONS_DIR}/gdrive_assertions.json -o ${GDRIVE_ASSERTIONS_DIR}/gdrive_decisions.json +``` + +Execute authorizer decision assertions + +``` +topaz az test exec ${GDRIVE_ASSERTIONS_DIR}/gdrive_decisions.json +``` + +## Installation + diff --git a/api/check2decision.pb.go b/api/check2decision.pb.go index 5a7f28c..0c44796 100644 --- a/api/check2decision.pb.go +++ b/api/check2decision.pb.go @@ -77,6 +77,53 @@ func (x *CheckAssertion) GetExpected() bool { return false } +type CheckAssertions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Assertions []*CheckAssertion `protobuf:"bytes,1,rep,name=assertions,proto3" json:"assertions,omitempty"` +} + +func (x *CheckAssertions) Reset() { + *x = CheckAssertions{} + if protoimpl.UnsafeEnabled { + mi := &file_check2decision_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckAssertions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckAssertions) ProtoMessage() {} + +func (x *CheckAssertions) ProtoReflect() protoreflect.Message { + mi := &file_check2decision_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckAssertions.ProtoReflect.Descriptor instead. +func (*CheckAssertions) Descriptor() ([]byte, []int) { + return file_check2decision_proto_rawDescGZIP(), []int{1} +} + +func (x *CheckAssertions) GetAssertions() []*CheckAssertion { + if x != nil { + return x.Assertions + } + return nil +} + type DecisionAssertion struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -89,7 +136,7 @@ type DecisionAssertion struct { func (x *DecisionAssertion) Reset() { *x = DecisionAssertion{} if protoimpl.UnsafeEnabled { - mi := &file_check2decision_proto_msgTypes[1] + mi := &file_check2decision_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -102,7 +149,7 @@ func (x *DecisionAssertion) String() string { func (*DecisionAssertion) ProtoMessage() {} func (x *DecisionAssertion) ProtoReflect() protoreflect.Message { - mi := &file_check2decision_proto_msgTypes[1] + mi := &file_check2decision_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -115,7 +162,7 @@ func (x *DecisionAssertion) ProtoReflect() protoreflect.Message { // Deprecated: Use DecisionAssertion.ProtoReflect.Descriptor instead. func (*DecisionAssertion) Descriptor() ([]byte, []int) { - return file_check2decision_proto_rawDescGZIP(), []int{1} + return file_check2decision_proto_rawDescGZIP(), []int{2} } func (x *DecisionAssertion) GetCheckDecision() *v2.IsRequest { @@ -132,6 +179,53 @@ func (x *DecisionAssertion) GetExpected() bool { return false } +type DecisionAssertions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Assertions []*DecisionAssertion `protobuf:"bytes,1,rep,name=assertions,proto3" json:"assertions,omitempty"` +} + +func (x *DecisionAssertions) Reset() { + *x = DecisionAssertions{} + if protoimpl.UnsafeEnabled { + mi := &file_check2decision_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecisionAssertions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecisionAssertions) ProtoMessage() {} + +func (x *DecisionAssertions) ProtoReflect() protoreflect.Message { + mi := &file_check2decision_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecisionAssertions.ProtoReflect.Descriptor instead. +func (*DecisionAssertions) Descriptor() ([]byte, []int) { + return file_check2decision_proto_rawDescGZIP(), []int{3} +} + +func (x *DecisionAssertions) GetAssertions() []*DecisionAssertion { + if x != nil { + return x.Assertions + } + return nil +} + var File_check2decision_proto protoreflect.FileDescriptor var file_check2decision_proto_rawDesc = []byte{ @@ -150,17 +244,30 @@ var file_check2decision_proto_rawDesc = []byte{ 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, - 0x77, 0x0a, 0x11, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x64, 0x65, - 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, - 0x73, 0x65, 0x72, 0x74, 0x6f, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x73, 0x65, 0x72, 0x74, 0x6f, 0x2d, 0x64, 0x65, - 0x76, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x32, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5c, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x49, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x73, 0x65, 0x72, 0x74, 0x6f, 0x2e, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x32, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x77, 0x0a, + 0x11, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x63, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x73, 0x65, + 0x72, 0x74, 0x6f, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0x62, 0x0a, 0x12, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x0a, + 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x61, 0x73, 0x65, 0x72, 0x74, 0x6f, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x32, + 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x73, 0x65, 0x72, 0x74, 0x6f, 0x2d, + 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x32, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -175,21 +282,25 @@ func file_check2decision_proto_rawDescGZIP() []byte { return file_check2decision_proto_rawDescData } -var file_check2decision_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_check2decision_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_check2decision_proto_goTypes = []any{ - (*CheckAssertion)(nil), // 0: aserto.check2decision.api.CheckAssertion - (*DecisionAssertion)(nil), // 1: aserto.check2decision.api.DecisionAssertion - (*v3.CheckRequest)(nil), // 2: aserto.directory.reader.v3.CheckRequest - (*v2.IsRequest)(nil), // 3: aserto.authorizer.v2.IsRequest + (*CheckAssertion)(nil), // 0: aserto.check2decision.api.CheckAssertion + (*CheckAssertions)(nil), // 1: aserto.check2decision.api.CheckAssertions + (*DecisionAssertion)(nil), // 2: aserto.check2decision.api.DecisionAssertion + (*DecisionAssertions)(nil), // 3: aserto.check2decision.api.DecisionAssertions + (*v3.CheckRequest)(nil), // 4: aserto.directory.reader.v3.CheckRequest + (*v2.IsRequest)(nil), // 5: aserto.authorizer.v2.IsRequest } var file_check2decision_proto_depIdxs = []int32{ - 2, // 0: aserto.check2decision.api.CheckAssertion.check:type_name -> aserto.directory.reader.v3.CheckRequest - 3, // 1: aserto.check2decision.api.DecisionAssertion.check_decision:type_name -> aserto.authorizer.v2.IsRequest - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 0: aserto.check2decision.api.CheckAssertion.check:type_name -> aserto.directory.reader.v3.CheckRequest + 0, // 1: aserto.check2decision.api.CheckAssertions.assertions:type_name -> aserto.check2decision.api.CheckAssertion + 5, // 2: aserto.check2decision.api.DecisionAssertion.check_decision:type_name -> aserto.authorizer.v2.IsRequest + 2, // 3: aserto.check2decision.api.DecisionAssertions.assertions:type_name -> aserto.check2decision.api.DecisionAssertion + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_check2decision_proto_init() } @@ -211,6 +322,18 @@ func file_check2decision_proto_init() { } } file_check2decision_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*CheckAssertions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_check2decision_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DecisionAssertion); i { case 0: return &v.state @@ -222,6 +345,18 @@ func file_check2decision_proto_init() { return nil } } + file_check2decision_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*DecisionAssertions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -229,7 +364,7 @@ func file_check2decision_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_check2decision_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/decisions.json b/check_decisions.json similarity index 80% rename from decisions.json rename to check_decisions.json index d435f38..acb04d2 100644 --- a/decisions.json +++ b/check_decisions.json @@ -2,4304 +2,4491 @@ "assertions": [ { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "root", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "summer", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "jerry", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared", "object_type": "folder", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, - { - "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, + { + "check_decision": { "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "secrets", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "groceries", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "rick.inventions", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "beth@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "beth@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "rick@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "rick@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "owner" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "morty@the-citadel.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "morty@the-citadel.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "summer@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "summer@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_read" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": true }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_write" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_share" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false }, { "check_decision": { - "identity_context": { - "identity": "jerry@the-smiths.com", - "type": "IDENTITY_TYPE_SUB" - }, "policy_context": { + "path": "rebac.check", "decisions": [ "allowed" - ], - "path": "rebac.check" + ] }, - "policy_instance": { - "name": "policy-rebac" + "identity_context": { + "identity": "jerry@the-smiths.com", + "type": "IDENTITY_TYPE_SUB" }, "resource_context": { "object_id": "morty.shared.notes", "object_type": "doc", "relation": "can_delete" + }, + "policy_instance": { + "name": "policy-rebac", + "instance_label": "" } }, "expected": false } ] -} +} \ No newline at end of file diff --git a/pkg/cmd/convert.go b/pkg/cmd/convert.go index b85ef50..571bba4 100644 --- a/pkg/cmd/convert.go +++ b/pkg/cmd/convert.go @@ -1,8 +1,8 @@ package cmd import ( + "bytes" "context" - "encoding/json" "fmt" "os" "strings" @@ -15,6 +15,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" ) type ConvertCmd struct { @@ -51,12 +52,8 @@ func (cmd *ConvertCmd) Run(ctx context.Context) error { return nil } -type CheckAssertions struct { - Assertions []*api.CheckAssertion `json:"assertions"` -} - -func (cmd *ConvertCmd) load(_ context.Context) (*CheckAssertions, error) { - a := CheckAssertions{} +func (cmd *ConvertCmd) load(_ context.Context) (*api.CheckAssertions, error) { + a := &api.CheckAssertions{} var r *os.File @@ -78,20 +75,29 @@ func (cmd *ConvertCmd) load(_ context.Context) (*CheckAssertions, error) { } defer r.Close() - dec := json.NewDecoder(r) - if err := dec.Decode(&a); err != nil { + buf := bytes.Buffer{} + if _, err := buf.ReadFrom(r); err != nil { return nil, err } - return &a, nil + uOpts := protojson.UnmarshalOptions{ + AllowPartial: true, + DiscardUnknown: true, + } + + if err := uOpts.Unmarshal(buf.Bytes(), a); err != nil { + return nil, err + } + + return a, nil } type DecisionAssertions struct { Assertions []*api.DecisionAssertion `json:"assertions"` } -func (cmd *ConvertCmd) transform(_ context.Context, a *CheckAssertions) *DecisionAssertions { - d := DecisionAssertions{} +func (cmd *ConvertCmd) transform(_ context.Context, a *api.CheckAssertions) *api.DecisionAssertions { + d := &api.DecisionAssertions{} identityType := aza2.IdentityType(aza2.IdentityType_value["IDENTITY_TYPE_"+strings.ToUpper(cmd.IdentityType)]) @@ -120,10 +126,10 @@ func (cmd *ConvertCmd) transform(_ context.Context, a *CheckAssertions) *Decisio d.Assertions = append(d.Assertions, &decision) } - return &d + return d } -func (cmd *ConvertCmd) persist(_ context.Context, d *DecisionAssertions) error { +func (cmd *ConvertCmd) persist(_ context.Context, d *api.DecisionAssertions) error { var w *os.File w = os.Stdout @@ -136,10 +142,20 @@ func (cmd *ConvertCmd) persist(_ context.Context, d *DecisionAssertions) error { } defer w.Close() - enc := json.NewEncoder(w) - enc.SetEscapeHTML(false) - enc.SetIndent("", " ") - if err := enc.Encode(d); err != nil { + buf, err := protojson.MarshalOptions{ + Multiline: true, + Indent: " ", + AllowPartial: true, + UseProtoNames: true, + UseEnumNumbers: false, + EmitUnpopulated: false, + EmitDefaultValues: true, + }.Marshal(d) + if err != nil { + return err + } + + if _, err := w.Write(buf); err != nil { return err } diff --git a/check_test.go b/pkg/cmd/convert_test.go similarity index 74% rename from check_test.go rename to pkg/cmd/convert_test.go index aefbcd9..93fb12f 100644 --- a/check_test.go +++ b/pkg/cmd/convert_test.go @@ -1,7 +1,7 @@ -package check2decision_test +package cmd_test import ( - "encoding/json" + "bytes" "os" "testing" @@ -43,15 +43,22 @@ func TestCheck1(t *testing.T) { } func TestCheck2(t *testing.T) { - a := struct { - Assertions []*api.CheckAssertion `json:"assertions"` - }{} + a := &api.CheckAssertions{} - r, err := os.Open("./checks.json") + r, err := os.Open("../../checks.json") assert.NoError(t, err) - dec := json.NewDecoder(r) - if err := dec.Decode(&a); err != nil { + b := bytes.Buffer{} + if _, err := b.ReadFrom(r); err != nil { + assert.NoError(t, err) + } + + uOpts := protojson.UnmarshalOptions{ + AllowPartial: true, + DiscardUnknown: true, + } + + if err := uOpts.Unmarshal(b.Bytes(), a); err != nil { assert.NoError(t, err) } @@ -70,19 +77,28 @@ func TestCheck2(t *testing.T) { } func TestCheck3(t *testing.T) { - a := struct { - Assertions []*api.CheckAssertion `json:"assertions"` - }{} + a := &api.CheckAssertions{} - r, err := os.Open("./checks.json") + r, err := os.Open("../../checks.json") assert.NoError(t, err) - dec := json.NewDecoder(r) - if err := dec.Decode(&a); err != nil { + b := bytes.Buffer{} + if _, err := b.ReadFrom(r); err != nil { assert.NoError(t, err) } - var decisions []*api.DecisionAssertion + uOpts := protojson.UnmarshalOptions{ + AllowPartial: true, + DiscardUnknown: true, + } + + if err := uOpts.Unmarshal(b.Bytes(), a); err != nil { + assert.NoError(t, err) + } + + d := api.DecisionAssertions{ + Assertions: []*api.DecisionAssertion{}, + } t.Logf("length a: %d", len(a.Assertions)) @@ -108,18 +124,12 @@ func TestCheck3(t *testing.T) { }, Expected: a.Assertions[i].Expected, } - decisions = append(decisions, &decision) - } - - b := struct { - Assertions []*api.DecisionAssertion `json:"assertions"` - }{ - Assertions: decisions, + d.Assertions = append(d.Assertions, &decision) } - t.Logf("length b: %d", len(b.Assertions)) + t.Logf("length b: %d", len(d.Assertions)) - for i := 0; i < len(b.Assertions); i++ { + for i := 0; i < len(d.Assertions); i++ { t.Logf("%-4d %s:%s#%s@%s:%s - %t", i, a.Assertions[i].Check.ObjectType, diff --git a/proto/check2decision.proto b/proto/check2decision.proto index f711d23..ec44e4a 100644 --- a/proto/check2decision.proto +++ b/proto/check2decision.proto @@ -12,7 +12,15 @@ message CheckAssertion { bool expected = 2; } +message CheckAssertions { + repeated CheckAssertion assertions = 1; +} + message DecisionAssertion { aserto.authorizer.v2.IsRequest check_decision = 1; bool expected = 2; } + +message DecisionAssertions { + repeated DecisionAssertion assertions = 1; +}