-
Notifications
You must be signed in to change notification settings - Fork 8
Add a Sensitive datatype that does nothing #247
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
base: master
Are you sure you want to change the base?
Conversation
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.
To be useful, it at least needs to prevent throwing an error on such erb call:
auth.ldap.bindpw: <%= @ldap_pwd.unwrap %>
This does not work:
modified ruby/hrubyerb.rb
@@ -48,6 +48,11 @@ class Scope
vl('~g~e~t_h~a~s~h~')
end
+ def function_unwrap(args)
+ put '~u~n~w_r~a~p~'
+ args
+ end
+
def function_to_yaml(args)
args.to_yaml
end
@@ -117,4 +122,3 @@ class Controller
nerb.result(binding.get_binding)
end
end
-
Any idea ?
| DTScalar -> datatypeMatch (DTVariant (DTInteger Nothing Nothing :| [DTString Nothing Nothing, DTBoolean])) v | ||
| DTData -> datatypeMatch (DTVariant (DTScalar :| [DTArray DTData 0 Nothing, DTHash DTScalar DTData 0 Nothing])) v | ||
| DTOptional sdt -> datatypeMatch (DTVariant (DTUndef :| [sdt])) v | ||
| DTSensitive sdt -> datatypeMatch (DTVariant (DTUndef :| [sdt])) v |
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.
@bartavelle Is this alright ?
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 do not think this is alright. If you want it to work "right", you should create a new datatype for the interpreter, and it should only match that.
It seems impossible to validate it properly without adding special logic. Indeed, it says:
The Sensitive type is parameterized, but the parameterized type (the type of the value it contains) only retains the basic type, but sensitive information about the length or details about the contained data value can be leaked.
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.
You can write a ruby to haskell binding so that it can call unwrap.
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.
Where do I write such binding ?
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.
probably in the Puppet.Runner.Erb module. Look at how the varlookup function is exported to the ruby runtime
f7eb243 to
e89c7b6
Compare
First step for #245