{"action":"created","issue":{"url":"https://api.github.com/repos/Kong/kong/issues/3213","repository_url":"https://api.github.com/repos/Kong/kong","labels_url":"https://api.github.com/repos/Kong/kong/issues/3213/labels{/name}","comments_url":"https://api.github.com/repos/Kong/kong/issues/3213/comments","events_url":"https://api.github.com/repos/Kong/kong/issues/3213/events","html_url":"https://github.com/Kong/kong/pull/3213","id":296230887,"number":3213,"title":"fix(key-auth) properly re-encode request body","user":{"login":"p0pr0ck5","id":4625425,"avatar_url":"https://avatars0.githubusercontent.com/u/4625425?v=4","gravatar_id":"","url":"https://api.github.com/users/p0pr0ck5","html_url":"https://github.com/p0pr0ck5","followers_url":"https://api.github.com/users/p0pr0ck5/followers","following_url":"https://api.github.com/users/p0pr0ck5/following{/other_user}","gists_url":"https://api.github.com/users/p0pr0ck5/gists{/gist_id}","starred_url":"https://api.github.com/users/p0pr0ck5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0pr0ck5/subscriptions","organizations_url":"https://api.github.com/users/p0pr0ck5/orgs","repos_url":"https://api.github.com/users/p0pr0ck5/repos","events_url":"https://api.github.com/users/p0pr0ck5/events{/privacy}","received_events_url":"https://api.github.com/users/p0pr0ck5/received_events","type":"User","site_admin":false},"labels":[{"id":300632521,"url":"https://api.github.com/repos/Kong/kong/labels/pr/status/changes%20requested","name":"pr/status/changes requested","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-11T22:10:08Z","updated_at":"2018-03-13T04:41:49Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Kong/kong/pulls/3213","html_url":"https://github.com/Kong/kong/pull/3213","diff_url":"https://github.com/Kong/kong/pull/3213.diff","patch_url":"https://github.com/Kong/kong/pull/3213.patch"},"body":"### Summary\r\n\r\nWhen both key_in_body and hide_credentials are set, we previously re-encoded the request body as a form/url-encoded entity, regardless of the request content type (and without changing the content type\r\nheader!). This commit refactors the key_in_body behavior to be a bit more robust and handle request types that the existing Kong API can decode/encode via the 'get_body_info' public function.\r\n\r\nThis PR is to be accompanied by a getkong.org PR that explicitly documents this behavior, and notifies Kong administrators that the simultaneous use of `hide_credentials` and `key_in_body` is limited to a given set of request body types.\r\n\r\n### Full changelog\r\n\r\n* Hide `key-auth` credentials sent in the request body, and re-encode the body`, when the `hide_credentials` and `key_in_body` plugin values are set, for `application/json`, `multipart/form-data`, and `application/www-form-urlencoded` request bodies.\r\n* Bail with a `BAD_REQUEST` status when the client sends a request with an unsupported body type, when both `hide_credentials` and `key_in_body` are set.\r\n* Expand the `key-auth` plugin access tests to cover this new behavior.\r\n\r\n### Issues resolved\r\n\r\nFix #3108.\r\n"},"comment":{"url":"https://api.github.com/repos/Kong/kong/issues/comments/372545072","html_url":"https://github.com/Kong/kong/pull/3213#issuecomment-372545072","issue_url":"https://api.github.com/repos/Kong/kong/issues/3213","id":372545072,"user":{"login":"thibaultcha","id":1125431,"avatar_url":"https://avatars2.githubusercontent.com/u/1125431?v=4","gravatar_id":"","url":"https://api.github.com/users/thibaultcha","html_url":"https://github.com/thibaultcha","followers_url":"https://api.github.com/users/thibaultcha/followers","following_url":"https://api.github.com/users/thibaultcha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultcha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultcha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultcha/subscriptions","organizations_url":"https://api.github.com/users/thibaultcha/orgs","repos_url":"https://api.github.com/users/thibaultcha/repos","events_url":"https://api.github.com/users/thibaultcha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultcha/received_events","type":"User","site_admin":false},"created_at":"2018-03-13T04:41:49Z","updated_at":"2018-03-13T04:41:49Z","author_association":"OWNER","body":"Gave this another look now that we have lua-multipart 0.5.4, but unfortunately the test is still failing (because of lua-multipart) :/"}}
{"actor":{"display_login":"thibaultcha"}}