[erlang-patches] EEP Light: Option to override private key lookup when using Erlang ssh client
Hans Nilsson R
hans.r.nilsson@REDACTED
Thu Nov 12 17:36:29 CET 2015
Hi Vipin,
As I indicated when I closed your pull request, those options forces the
callback modules to handle options that might be strange for a certain
callback module. For example, the purpose of ssh_file is only to handle
keys in the way of OpenSSH.
You have correctly pointed out that to be able to write a specialized
callback module there is a need to have options passed to callbacks.
A more general way to pass options to the key callback module would be
to introduce a second form of the key_cb option:
- keep todays {key_cb, Module::atom()} to keep compatibility
- introduce the variant {key_cb, {Module::atom(), ModuleOptions}}
ModuleOptions has the usual list of {Tag,Value} format. That list is
passed in the Options argument of the callback functions as
{key_cb_private,ModuleOptions}
The old
{key_cb, Module::atom()}
could be transformed to
{key_cb, {Module,[]}}
already in ssh:handle_options to make it cleaner inside.
In that way it is possible to write a callback module with whatever is
needed as private options.
-Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4101 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20151112/6da0b123/attachment.bin>
More information about the erlang-patches
mailing list