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

Config Parameter "enable" is acting in the wrong scope #14

Closed
TheDataLeek opened this issue Jun 25, 2016 · 2 comments
Closed

Config Parameter "enable" is acting in the wrong scope #14

TheDataLeek opened this issue Jun 25, 2016 · 2 comments

Comments

@TheDataLeek
Copy link
Contributor

See the wiki page: https://github.com/RussBaz/enforce/wiki/Configuration

In a nutshell, the built in functionality with wrapt lets us disable these checks and skip over them, however since this happens at the bytecode level it needs to occur right as the file is read.

This behavior isn't ideal, as we would like to be able to dynamically disable functions based on possibly arguments, or other things. This currently isn't possible...

This is a low priority issue, however we still need to keep track of it. (I'll try to get to it soon, but if someone beats me to it that would also be great.)

@RussBaz
Copy link
Owner

RussBaz commented Jul 5, 2016

I think you should look at the 'Enforcer' object, especially at 'validate_inputs' and 'validate_outputs' methods. Each enforcer already contains unused properties 'settings' and 'enabled'. Settings property should point to the Config object, I think. It might be a good idea to skip validation in them if certain options are set.

Also, 'enabled' flag is used there separately to signify that it is intended as an override for the value in the settings. It might be useful in some cases for disabling proxy object type validation.

@RussBaz RussBaz mentioned this issue Sep 9, 2016
8 tasks
@RussBaz
Copy link
Owner

RussBaz commented Sep 9, 2016

In one of the latest commits in the dev branch, I refactored settings in order to enable dynamic switching on and off of the individual 'enforcers' and as a part of the group. A global kill switch was also added to the settings.

@RussBaz RussBaz closed this as completed Sep 9, 2016
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

2 participants