-
Notifications
You must be signed in to change notification settings - Fork 16
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
plDoc and whitelisting #16
Comments
@Anniepoo Can you define these categories for me? I see labels (1) gold, (2) light blue, (3) dark blue, (4) maybe more? These are related to categories (1) whitelisted, (2) conditionally whitelisted, (3) other? If plDoc can discover the category based on parsing some Prolog file then the HTML rendition can include semantic RDFa annotations that describe this part of the semantics unambiguously. |
the backgrounds of predicates are something like I think there's a second yellow tone for dynamic another good plae to somehow display this is the editor. |
@Anniepoo Thanks for specifying the categories. But how do these interact with whitelisting? Not all public predicates should be whitelisted IIUC. |
Well, shell is public, I hope we're not whitelisting it. If you look at sources of pldoc pages, you'll see that the dt that defines the predicate header has a class set. this class is pubdef for public predicates, |
@Anniepoo ( private(Obj, Options)
-> Class = privdef % private definition
; multifile(Obj, Options)
-> ( option(scope(file), Options)
-> ( more_doc(Obj, Pos)
-> Class = multidef(object(Obj))
; Class = multidef
)
; Class = multidef(file((Pos)))
)
; Class = pubdef % public definition
), If |
Yes, of course it would. |
Yip. You can basically just do safe_goal(Head), using the most generic head. If that succeeds it is whitelisted, but indeed if it fails it may work with specific arguments. This is notably a problem for meta-predicates, which will not pass as safe without instantiating their arguments to something safe. That could be automated (find meta-arguments and instantiate them. I'd be tempted to use an icon to indicate safety rather than yet another colour. This might actually also be a good idea for multifile predicates as both are orthogonal to public/private. |
Yes, the icon's a good idea. |
Would implementing this imply loading pengines library, and if so, are we creating a security issue? |
No. You only need to load library(sandbox). |
ah, cool |
It would be quite convenient if plDoc generated html included some indication of which predicates were whitelisted.
Visually, we distinguish predicate types with gold vs light blue vs dark blue, etc. - maybe some elaboration of this scheme, or some icons, could do it
Not sure what we do about their being potentially more than one application.
Nor am I sure what to do about things that are conditionally whitelisted.
The text was updated successfully, but these errors were encountered: