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

private: path policy language #4687

Open
tzaeschke opened this issue Jan 27, 2025 · 2 comments
Open

private: path policy language #4687

tzaeschke opened this issue Jan 27, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@tzaeschke
Copy link
Contributor

tzaeschke commented Jan 27, 2025

This also applies to doc.
While implementing the path policy language for JPAN, I noticed some discrepancies between the language design and the implementation.

Design

  • The design talks about a Policy that can contain ACLs, a Sequence, Options, and that "extends" several other Policies. However:
    • In the implementation, the "extends" feature is not in "Policy" but in separate type "ExtPolicy".
    • The extends feature references ExtPolicies, not Policies
    • The implementation only has a method PolicyFromExtPolicy which takes as input an ExtPolicy (input1) and "applies" other ExtPolicies.
      Moreover, it may or may not modify input1 depending on whether input1 has already a Policy. See also private: Policy.PolicyFromExtPolicy modifies existing policy. #4682
  • The design says that Options are a "list of anonymous policies"
    • It is unclear why they must be anonymous (e.g. have no name)? Policies are named (though the name may be empty).
    • In the implementation, an Options contains an ExtPolicy (not a Policy)
  • The implementation also contains features that are not mentioned in the design, e.g.:
    • LocalISDAS
    • RemoteISDAS
    • FilterOptions
    • JSON import export (only mentioned in the "outdated content" section.
    • YAML import/export for ACLs
  • The example for "extends" in the design doc doesn't really make it clear what the purpose / use-case of this feature is and how it can be beneficial.
    Maybe the example can be improved?

Implementation

Question

For me the question is which should I follow?

@tzaeschke tzaeschke added the bug Something isn't working label Jan 27, 2025
@oncilla
Copy link
Contributor

oncilla commented Jan 27, 2025

IMO, the doc is severely outdated, and FWIW, I don't think it was ever completely implemented.

In the commercial implementation of Anapaya, we only support ACL + Hop pattern:

Image

So far, this has been sufficient. With JPAN, I would aim for the same expressiveness in the beginning.

@tzaeschke
Copy link
Contributor Author

tzaeschke commented Jan 27, 2025

Thanks. I have already implemented a bit more than that, but for ACL and Sequence, the implementation and the design seem to be mostly consistent. So I'll probably just skip the extensions (and Options?).

It would still be good though to get an updated design document...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants