{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/103626548","pull_request_review_id":24417259,"id":103626548,"diff_hunk":"@@ -0,0 +1,208 @@\n+<?php\n+/**\n+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)\n+ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\n+ *\n+ * Licensed under The MIT License\n+ * For full copyright and license information, please see the LICENSE.txt\n+ * Redistributions of files must retain the above copyright notice.\n+ *\n+ * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\n+ * @link          http://cakephp.org CakePHP(tm) Project\n+ * @since         3.5.0\n+ * @license       http://www.opensource.org/licenses/mit-license.php MIT License\n+ */\n+namespace Cake\\Http\\Cookie;\n+\n+use Cake\\Utility\\Security;\n+use RuntimeException;\n+\n+/**\n+ * Cookie Crypt Trait.\n+ *\n+ * Provides the encrypt/decrypt logic.\n+ */\n+trait CookieCryptTrait\n+{\n+\n+    /**\n+     * Valid cipher names for encrypted cookies.\n+     *\n+     * @var array\n+     */\n+    protected $_validCiphers = [\n+        'aes',\n+        'rijndael'\n+    ];\n+\n+    /**\n+     * Encryption cipher\n+     *\n+     * @param string|bool\n+     */\n+    protected $encryptionCipher = 'aes';\n+\n+    /**\n+     * The key for encrypting and decrypting the cookie\n+     *\n+     * @var string\n+     */\n+    protected $encryptionKey = '';\n+\n+    /**\n+     * Sets the encryption cipher\n+     *\n+     * @param string $cipher Cipher\n+     * @return $this\n+     */\n+    public function setEncryptionCipher($cipher)\n+    {\n+        $this->checkCipher($cipher);\n+        $this->encryptionCipher = $cipher;\n+\n+        return $this;\n+    }\n+\n+    /**\n+     * Check if encryption is enabled\n+     *\n+     * @return bool\n+     */\n+    public function encryptionIsEnabled()\n+    {\n+        return is_string($this->encryptionCipher);\n+    }\n+\n+    /**\n+     * Disables the encryption\n+     *\n+     * @return $this\n+     */\n+    public function disableEncryption()\n+    {\n+        $this->encryptionCipher = false;","path":"src/Http/Cookie/CookieCryptTrait.php","position":82,"original_position":83,"commit_id":"79066260a813f50bd857c951d501ffe59b2e4b0b","original_commit_id":"b452e4cddd4491a51d5b7076efebe1734382aee2","user":{"login":"robertpustulka","id":7437773,"avatar_url":"https://avatars3.githubusercontent.com/u/7437773?v=3","gravatar_id":"","url":"https://api.github.com/users/robertpustulka","html_url":"https://github.com/robertpustulka","followers_url":"https://api.github.com/users/robertpustulka/followers","following_url":"https://api.github.com/users/robertpustulka/following{/other_user}","gists_url":"https://api.github.com/users/robertpustulka/gists{/gist_id}","starred_url":"https://api.github.com/users/robertpustulka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertpustulka/subscriptions","organizations_url":"https://api.github.com/users/robertpustulka/orgs","repos_url":"https://api.github.com/users/robertpustulka/repos","events_url":"https://api.github.com/users/robertpustulka/events{/privacy}","received_events_url":"https://api.github.com/users/robertpustulka/received_events","type":"User","site_admin":false},"body":"@burzum I mean it would become a \"nullable\" string i that case. But do as you please.","created_at":"2017-03-01T07:46:55Z","updated_at":"2017-03-01T07:46:56Z","html_url":"https://github.com/cakephp/cakephp/pull/10203#discussion_r103626548","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/10203","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/103626548"},"html":{"href":"https://github.com/cakephp/cakephp/pull/10203#discussion_r103626548"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/10203"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/10203","id":105808444,"html_url":"https://github.com/cakephp/cakephp/pull/10203","diff_url":"https://github.com/cakephp/cakephp/pull/10203.diff","patch_url":"https://github.com/cakephp/cakephp/pull/10203.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/10203","number":10203,"state":"open","locked":false,"title":"New cookie implementation for the HTTP stack","user":{"login":"burzum","id":162789,"avatar_url":"https://avatars3.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false},"body":"## New prototype implementation for cookies\r\n\r\nIt needs more tests and I'm not yet happy with the handling of the cookie data and encryption. But I would already like to get feedback on this to continue to develop it into a direction we all agree with.\r\n\r\nThe code is partially based on https://github.com/hansott/psr7-cookies/ but was changed to fit into our current API and the frameworks current php version. I've had a discussion with Mark Story if we'll directly use it or not. The final decision for the named reasons was to come up with our own implementation. I've also changed the implementation in some aspects, it's not a copy and paste job. I need some advice if we need to give credits and copyright and if yes, how to do it the right way.\r\n\r\nCookies can now be used from wherever the request object and response objects are available.\r\n\r\n## Overview of the new implementation\r\n\r\n* Uses the request and response objects\r\n* Uses a cookie object to built and modify a cookie\r\n* Generates cookie objects from the request object\r\n* Writes cookies to the response object\r\n* Uses getters and setters\r\n* No longer a component bound controller layer only solution (This change is required to get the cookie authenticator in the new authentication implementation working)\r\n* **TBD**: If possible a BC compatible cookie component that uses the new implementation\r\n\r\n## Related issues\r\n\r\n* https://github.com/cakephp/authentication/issues/26","created_at":"2017-02-12T21:56:05Z","updated_at":"2017-03-01T07:46:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61dd86f5e94397de84cc891db682056a31612140","assignee":{"login":"burzum","id":162789,"avatar_url":"https://avatars3.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false},"assignees":[{"login":"burzum","id":162789,"avatar_url":"https://avatars3.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/114","html_url":"https://github.com/cakephp/cakephp/milestone/114","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/114/labels","id":2150445,"number":114,"title":"3.5.0","description":"Backwards compatible feature release for the 3.x release series. See the [3.5 Roadmap](https://github.com/cakephp/cakephp/wiki/3.5-Roadmap)","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars0.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":84,"closed_issues":18,"state":"open","created_at":"2016-11-22T02:30:35Z","updated_at":"2017-03-01T01:51:46Z","due_on":"2017-06-30T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/10203/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/10203/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/10203/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/79066260a813f50bd857c951d501ffe59b2e4b0b","head":{"label":"burzum:3.next-cookies","ref":"3.next-cookies","sha":"79066260a813f50bd857c951d501ffe59b2e4b0b","user":{"login":"burzum","id":162789,"avatar_url":"https://avatars3.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false},"repo":{"id":905891,"name":"cakephp","full_name":"burzum/cakephp","owner":{"login":"burzum","id":162789,"avatar_url":"https://avatars3.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/burzum/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":true,"url":"https://api.github.com/repos/burzum/cakephp","forks_url":"https://api.github.com/repos/burzum/cakephp/forks","keys_url":"https://api.github.com/repos/burzum/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/burzum/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/burzum/cakephp/teams","hooks_url":"https://api.github.com/repos/burzum/cakephp/hooks","issue_events_url":"https://api.github.com/repos/burzum/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/burzum/cakephp/events","assignees_url":"https://api.github.com/repos/burzum/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/burzum/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/burzum/cakephp/tags","blobs_url":"https://api.github.com/repos/burzum/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/burzum/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/burzum/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/burzum/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/burzum/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/burzum/cakephp/languages","stargazers_url":"https://api.github.com/repos/burzum/cakephp/stargazers","contributors_url":"https://api.github.com/repos/burzum/cakephp/contributors","subscribers_url":"https://api.github.com/repos/burzum/cakephp/subscribers","subscription_url":"https://api.github.com/repos/burzum/cakephp/subscription","commits_url":"https://api.github.com/repos/burzum/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/burzum/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/burzum/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/burzum/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/burzum/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/burzum/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/burzum/cakephp/merges","archive_url":"https://api.github.com/repos/burzum/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/burzum/cakephp/downloads","issues_url":"https://api.github.com/repos/burzum/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/burzum/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/burzum/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/burzum/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/burzum/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/burzum/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/burzum/cakephp/deployments","created_at":"2010-09-12T22:15:50Z","updated_at":"2016-10-10T22:17:16Z","pushed_at":"2017-02-28T23:14:32Z","git_url":"git://github.com/burzum/cakephp.git","ssh_url":"git@github.com:burzum/cakephp.git","clone_url":"https://github.com/burzum/cakephp.git","svn_url":"https://github.com/burzum/cakephp","homepage":"http://cakephp.org","size":65726,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cakephp:3.next","ref":"3.next","sha":"3faa0c269df0719402e8a6a875df4350b04c32a0","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars3.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":656494,"name":"cakephp","full_name":"cakephp/cakephp","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars3.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":false,"url":"https://api.github.com/repos/cakephp/cakephp","forks_url":"https://api.github.com/repos/cakephp/cakephp/forks","keys_url":"https://api.github.com/repos/cakephp/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/cakephp/teams","hooks_url":"https://api.github.com/repos/cakephp/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cakephp/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/cakephp/events","assignees_url":"https://api.github.com/repos/cakephp/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/cakephp/tags","blobs_url":"https://api.github.com/repos/cakephp/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/cakephp/languages","stargazers_url":"https://api.github.com/repos/cakephp/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cakephp/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cakephp/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cakephp/cakephp/subscription","commits_url":"https://api.github.com/repos/cakephp/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/cakephp/merges","archive_url":"https://api.github.com/repos/cakephp/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/cakephp/downloads","issues_url":"https://api.github.com/repos/cakephp/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/cakephp/deployments","created_at":"2010-05-08T14:38:22Z","updated_at":"2017-03-01T05:25:25Z","pushed_at":"2017-03-01T03:27:24Z","git_url":"git://github.com/cakephp/cakephp.git","ssh_url":"git@github.com:cakephp/cakephp.git","clone_url":"https://github.com/cakephp/cakephp.git","svn_url":"https://github.com/cakephp/cakephp","homepage":"http://cakephp.org","size":69203,"stargazers_count":6955,"watchers_count":6955,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3136,"mirror_url":null,"open_issues_count":197,"forks":3136,"open_issues":197,"watchers":6955,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/10203"},"html":{"href":"https://github.com/cakephp/cakephp/pull/10203"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/10203"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/10203/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/10203/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/10203/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/79066260a813f50bd857c951d501ffe59b2e4b0b"}}}}
{"actor":{"display_login":"robertpustulka"}}