Skip to content

Commit

Permalink
[WIP] implement scoped rules, remove #authority and #ambient
Browse files Browse the repository at this point in the history
the scoped execution model ensures that checks and rules only
have access to facts added or generated in the current or previous
blocks. They cannot be affected by facts from later blocks. Verifier
rules, checks and policies are executed in the context of the authority
block

Since this change can prevent check from the authority block and the
verifier from being affected by facts from later block, we can remove
the #authority and #ambient symbols

TODO:
- update the spec
  • Loading branch information
Geal committed Sep 5, 2021
1 parent e5ea1c1 commit 035941d
Show file tree
Hide file tree
Showing 24 changed files with 519 additions and 437 deletions.
566 changes: 340 additions & 226 deletions samples/v2/README.md

Large diffs are not rendered by default.

340 changes: 156 additions & 184 deletions samples/v2/samples.json

Large diffs are not rendered by default.

Binary file removed samples/v2/test10_authority_rules.bc
Binary file not shown.
Binary file added samples/v2/test10_verifier_scope.bc
Binary file not shown.
Binary file modified samples/v2/test11_verifier_authority_caveats.bc
Binary file not shown.
12 changes: 6 additions & 6 deletions samples/v2/test12_authority_caveats.bc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
�
,
check12

"file1"file1 D�S�K 6e@�����{��HPc��G!���c\@�c��6�I�;�g��g�2�/�7�YZ.�����e�ý�ɻY�ݫ�R_Di�/�EV>l""
<���thT�d�2f�u��h�̍��kn�–
�
(
check12

"file1 "file1 ܤ����x�7�ɇ�H _�O� U/����@&�3�v�n���bX����3��%���c8���Fy8'�=ًƒQG�P�\�ت�*/�Ѫ��w ""
��F�w�n*b�J��X���oZ�:�� z�b�3q
Expand Down
Binary file modified samples/v2/test13_block_rules.bc
Binary file not shown.
15 changes: 7 additions & 8 deletions samples/v2/test14_regex_constraint.bc
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
�
O
�
K
resource_match
028
6


024
2




"file[0-9]+.txt
 ;�69Xy�oC?���B�s�-+�3P1knar@(���%"dOE�iD������a%h1��{j�0%�]�w<��/�!���\����������l�n��""
�9���b�/�9n������J-?��P�=��
 ι�G���V��`*k��)��_��<�^dM'�B@��:��y{�1�����.�(:�SA�ʄ ��B`�ԎL��(��ji��gJ�7ˊ����vz""
�Ɩ��]�<T�~�Eq��2��e�p���9QS�
Expand Down
Binary file modified samples/v2/test15_multi_queries_caveats.bc
Binary file not shown.
Binary file modified samples/v2/test16_caveat_head_name.bc
Binary file not shown.
Binary file modified samples/v2/test17_expressions.bc
Binary file not shown.
Binary file modified samples/v2/test18_unbound_variables_in_rule.bc
Binary file not shown.
23 changes: 10 additions & 13 deletions samples/v2/test19_generating_ambient_from_variables.bc
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
�
.
�
*
check1
test
read2


  u�"^r�9SQ&^���$�|��V0�p&>:蟬@39�6� ѽ��h�S� y��͇&Z勼���:�I�{”�N�A��}�NZC��!� ���l�"#�
!
any*

 

 <���l�� >?�}���#�-0 �X����r@w�;ZZ������|ҙ) ��q��rZ��J�x��K��L.<9�]:9���K�LD*1��I�a3""
P����9�ʾ{t��U�tp�~��R�dt��)
read2

  ���D��~[� N�$�PZ�!�����؃��@�Um ��|>�-SL4?^���9ԉ�f��H�q�����E�@�������O��Ѿ}@�

any*
 
 �a�0�c���L�BlA|3�(Z�=��R��:��@�w�T�u�;��)��DUQAKy"}��3r�Ą�"�h�˨ރ��E� �{ύ�р~�WӁ{�`""
��+o\�� ���eȽs�����6G�;�cFwa�
Expand Down
Binary file modified samples/v2/test1_basic.bc
Binary file not shown.
Binary file modified samples/v2/test2_different_root_key.bc
Binary file not shown.
Binary file modified samples/v2/test3_invalid_signature_format.bc
Binary file not shown.
Binary file modified samples/v2/test4_random_block.bc
Binary file not shown.
Binary file modified samples/v2/test5_invalid_signature.bc
Binary file not shown.
Binary file modified samples/v2/test6_reordered_blocks.bc
Binary file not shown.
Binary file removed samples/v2/test7_invalid_block_fact_authority.bc
Binary file not shown.
Binary file added samples/v2/test7_scoped_rules.bc
Binary file not shown.
Binary file removed samples/v2/test8_invalid_block_fact_ambient.bc
Binary file not shown.
Binary file added samples/v2/test8_scoped_checks.bc
Binary file not shown.
Binary file modified samples/v2/test9_expired_token.bc
Binary file not shown.

0 comments on commit 035941d

Please sign in to comment.