When creating an encrypted channel in Ruby, for example, you can simply do:
channel = channels.get('secret', encrypted: true, cipherParams: { key: 'very secret' })
This does not require one to explicitly get the default cipherParams because the channel itself will fill in the defaults where missing.
However, with ably-js this is not possible, and you have to do the following:
Crypto.getDefaultParams(function(err, params) {
params.key = 'very secret';
channel = channels.get('secret', { encrypted:true, cipherParams: params });
});
I think it would make life a lot easier for our customers if we supported something more akin to the Ruby style:
channel = channels.get('secret', { encrypted: true, cipherParams: { key: 'very secret' } });
When creating an encrypted channel in Ruby, for example, you can simply do:
This does not require one to explicitly get the default cipherParams because the channel itself will fill in the defaults where missing.
However, with ably-js this is not possible, and you have to do the following:
I think it would make life a lot easier for our customers if we supported something more akin to the Ruby style: