@@ -302,7 +302,7 @@ public function setUpFlatAndScenario(): void
302302
303303 $ this ->rootChain = AbacChain::query ()->create ([
304304 'operator ' => LogicalOperators::AND ->value ,
305- 'policy_id ' => 'policy-1 ' ,
305+ '_policy ' => 'policy-1 ' ,
306306 ]);
307307
308308 $ this ->createCheck ($ this ->rootChain ->getKey (), ArithmeticOperators::EQUALS ->value , 'resource.category ' , 'public ' );
@@ -318,7 +318,7 @@ public function setUpFlatAndStringScenario(): void
318318
319319 $ this ->rootChain = AbacChain::query ()->create ([
320320 'operator ' => LogicalOperators::AND ->value ,
321- 'policy_id ' => 'policy-1 ' ,
321+ '_policy ' => 'policy-1 ' ,
322322 ]);
323323
324324 $ this ->createCheck ($ this ->rootChain ->getKey (), StringOperators::STARTS_WITH ->value , 'resource.category ' , 'pub ' );
@@ -335,22 +335,22 @@ public function setUpNestedOrScenario(): void
335335
336336 $ this ->rootChain = AbacChain::query ()->create ([
337337 'operator ' => LogicalOperators::OR ->value ,
338- 'policy_id ' => 'policy-1 ' ,
338+ '_policy ' => 'policy-1 ' ,
339339 ]);
340340
341341 $ left = AbacChain::query ()->create ([
342342 'operator ' => LogicalOperators::AND ->value ,
343- 'chain_id ' => $ this ->rootChain ->getKey (),
343+ '_chain ' => $ this ->rootChain ->getKey (),
344344 ]);
345345
346346 $ right = AbacChain::query ()->create ([
347347 'operator ' => LogicalOperators::AND ->value ,
348- 'chain_id ' => $ this ->rootChain ->getKey (),
348+ '_chain ' => $ this ->rootChain ->getKey (),
349349 ]);
350350
351351 $ middle = AbacChain::query ()->create ([
352352 'operator ' => LogicalOperators::AND ->value ,
353- 'chain_id ' => $ this ->rootChain ->getKey (),
353+ '_chain ' => $ this ->rootChain ->getKey (),
354354 ]);
355355
356356 $ this ->createCheck ($ left ->getKey (), ArithmeticOperators::EQUALS ->value , 'resource.region ' , 'emea ' );
@@ -372,37 +372,37 @@ public function setUpNestedOrDeepScenario(): void
372372
373373 $ this ->rootChain = AbacChain::query ()->create ([
374374 'operator ' => LogicalOperators::OR ->value ,
375- 'policy_id ' => 'policy-1 ' ,
375+ '_policy ' => 'policy-1 ' ,
376376 ]);
377377
378378 $ leftGroup = AbacChain::query ()->create ([
379379 'operator ' => LogicalOperators::OR ->value ,
380- 'chain_id ' => $ this ->rootChain ->getKey (),
380+ '_chain ' => $ this ->rootChain ->getKey (),
381381 ]);
382382
383383 $ rightGroup = AbacChain::query ()->create ([
384384 'operator ' => LogicalOperators::OR ->value ,
385- 'chain_id ' => $ this ->rootChain ->getKey (),
385+ '_chain ' => $ this ->rootChain ->getKey (),
386386 ]);
387387
388388 $ leftA = AbacChain::query ()->create ([
389389 'operator ' => LogicalOperators::AND ->value ,
390- 'chain_id ' => $ leftGroup ->getKey (),
390+ '_chain ' => $ leftGroup ->getKey (),
391391 ]);
392392
393393 $ leftB = AbacChain::query ()->create ([
394394 'operator ' => LogicalOperators::AND ->value ,
395- 'chain_id ' => $ leftGroup ->getKey (),
395+ '_chain ' => $ leftGroup ->getKey (),
396396 ]);
397397
398398 $ rightA = AbacChain::query ()->create ([
399399 'operator ' => LogicalOperators::AND ->value ,
400- 'chain_id ' => $ rightGroup ->getKey (),
400+ '_chain ' => $ rightGroup ->getKey (),
401401 ]);
402402
403403 $ rightB = AbacChain::query ()->create ([
404404 'operator ' => LogicalOperators::AND ->value ,
405- 'chain_id ' => $ rightGroup ->getKey (),
405+ '_chain ' => $ rightGroup ->getKey (),
406406 ]);
407407
408408 $ this ->createCheck ($ leftA ->getKey (), ArithmeticOperators::EQUALS ->value , 'resource.region ' , 'emea ' );
@@ -425,7 +425,7 @@ public function setUpActorCheckScenario(): void
425425
426426 $ this ->rootChain = AbacChain::query ()->create ([
427427 'operator ' => LogicalOperators::AND ->value ,
428- 'policy_id ' => 'policy-1 ' ,
428+ '_policy ' => 'policy-1 ' ,
429429 ]);
430430
431431 $ this ->createCheck ($ this ->rootChain ->getKey (), ArithmeticOperators::EQUALS ->value , 'resource.region ' , 'emea ' );
@@ -441,7 +441,7 @@ public function setUpActorCheckVariantScenario(): void
441441
442442 $ this ->rootChain = AbacChain::query ()->create ([
443443 'operator ' => LogicalOperators::AND ->value ,
444- 'policy_id ' => 'policy-1 ' ,
444+ '_policy ' => 'policy-1 ' ,
445445 ]);
446446
447447 $ this ->createCheck ($ this ->rootChain ->getKey (), ArithmeticOperators::EQUALS ->value , 'resource.category ' , 'public ' );
@@ -541,13 +541,13 @@ protected function setUpComprehensiveScenario(PolicyMethod $method, int $postCou
541541
542542 $ this ->rootChain = AbacChain::query ()->create ([
543543 'operator ' => LogicalOperators::OR ->value ,
544- 'policy_id ' => 'policy-1 ' ,
544+ '_policy ' => 'policy-1 ' ,
545545 ]);
546546
547547 for ($ i = 0 ; $ i < $ branchCount ; $ i ++) {
548548 $ group = AbacChain::query ()->create ([
549549 'operator ' => $ i % 2 === 0 ? LogicalOperators::AND ->value : LogicalOperators::OR ->value ,
550- 'chain_id ' => $ this ->rootChain ->getKey (),
550+ '_chain ' => $ this ->rootChain ->getKey (),
551551 ]);
552552
553553 $ this ->attachResourceArithmeticChecks ($ group ->getKey (), $ i );
@@ -612,14 +612,14 @@ private function bootstrapDatabase(): void
612612 $ schema ->create ('abac_chains ' , function (Blueprint $ table ): void {
613613 $ table ->uuid ('_id ' )->primary ();
614614 $ table ->string ('operator ' );
615- $ table ->uuid ('chain_id ' )->nullable ();
616- $ table ->uuid ('policy_id ' )->nullable ();
615+ $ table ->uuid ('_chain ' )->nullable ();
616+ $ table ->uuid ('_policy ' )->nullable ();
617617 $ table ->timestamps ();
618618 });
619619
620620 $ schema ->create ('abac_checks ' , function (Blueprint $ table ): void {
621621 $ table ->uuid ('_id ' )->primary ();
622- $ table ->uuid ('chain_id ' );
622+ $ table ->uuid ('_chain ' );
623623 $ table ->string ('operator ' );
624624 $ table ->string ('key ' );
625625 $ table ->string ('value ' );
@@ -732,7 +732,7 @@ protected function attachActorStringChecks(string $chainId, int $offset): void
732732 protected function createCheck (string $ chainId , string $ operator , string $ key , string $ value ): void
733733 {
734734 AbacCheck::query ()->create ([
735- 'chain_id ' => $ chainId ,
735+ '_chain ' => $ chainId ,
736736 'operator ' => $ operator ,
737737 'key ' => $ key ,
738738 'value ' => $ value ,
0 commit comments