{"action":"created","comment":{"url":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments/66595583","id":66595583,"diff_hunk":"@@ -373,6 +417,136 @@ public function getContent($asResource = false)\n     }\n \n     /**\n+     * Set a trusted proxy header.\n+     *\n+     * This is primarily useful for testing. If you want to set trusted headers, use the configuration setting\n+     * \"TYPO3.Flow.http.trustedProxies.headers\" instead.\n+     *\n+     * @param string $type One of the HEADER_* constants\n+     * @param string $name The header name to trust or an empty string to not trust this header\n+     * @return void\n+     */\n+    public static function setTrustedProxyHeader($type, $name)\n+    {\n+        if (!in_array($type, array(self::HEADER_CLIENT_IP, self::HEADER_HOST, self::HEADER_PORT, self::HEADER_PROTOCOL))) {\n+            return;\n+        }\n+        self::$trustedProxiesSettings['headers'][$type] = strval($name);\n+    }\n+\n+    /**\n+     * Set the trusted proxies IP addresses.\n+     * If the argument is an empty array, no proxies are trusted.\n+     * If the argument is the string '*', all proxies are trusted.\n+     *\n+     * This is primarily useful for testing. If you want to set trusted headers, use the configuration setting\n+     * \"TYPO3.Flow.http.trustedProxies.proxies\" instead.\n+     *\n+     * @param array|string $trustedProxies\n+     * @return void\n+     */\n+    public static function setTrustedProxies($trustedProxies)\n+    {","path":"TYPO3.Flow/Classes/TYPO3/Flow/Http/Request.php","position":144,"original_position":144,"commit_id":"d3a73f45d5e52396f5371850388430aaf5caddb5","original_commit_id":"d3a73f45d5e52396f5371850388430aaf5caddb5","user":{"login":"albe","id":4259532,"avatar_url":"https://avatars.githubusercontent.com/u/4259532?v=3","gravatar_id":"","url":"https://api.github.com/users/albe","html_url":"https://github.com/albe","followers_url":"https://api.github.com/users/albe/followers","following_url":"https://api.github.com/users/albe/following{/other_user}","gists_url":"https://api.github.com/users/albe/gists{/gist_id}","starred_url":"https://api.github.com/users/albe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albe/subscriptions","organizations_url":"https://api.github.com/users/albe/orgs","repos_url":"https://api.github.com/users/albe/repos","events_url":"https://api.github.com/users/albe/events{/privacy}","received_events_url":"https://api.github.com/users/albe/received_events","type":"User","site_admin":false},"body":"Currently it's actually a mixed type setting, since the '*' placeholder will denote a blanket whitelist. So either we then add a special method for that case (`trustAllProxies()` or sth.) or we change the configuration for that to ['*'] - but IMO that's odd, what if you have a list of IPs and then one entry '*'? That's ambiguous then, so I'm more leaning towards the special setter method","created_at":"2016-06-10T10:53:52Z","updated_at":"2016-06-10T10:53:52Z","html_url":"https://github.com/neos/flow-development-collection/pull/321#discussion_r66595583","pull_request_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/321","_links":{"self":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments/66595583"},"html":{"href":"https://github.com/neos/flow-development-collection/pull/321#discussion_r66595583"},"pull_request":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/321"}}},"pull_request":{"url":"https://api.github.com/repos/neos/flow-development-collection/pulls/321","id":66784267,"html_url":"https://github.com/neos/flow-development-collection/pull/321","diff_url":"https://github.com/neos/flow-development-collection/pull/321.diff","patch_url":"https://github.com/neos/flow-development-collection/pull/321.patch","issue_url":"https://api.github.com/repos/neos/flow-development-collection/issues/321","number":321,"state":"open","locked":false,"title":"FEATURE: Add support for configuring trusted proxies","user":{"login":"albe","id":4259532,"avatar_url":"https://avatars.githubusercontent.com/u/4259532?v=3","gravatar_id":"","url":"https://api.github.com/users/albe","html_url":"https://github.com/albe","followers_url":"https://api.github.com/users/albe/followers","following_url":"https://api.github.com/users/albe/following{/other_user}","gists_url":"https://api.github.com/users/albe/gists{/gist_id}","starred_url":"https://api.github.com/users/albe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albe/subscriptions","organizations_url":"https://api.github.com/users/albe/orgs","repos_url":"https://api.github.com/users/albe/repos","events_url":"https://api.github.com/users/albe/events{/privacy}","received_events_url":"https://api.github.com/users/albe/received_events","type":"User","site_admin":false},"body":"This change introduces a configuration setting `TYPO3.Flow.http.trustedProxies.proxies`\r\nfor so called \"Trusted Proxies\", which is a list of IP address ranges that are trusted\r\nto provide header overrides for some import request meta informations like the host,\r\nport, protocol and client IP.\r\n\r\n        proxies:\r\n          - '216.246.40.0/24'\r\n          - '216.246.100.0/24'\r\n\r\nAlso the header names that are trusted for those informations can be set via the configuration\r\noption `TYPO3.Flow.http.trustedProxies.headers` and default to this:\r\n\r\n        headers:\r\n          clientIp: 'X-Forwarded-For'\r\n          host: 'X-Forwarded-Host'\r\n          port: 'X-Forwarded-Port'\r\n          proto: 'X-Forwarded-Proto'\r\n\r\nTo get the most trusted client IP adress, the Http Request provides a new method\r\n`getTrustedClientIpAddress()` which resolves the clientIp header, matching against\r\ntrusted proxy addresses. So this might not always end up as the actual user IP address.\r\n\r\nBy default all IP addresses are trusted to stay mostly backwards compatible, but a more\r\nsafe setting would be to trust no proxies by default:\r\n\r\n        proxies: []\r\n\r\nFLOW-414 #close","created_at":"2016-04-17T22:45:44Z","updated_at":"2016-06-10T10:53:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1156e4393cd44053dc9ce54ae137b4e6a76c3cd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/321/commits","review_comments_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/321/comments","review_comment_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neos/flow-development-collection/issues/321/comments","statuses_url":"https://api.github.com/repos/neos/flow-development-collection/statuses/d3a73f45d5e52396f5371850388430aaf5caddb5","head":{"label":"albe:trusted_proxies","ref":"trusted_proxies","sha":"d3a73f45d5e52396f5371850388430aaf5caddb5","user":{"login":"albe","id":4259532,"avatar_url":"https://avatars.githubusercontent.com/u/4259532?v=3","gravatar_id":"","url":"https://api.github.com/users/albe","html_url":"https://github.com/albe","followers_url":"https://api.github.com/users/albe/followers","following_url":"https://api.github.com/users/albe/following{/other_user}","gists_url":"https://api.github.com/users/albe/gists{/gist_id}","starred_url":"https://api.github.com/users/albe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albe/subscriptions","organizations_url":"https://api.github.com/users/albe/orgs","repos_url":"https://api.github.com/users/albe/repos","events_url":"https://api.github.com/users/albe/events{/privacy}","received_events_url":"https://api.github.com/users/albe/received_events","type":"User","site_admin":false},"repo":{"id":41612763,"name":"flow-development-collection","full_name":"albe/flow-development-collection","owner":{"login":"albe","id":4259532,"avatar_url":"https://avatars.githubusercontent.com/u/4259532?v=3","gravatar_id":"","url":"https://api.github.com/users/albe","html_url":"https://github.com/albe","followers_url":"https://api.github.com/users/albe/followers","following_url":"https://api.github.com/users/albe/following{/other_user}","gists_url":"https://api.github.com/users/albe/gists{/gist_id}","starred_url":"https://api.github.com/users/albe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albe/subscriptions","organizations_url":"https://api.github.com/users/albe/orgs","repos_url":"https://api.github.com/users/albe/repos","events_url":"https://api.github.com/users/albe/events{/privacy}","received_events_url":"https://api.github.com/users/albe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/albe/flow-development-collection","description":"The unified repository containing the Flow core packages, used for Flow development.","fork":true,"url":"https://api.github.com/repos/albe/flow-development-collection","forks_url":"https://api.github.com/repos/albe/flow-development-collection/forks","keys_url":"https://api.github.com/repos/albe/flow-development-collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/albe/flow-development-collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/albe/flow-development-collection/teams","hooks_url":"https://api.github.com/repos/albe/flow-development-collection/hooks","issue_events_url":"https://api.github.com/repos/albe/flow-development-collection/issues/events{/number}","events_url":"https://api.github.com/repos/albe/flow-development-collection/events","assignees_url":"https://api.github.com/repos/albe/flow-development-collection/assignees{/user}","branches_url":"https://api.github.com/repos/albe/flow-development-collection/branches{/branch}","tags_url":"https://api.github.com/repos/albe/flow-development-collection/tags","blobs_url":"https://api.github.com/repos/albe/flow-development-collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/albe/flow-development-collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/albe/flow-development-collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/albe/flow-development-collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/albe/flow-development-collection/statuses/{sha}","languages_url":"https://api.github.com/repos/albe/flow-development-collection/languages","stargazers_url":"https://api.github.com/repos/albe/flow-development-collection/stargazers","contributors_url":"https://api.github.com/repos/albe/flow-development-collection/contributors","subscribers_url":"https://api.github.com/repos/albe/flow-development-collection/subscribers","subscription_url":"https://api.github.com/repos/albe/flow-development-collection/subscription","commits_url":"https://api.github.com/repos/albe/flow-development-collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/albe/flow-development-collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/albe/flow-development-collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/albe/flow-development-collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/albe/flow-development-collection/contents/{+path}","compare_url":"https://api.github.com/repos/albe/flow-development-collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/albe/flow-development-collection/merges","archive_url":"https://api.github.com/repos/albe/flow-development-collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/albe/flow-development-collection/downloads","issues_url":"https://api.github.com/repos/albe/flow-development-collection/issues{/number}","pulls_url":"https://api.github.com/repos/albe/flow-development-collection/pulls{/number}","milestones_url":"https://api.github.com/repos/albe/flow-development-collection/milestones{/number}","notifications_url":"https://api.github.com/repos/albe/flow-development-collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/albe/flow-development-collection/labels{/name}","releases_url":"https://api.github.com/repos/albe/flow-development-collection/releases{/id}","deployments_url":"https://api.github.com/repos/albe/flow-development-collection/deployments","created_at":"2015-08-30T01:29:22Z","updated_at":"2016-02-01T22:49:11Z","pushed_at":"2016-06-09T15:09:52Z","git_url":"git://github.com/albe/flow-development-collection.git","ssh_url":"git@github.com:albe/flow-development-collection.git","clone_url":"https://github.com/albe/flow-development-collection.git","svn_url":"https://github.com/albe/flow-development-collection","homepage":null,"size":36124,"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":"neos:master","ref":"master","sha":"6d0849389911849fb2bc42f6f2d48daaade47e67","user":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"repo":{"id":40963991,"name":"flow-development-collection","full_name":"neos/flow-development-collection","owner":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neos/flow-development-collection","description":"The unified repository containing the Flow core packages, used for Flow development.","fork":false,"url":"https://api.github.com/repos/neos/flow-development-collection","forks_url":"https://api.github.com/repos/neos/flow-development-collection/forks","keys_url":"https://api.github.com/repos/neos/flow-development-collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neos/flow-development-collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neos/flow-development-collection/teams","hooks_url":"https://api.github.com/repos/neos/flow-development-collection/hooks","issue_events_url":"https://api.github.com/repos/neos/flow-development-collection/issues/events{/number}","events_url":"https://api.github.com/repos/neos/flow-development-collection/events","assignees_url":"https://api.github.com/repos/neos/flow-development-collection/assignees{/user}","branches_url":"https://api.github.com/repos/neos/flow-development-collection/branches{/branch}","tags_url":"https://api.github.com/repos/neos/flow-development-collection/tags","blobs_url":"https://api.github.com/repos/neos/flow-development-collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neos/flow-development-collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neos/flow-development-collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/neos/flow-development-collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neos/flow-development-collection/statuses/{sha}","languages_url":"https://api.github.com/repos/neos/flow-development-collection/languages","stargazers_url":"https://api.github.com/repos/neos/flow-development-collection/stargazers","contributors_url":"https://api.github.com/repos/neos/flow-development-collection/contributors","subscribers_url":"https://api.github.com/repos/neos/flow-development-collection/subscribers","subscription_url":"https://api.github.com/repos/neos/flow-development-collection/subscription","commits_url":"https://api.github.com/repos/neos/flow-development-collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/neos/flow-development-collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/neos/flow-development-collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/neos/flow-development-collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/neos/flow-development-collection/contents/{+path}","compare_url":"https://api.github.com/repos/neos/flow-development-collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neos/flow-development-collection/merges","archive_url":"https://api.github.com/repos/neos/flow-development-collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neos/flow-development-collection/downloads","issues_url":"https://api.github.com/repos/neos/flow-development-collection/issues{/number}","pulls_url":"https://api.github.com/repos/neos/flow-development-collection/pulls{/number}","milestones_url":"https://api.github.com/repos/neos/flow-development-collection/milestones{/number}","notifications_url":"https://api.github.com/repos/neos/flow-development-collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neos/flow-development-collection/labels{/name}","releases_url":"https://api.github.com/repos/neos/flow-development-collection/releases{/id}","deployments_url":"https://api.github.com/repos/neos/flow-development-collection/deployments","created_at":"2015-08-18T09:48:13Z","updated_at":"2016-05-27T08:05:53Z","pushed_at":"2016-06-10T06:59:31Z","git_url":"git://github.com/neos/flow-development-collection.git","ssh_url":"git@github.com:neos/flow-development-collection.git","clone_url":"https://github.com/neos/flow-development-collection.git","svn_url":"https://github.com/neos/flow-development-collection","homepage":"http://flow.typo3.org/","size":36839,"stargazers_count":38,"watchers_count":38,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":69,"mirror_url":null,"open_issues_count":34,"forks":69,"open_issues":34,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/321"},"html":{"href":"https://github.com/neos/flow-development-collection/pull/321"},"issue":{"href":"https://api.github.com/repos/neos/flow-development-collection/issues/321"},"comments":{"href":"https://api.github.com/repos/neos/flow-development-collection/issues/321/comments"},"review_comments":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/321/comments"},"review_comment":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/321/commits"},"statuses":{"href":"https://api.github.com/repos/neos/flow-development-collection/statuses/d3a73f45d5e52396f5371850388430aaf5caddb5"}}}}
{"actor":{"display_login":"albe"}}