Skip to content

CipherParam defaults #235

@mattheworiordan

Description

@mattheworiordan

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' } });

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improved functionality.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions