{"action":"created","issue":{"url":"https://api.github.com/repos/ably/ably-js/issues/235","repository_url":"https://api.github.com/repos/ably/ably-js","labels_url":"https://api.github.com/repos/ably/ably-js/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/ably/ably-js/issues/235/comments","events_url":"https://api.github.com/repos/ably/ably-js/issues/235/events","html_url":"https://github.com/ably/ably-js/issues/235","id":134905326,"number":235,"title":"CipherParam defaults","user":{"login":"mattheworiordan","id":43789,"avatar_url":"https://avatars.githubusercontent.com/u/43789?v=3","gravatar_id":"","url":"https://api.github.com/users/mattheworiordan","html_url":"https://github.com/mattheworiordan","followers_url":"https://api.github.com/users/mattheworiordan/followers","following_url":"https://api.github.com/users/mattheworiordan/following{/other_user}","gists_url":"https://api.github.com/users/mattheworiordan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattheworiordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattheworiordan/subscriptions","organizations_url":"https://api.github.com/users/mattheworiordan/orgs","repos_url":"https://api.github.com/users/mattheworiordan/repos","events_url":"https://api.github.com/users/mattheworiordan/events{/privacy}","received_events_url":"https://api.github.com/users/mattheworiordan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ably/ably-js/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ably/ably-js/labels/high%20priority","name":"high priority","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"SimonWoolf","id":5908687,"avatar_url":"https://avatars.githubusercontent.com/u/5908687?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonWoolf","html_url":"https://github.com/SimonWoolf","followers_url":"https://api.github.com/users/SimonWoolf/followers","following_url":"https://api.github.com/users/SimonWoolf/following{/other_user}","gists_url":"https://api.github.com/users/SimonWoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonWoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonWoolf/subscriptions","organizations_url":"https://api.github.com/users/SimonWoolf/orgs","repos_url":"https://api.github.com/users/SimonWoolf/repos","events_url":"https://api.github.com/users/SimonWoolf/events{/privacy}","received_events_url":"https://api.github.com/users/SimonWoolf/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-02-19T16:19:22Z","updated_at":"2016-02-19T18:42:45Z","closed_at":null,"body":"When creating an encrypted channel in Ruby, for example, you can simply do:\r\n\r\n```\r\nchannel = channels.get('secret', encrypted: true, cipherParams: { key: 'very secret' })\r\n```\r\n\r\nThis does not require one to explicitly get the default cipherParams because the channel itself will fill in the defaults where missing.\r\n\r\nHowever, with ably-js this is not possible, and you have to do the following:\r\n\r\n```\r\nCrypto.getDefaultParams(function(err, params) {\r\n  params.key = 'very secret';\r\n  channel = channels.get('secret', { encrypted:true, cipherParams: params });\r\n});\r\n```\r\n\r\nI think it would make life a lot easier for our customers if we supported something more akin to the Ruby style:\r\n\r\n```\r\nchannel = channels.get('secret', { encrypted: true, cipherParams: { key: 'very secret' } });\r\n```"},"comment":{"url":"https://api.github.com/repos/ably/ably-js/issues/comments/186355981","html_url":"https://github.com/ably/ably-js/issues/235#issuecomment-186355981","issue_url":"https://api.github.com/repos/ably/ably-js/issues/235","id":186355981,"user":{"login":"SimonWoolf","id":5908687,"avatar_url":"https://avatars.githubusercontent.com/u/5908687?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonWoolf","html_url":"https://github.com/SimonWoolf","followers_url":"https://api.github.com/users/SimonWoolf/followers","following_url":"https://api.github.com/users/SimonWoolf/following{/other_user}","gists_url":"https://api.github.com/users/SimonWoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonWoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonWoolf/subscriptions","organizations_url":"https://api.github.com/users/SimonWoolf/orgs","repos_url":"https://api.github.com/users/SimonWoolf/repos","events_url":"https://api.github.com/users/SimonWoolf/events{/privacy}","received_events_url":"https://api.github.com/users/SimonWoolf/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T18:42:45Z","updated_at":"2016-02-19T18:42:45Z","body":"@paddybyers to the extent that that's a problem, it's one we already had, since you could already do `channels.get(\"channel\", {encrypted: true})`. This PR just lets you specify a key in the same options hash, which at least doesn't make things any worse."}}