{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/28966795","id":28966795,"diff_hunk":"@@ -0,0 +1,75 @@\n+<?php\n+/**\n+ * @author Lukas Reschke <lukas@owncloud.com>\n+ *\n+ * @copyright Copyright (c) 2015, ownCloud, Inc.\n+ * @license AGPL-3.0\n+ *\n+ * This code is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Affero General Public License, version 3,\n+ * as published by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU Affero General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Affero General Public License, version 3,\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>\n+ *\n+ */\n+\n+namespace OC\\Connector\\Sabre;\n+\n+use OCP\\IConfig;\n+use Sabre\\HTTP\\RequestInterface;\n+use Sabre\\DAV\\ServerPlugin;\n+use Sabre\\DAV\\Exception;\n+\n+/**\n+ * Class BlockLegacyClientPlugin is used to detect old legacy sync clients and\n+ * returns a 403 status to those clients\n+ *\n+ * @package OC\\Connector\\Sabre\n+ */\n+class BlockLegacyClientPlugin extends ServerPlugin {\n+\t/** @var \\Sabre\\DAV\\Server */\n+\tprotected $server;\n+\t/** @var IConfig */\n+\tprotected $config;\n+\n+\t/**\n+\t * @param IConfig $config\n+\t */\n+\tpublic function __construct(IConfig $config) {\n+\t\t$this->config = $config;\n+\t}\n+\n+\t/**\n+\t * @param \\Sabre\\DAV\\ $server\n+\t * @return void\n+\t */\n+\tpublic function initialize(\\Sabre\\DAV\\Server $server) {\n+\t\t$this->server = $server;\n+\t\t$this->server->on('beforeMethod', [$this, 'beforeHandler'], 200);\n+\t}\n+\n+\t/**\n+\t * Detects all unsupported clients and throws a \\Sabre\\DAV\\Exception\\Forbidden\n+\t * exception which will result in a 403 to them.\n+\t * @param RequestInterface $request\n+\t * @throws \\Sabre\\DAV\\Exception\\Forbidden If the client version is not supported\n+\t */\n+\tpublic function beforeHandler(RequestInterface $request) {\n+\t\t$userAgent = $request->getHeader('User-Agent');\n+\t\t$minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '1.7.0');","path":"lib/private/connector/sabre/blocklegacyclientplugin.php","position":65,"original_position":65,"commit_id":"21ad4400afdc6806268d1d8c07dd97dacbe99df6","original_commit_id":"21ad4400afdc6806268d1d8c07dd97dacbe99df6","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"body":"Well. :bomb: but honestly, if you add wrong data to your configuration ownCloud explodes in a lot of places :see_no_evil: ","created_at":"2015-04-23T14:26:11Z","updated_at":"2015-04-23T14:26:11Z","html_url":"https://github.com/owncloud/core/pull/15683#discussion_r28966795","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/15683","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/28966795"},"html":{"href":"https://github.com/owncloud/core/pull/15683#discussion_r28966795"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/15683"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/15683","id":33490713,"html_url":"https://github.com/owncloud/core/pull/15683","diff_url":"https://github.com/owncloud/core/pull/15683.diff","patch_url":"https://github.com/owncloud/core/pull/15683.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/15683","number":15683,"state":"open","locked":false,"title":"Block old legacy clients","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"body":"This Pull Request introduces a SabreDAV plugin that will block all older clients than 1.6.1 to connect and sync with the ownCloud instance.\r\n\r\nThis has multiple reasons:\r\n\r\n1. Old ownCloud client versions before 1.6.0 are not properly working with sticky cookies for load balancers and thus generating sessions en masse\r\n2. Old ownCloud client versions tend to be horrible buggy\r\n\r\nIn some cases we had in 80minutes about 10'000 sessions created by a single user. While this change set does not really \"fix\" the problem as 3rdparty legacy clients are affected as well, it is a good work-around and hopefully should force users to update their client\r\n\r\n@danimo @dragotin @DeepDiver1975 @karlitschek @butonic … and whoever might feel involved :see_no_evil: ","created_at":"2015-04-16T20:43:27Z","updated_at":"2015-04-23T14:26:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d96b0ae8a72297a17b27c6c528d3892e1c370e6","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","html_url":"https://github.com/owncloud/core/milestones/8.1-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-current","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":165,"closed_issues":872,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-04-23T14:17:00Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/15683/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/15683/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/15683/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/21ad4400afdc6806268d1d8c07dd97dacbe99df6","head":{"label":"owncloud:block-legacy-clients","ref":"block-legacy-clients","sha":"21ad4400afdc6806268d1d8c07dd97dacbe99df6","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-04-23T13:28:12Z","pushed_at":"2015-04-23T14:22:09Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":1012008,"stargazers_count":3250,"watchers_count":3250,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1043,"mirror_url":null,"open_issues_count":1707,"forks":1043,"open_issues":1707,"watchers":3250,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"930ae11f8e52e70640060eca5b69afdebe713c6b","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-04-23T13:28:12Z","pushed_at":"2015-04-23T14:22:09Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":1012008,"stargazers_count":3250,"watchers_count":3250,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1043,"mirror_url":null,"open_issues_count":1707,"forks":1043,"open_issues":1707,"watchers":3250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/15683"},"html":{"href":"https://github.com/owncloud/core/pull/15683"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/15683"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/15683/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/15683/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/15683/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/21ad4400afdc6806268d1d8c07dd97dacbe99df6"}}}}