Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging block builders with scope annotations #196

Open
divarvel opened this issue Oct 31, 2023 · 0 comments
Open

Merging block builders with scope annotations #196

divarvel opened this issue Oct 31, 2023 · 0 comments

Comments

@divarvel
Copy link
Collaborator

divarvel commented Oct 31, 2023

Blocks can start with a trusting annotation that will apply to all the rule bodies with no trusting annotation.

trusting authority, <public_key>;
check if fact(true); // equivalent to `check if fact(true) trusting authority, <public key>;`

What should happen when merging trusting authority; check if fact(true); into trusting <public key>; check if fact(false);
or check if fact(true); into trusting <public key>; check if fact(false); ?

i see several possibilities:

  1. ignore the trusting annotation of the second block (current behaviour)
  2. modify the rules with no scope annotations of the second block to inject the scope annotations before adding them to the first block
  • if the second block does not have a scope annotation, then don't do anything (rules will then default to the scope annotation of the first block)
  • if the second block does not have a scope annotation, then inject the default trusted scopes in rules (rules will then not default to the scope annotation of the first block)
  1. if the second block has a scope annotation, raise an error (this would require modifying the signature of BlockBuilder.merge()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant