-
Notifications
You must be signed in to change notification settings - Fork 135
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
Pretty print a policy #222
base: master
Are you sure you want to change the base?
Conversation
(x, y) => { | ||
let red = "\x1b[0;31m"; | ||
let nc = "\x1b[0m"; | ||
let green = "\x1b[0;32m"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to come up with a different encoding scheme. It doesn't have to be pretty, we could provide a shellscript or something that converted it into a colorized version.
But using shell escape sequences means that we won't work on windows and are likely to confuse other command line tools.
e829434 Implemented Policy Diff (sanket1729) 4d23b79 Pretty print a policy (sanket1729) Pull request description: Adds methods to pretty print policies similar to directory tree printing in Linux. Prints diff in colors which highlights the differences between the two policies. Our representation of Semantic policies in only in Thresh, so we combine `or(pk,or(pk,pk))` into `thresh(1,pk,pk,pk)`. And so we use the latter in comparing two policies that complicate some of the implementation but is still fairly small. Top commit has no ACKs. Tree-SHA512: 8efd11b2c2582a4e26455ccb718d1ad2016ead3507746bd98a16240c7c72cf411df7fa01d817aee3a42c138b8ff7b887e7104d29d15f7a57a61620eee20a9d2b
} | ||
|
||
/// Pretty Print a tree | ||
pub fn pprint_tree(&self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 4d23b79:
Can we make this pub(crate)
? I think we can come up with a much better API here and I'd rather not expose this one.
Adds methods to pretty print policies similar to directory tree printing in Linux. Prints diff in colors which highlights the differences between the two policies.
Our representation of Semantic policies in only in Thresh, so we combine
or(pk,or(pk,pk))
intothresh(1,pk,pk,pk)
. And so we use the latter in comparing two policies that complicate some of the implementation but is still fairly small.