Provide a mechanism to disable imports #13
Genarito
started this conversation in
Ideas (RFC)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation and proposal
To avoid errors in environments without filesystem access, prevent security problems in sensitive environments, or whatever the reason, each implementation must provide an import disabling mechanism. This flag must be part of the process of parsing a text string in Gura format to a structure useful for the implementation (e.g. a dictionary in Python, an object in Javascript, a HashMap in Java and Rust, etc).
In case the user sets this flag to
true
it should not be possible to import Gura files into one, and anyimport
statement encountered should throwImportDisabledError
.This gives more control to the users to use Gura in the most efficient way for their requirements.
Example in Python:
Considerations
true
to keep portability from Gura 1.0.0 and prevent implicit limitations.Version
Gura 2.0.0
as It adds breaking changes to the existing API. This change would be introduced with Literal Keys (#10) and new escaped sentences behavior (#11) to prevent a huge amount of versions.Changes
ImportDisabledError
definition to the Import section.Beta Was this translation helpful? Give feedback.
All reactions