Skip to content

Commit

Permalink
remove the symbol type
Browse files Browse the repository at this point in the history
symbols were a kind of strings with less available operations and some
specific optimizations: they store in index into a symbol table carried
by the token, to reduce size by avoiding repetitions.
They were too confusing for users, and now that #authority and #ambient
are gone, we can remove them completely.
The symbol table was useful though, so now the symbol table is used for
all predicate names and strings
  • Loading branch information
Geal committed Sep 6, 2021
1 parent a0fd497 commit a195fb4
Show file tree
Hide file tree
Showing 22 changed files with 295 additions and 272 deletions.
248 changes: 123 additions & 125 deletions samples/v2/README.md

Large diffs are not rendered by default.

239 changes: 136 additions & 103 deletions samples/v2/samples.json

Large diffs are not rendered by default.

Binary file modified samples/v2/test10_verifier_scope.bc
Binary file not shown.
10 changes: 6 additions & 4 deletions samples/v2/test11_verifier_authority_caveats.bc
@@ -1,5 +1,7 @@
�

read"
"file1 C���[?��P�j*}�Z��m��m|�Iٮ�p��@�޽cx�{���#�����ٷ��y����)}� Y5�qO�k�h�E�N�V���촃'o ""
�

file1
read"

 C���[?��P�j*}�Z��m��m|�Iٮ�p��@�)��(œJR�2R��EG��%��`��q��[ sˀ�vzҜ���͸m���.җ��7M�'Q ""
&���U����PFw���?3�L]��K�ea��
12 changes: 7 additions & 5 deletions samples/v2/test12_authority_caveats.bc
@@ -1,6 +1,8 @@
�
(
check12

"file1 "file1 ܤ����x�7�ɇ�H _�O� U/����@&�3�v�n���bX����3��%���c8���Fy8'�=ًƒQG�P�\�ت�*/�Ѫ��w ""
�
%
check1
file12

 ܤ����x�7�ɇ�H _�O� U/����@�g=Z�I�)�͜�K��r(�
1 � ��>�����8?��^Ȏ|�����lٹ""
��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.
19 changes: 10 additions & 9 deletions samples/v2/test14_regex_constraint.bc
@@ -1,12 +1,13 @@
�
K
�
M
resource_match
024
2

0
file[0-9]+.txt2&
$




"file[0-9]+.txt
 ι�G���V��`*k��)��_��<�^dM'�B@��:��y{�1�����.�(:�SA�ʄ ��B`�ԎL��(��ji��gJ�7ˊ����vz""



 ι�G���V��`*k��)��_��<�^dM'�B@}s���p^��M����}�=��;�����v"b����y�W7#�w����-7m���ң7��U�""
�Ɩ��]�<T�~�Eq��2��e�p���9QS�
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.
7 changes: 4 additions & 3 deletions samples/v2/test19_generating_ambient_from_variables.bc
Expand Up @@ -4,9 +4,10 @@
test
read2

  ���D��~[� N�$�PZ�!�����؃��@�Um ��|>�-SL4?^���9ԉ�f��H�q�����E�@�������O��Ѿ}@�
  ���D��~[� N�$�PZ�!�����؃��@�?@�i?C���W,o����(����d%��U�*3����N�����/v� ��JT�k�}wN 

any*
 
 �a�0�c���L�BlA|3�(Z�=��R��:��@�w�T�u�;��)��DUQAKy"}��3r�Ą�"�h�˨ރ��E� �{ύ�р~�WӁ{�`""
 
 �a�0�c���L�BlA|3�(Z�=��R��:��@ĕi8�n)� �3�M�-Ė64O:@��
�����$S�"�ң;�P�u���RA_�K{}�m���""
��+o\�� ���eȽs�����6G�;�cFwa�
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 modified samples/v2/test7_scoped_rules.bc
Binary file not shown.
Binary file modified samples/v2/test8_scoped_checks.bc
Binary file not shown.
Binary file modified samples/v2/test9_expired_token.bc
Binary file not shown.
32 changes: 9 additions & 23 deletions schema.proto
Expand Up @@ -52,14 +52,13 @@ message PredicateV2 {

message IDV2 {
oneof Content {
uint64 symbol = 1;
uint32 variable = 2;
int64 integer = 3;
string string = 4;
uint64 date = 5;
bytes bytes = 6;
bool bool = 7;
IDSet set = 8;
uint32 variable = 1;
int64 integer = 2;
uint64 string = 3;
uint64 date = 4;
bytes bytes = 5;
bool bool = 6;
IDSet set = 7;
}
}

Expand All @@ -74,8 +73,7 @@ message ConstraintV2 {
IntConstraintV2 int = 2;
StringConstraintV2 string = 3;
DateConstraintV2 date = 4;
SymbolConstraintV2 symbol = 5;
BytesConstraintV2 bytes = 6;
BytesConstraintV2 bytes = 5;
}
}

Expand Down Expand Up @@ -107,7 +105,7 @@ message StringConstraintV2 {
}

message StringSet {
repeated string set = 1;
repeated uint64 set = 1 [packed=true];
}

message DateConstraintV2 {
Expand All @@ -117,17 +115,6 @@ message DateConstraintV2 {
}
}

message SymbolConstraintV2 {
oneof Constraint {
SymbolSet in_set = 1;
SymbolSet not_in_set = 2;
}
}

message SymbolSet {
repeated uint64 set = 1 [packed=true];
}

message BytesConstraintV2 {
oneof Constraint {
bytes equal = 1;
Expand Down Expand Up @@ -203,5 +190,4 @@ message VerifierPolicies {
repeated RuleV2 rules = 4;
repeated CheckV2 checks = 5;
repeated Policy policies = 6;
repeated RuleV2 privileged_rules = 7;
}

0 comments on commit a195fb4

Please sign in to comment.