{"action":"created","comment":{"url":"https://api.github.com/repos/istio/proxy/pulls/comments/207949359","pull_request_review_id":143663489,"id":207949359,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzk0OTM1OQ==","diff_hunk":"@@ -71,6 +72,35 @@ void FilterContext::setPrincipal(const iaapi::PrincipalBinding& binding) {\n   }\n }\n \n+bool FilterContext::getJwtPayload(const std::string& issuer,\n+                                  std::string* payload) const {\n+  // auto location_iter =\n+  //     filter_config_.jwt_output_payload_locations().find(issuer);\n+  // if (location_iter == filter_config_.jwt_output_payload_locations().end()) {\n+  //   ENVOY_LOG(warn, \"No JWT payload output location is found for the issuer\n+  //   {}\", issuer); return false;\n+  // }\n+  const auto filter_it =\n+      dynamic_metadata_.filter_metadata().find(istio::utils::FilterName::kJwt);\n+  if (filter_it == dynamic_metadata_.filter_metadata().end()) {","path":"src/envoy/http/authn/filter_context.cc","position":22,"original_position":22,"commit_id":"fd51c41b520a44b8586e1632d9f4d40d3fc6cd69","original_commit_id":"fd51c41b520a44b8586e1632d9f4d40d3fc6cd69","user":{"login":"rshriram","id":8202871,"node_id":"MDQ6VXNlcjgyMDI4NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/8202871?v=4","gravatar_id":"","url":"https://api.github.com/users/rshriram","html_url":"https://github.com/rshriram","followers_url":"https://api.github.com/users/rshriram/followers","following_url":"https://api.github.com/users/rshriram/following{/other_user}","gists_url":"https://api.github.com/users/rshriram/gists{/gist_id}","starred_url":"https://api.github.com/users/rshriram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rshriram/subscriptions","organizations_url":"https://api.github.com/users/rshriram/orgs","repos_url":"https://api.github.com/users/rshriram/repos","events_url":"https://api.github.com/users/rshriram/events{/privacy}","received_events_url":"https://api.github.com/users/rshriram/received_events","type":"User","site_admin":false},"body":"Is this using the stuff that went into envoy recently (for exchanging info between filters)? If so, doesn't that require filters to declare dependencies ? ","created_at":"2018-08-06T16:15:50Z","updated_at":"2018-08-06T16:15:50Z","html_url":"https://github.com/istio/proxy/pull/1893#discussion_r207949359","pull_request_url":"https://api.github.com/repos/istio/proxy/pulls/1893","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/istio/proxy/pulls/comments/207949359"},"html":{"href":"https://github.com/istio/proxy/pull/1893#discussion_r207949359"},"pull_request":{"href":"https://api.github.com/repos/istio/proxy/pulls/1893"}}},"pull_request":{"url":"https://api.github.com/repos/istio/proxy/pulls/1893","id":206122438,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MTIyNDM4","html_url":"https://github.com/istio/proxy/pull/1893","diff_url":"https://github.com/istio/proxy/pull/1893.diff","patch_url":"https://github.com/istio/proxy/pull/1893.patch","issue_url":"https://api.github.com/repos/istio/proxy/issues/1893","number":1893,"state":"open","locked":false,"title":"Using request dynamic metadata to pass data from JWT filter to authn filter.","user":{"login":"diemtvu","id":25132401,"node_id":"MDQ6VXNlcjI1MTMyNDAx","avatar_url":"https://avatars0.githubusercontent.com/u/25132401?v=4","gravatar_id":"","url":"https://api.github.com/users/diemtvu","html_url":"https://github.com/diemtvu","followers_url":"https://api.github.com/users/diemtvu/followers","following_url":"https://api.github.com/users/diemtvu/following{/other_user}","gists_url":"https://api.github.com/users/diemtvu/gists{/gist_id}","starred_url":"https://api.github.com/users/diemtvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diemtvu/subscriptions","organizations_url":"https://api.github.com/users/diemtvu/orgs","repos_url":"https://api.github.com/users/diemtvu/repos","events_url":"https://api.github.com/users/diemtvu/events{/privacy}","received_events_url":"https://api.github.com/users/diemtvu/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\n\r\nPreviously, we used headers to exchange data between JWT filter and Authn filter (and authn filter and mixer filter, but this is not addressed in the PR). This has some overhead (e.g encode/decode data so it can be save in header, extra information needed in API to define location etc), and most of all, trouble to clean up all those added data properly.\r\n\r\nIn this PR, we change JWT filter to (always) output payload data to request info metadata instead. The entry is keyed by JWT issuer so no need location information in the config and simpler for look up.\r\n\r\n**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #\r\n\r\n**Special notes for your reviewer**:\r\n\r\n* There is no simple way to verify data in request info for integration test. This will be addressed in the next PRs.\r\n* Also, as mentioned, changes for mixer to use data in request info (even though it's already populated both places) will be done later.","created_at":"2018-08-03T19:45:35Z","updated_at":"2018-08-06T16:15:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e15772ff2518b180427fa7d58d3b4ed8dd7a12c7","assignee":{"login":"qiwzhang","id":11790727,"node_id":"MDQ6VXNlcjExNzkwNzI3","avatar_url":"https://avatars0.githubusercontent.com/u/11790727?v=4","gravatar_id":"","url":"https://api.github.com/users/qiwzhang","html_url":"https://github.com/qiwzhang","followers_url":"https://api.github.com/users/qiwzhang/followers","following_url":"https://api.github.com/users/qiwzhang/following{/other_user}","gists_url":"https://api.github.com/users/qiwzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/qiwzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiwzhang/subscriptions","organizations_url":"https://api.github.com/users/qiwzhang/orgs","repos_url":"https://api.github.com/users/qiwzhang/repos","events_url":"https://api.github.com/users/qiwzhang/events{/privacy}","received_events_url":"https://api.github.com/users/qiwzhang/received_events","type":"User","site_admin":false},"assignees":[{"login":"qiwzhang","id":11790727,"node_id":"MDQ6VXNlcjExNzkwNzI3","avatar_url":"https://avatars0.githubusercontent.com/u/11790727?v=4","gravatar_id":"","url":"https://api.github.com/users/qiwzhang","html_url":"https://github.com/qiwzhang","followers_url":"https://api.github.com/users/qiwzhang/followers","following_url":"https://api.github.com/users/qiwzhang/following{/other_user}","gists_url":"https://api.github.com/users/qiwzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/qiwzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiwzhang/subscriptions","organizations_url":"https://api.github.com/users/qiwzhang/orgs","repos_url":"https://api.github.com/users/qiwzhang/repos","events_url":"https://api.github.com/users/qiwzhang/events{/privacy}","received_events_url":"https://api.github.com/users/qiwzhang/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"sebastienvas","id":17773671,"node_id":"MDQ6VXNlcjE3NzczNjcx","avatar_url":"https://avatars1.githubusercontent.com/u/17773671?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastienvas","html_url":"https://github.com/sebastienvas","followers_url":"https://api.github.com/users/sebastienvas/followers","following_url":"https://api.github.com/users/sebastienvas/following{/other_user}","gists_url":"https://api.github.com/users/sebastienvas/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastienvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastienvas/subscriptions","organizations_url":"https://api.github.com/users/sebastienvas/orgs","repos_url":"https://api.github.com/users/sebastienvas/repos","events_url":"https://api.github.com/users/sebastienvas/events{/privacy}","received_events_url":"https://api.github.com/users/sebastienvas/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":712050392,"node_id":"MDU6TGFiZWw3MTIwNTAzOTI=","url":"https://api.github.com/repos/istio/proxy/labels/cla:%20yes","name":"cla: yes","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/istio/proxy/pulls/1893/commits","review_comments_url":"https://api.github.com/repos/istio/proxy/pulls/1893/comments","review_comment_url":"https://api.github.com/repos/istio/proxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/proxy/issues/1893/comments","statuses_url":"https://api.github.com/repos/istio/proxy/statuses/fd51c41b520a44b8586e1632d9f4d40d3fc6cd69","head":{"label":"diemtvu:dyn-meta","ref":"dyn-meta","sha":"fd51c41b520a44b8586e1632d9f4d40d3fc6cd69","user":{"login":"diemtvu","id":25132401,"node_id":"MDQ6VXNlcjI1MTMyNDAx","avatar_url":"https://avatars0.githubusercontent.com/u/25132401?v=4","gravatar_id":"","url":"https://api.github.com/users/diemtvu","html_url":"https://github.com/diemtvu","followers_url":"https://api.github.com/users/diemtvu/followers","following_url":"https://api.github.com/users/diemtvu/following{/other_user}","gists_url":"https://api.github.com/users/diemtvu/gists{/gist_id}","starred_url":"https://api.github.com/users/diemtvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diemtvu/subscriptions","organizations_url":"https://api.github.com/users/diemtvu/orgs","repos_url":"https://api.github.com/users/diemtvu/repos","events_url":"https://api.github.com/users/diemtvu/events{/privacy}","received_events_url":"https://api.github.com/users/diemtvu/received_events","type":"User","site_admin":false},"repo":{"id":103309423,"node_id":"MDEwOlJlcG9zaXRvcnkxMDMzMDk0MjM=","name":"proxy","full_name":"diemtvu/proxy","owner":{"login":"diemtvu","id":25132401,"node_id":"MDQ6VXNlcjI1MTMyNDAx","avatar_url":"https://avatars0.githubusercontent.com/u/25132401?v=4","gravatar_id":"","url":"https://api.github.com/users/diemtvu","html_url":"https://github.com/diemtvu","followers_url":"https://api.github.com/users/diemtvu/followers","following_url":"https://api.github.com/users/diemtvu/following{/other_user}","gists_url":"https://api.github.com/users/diemtvu/gists{/gist_id}","starred_url":"https://api.github.com/users/diemtvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diemtvu/subscriptions","organizations_url":"https://api.github.com/users/diemtvu/orgs","repos_url":"https://api.github.com/users/diemtvu/repos","events_url":"https://api.github.com/users/diemtvu/events{/privacy}","received_events_url":"https://api.github.com/users/diemtvu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diemtvu/proxy","description":"The Istio proxy components.","fork":true,"url":"https://api.github.com/repos/diemtvu/proxy","forks_url":"https://api.github.com/repos/diemtvu/proxy/forks","keys_url":"https://api.github.com/repos/diemtvu/proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diemtvu/proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diemtvu/proxy/teams","hooks_url":"https://api.github.com/repos/diemtvu/proxy/hooks","issue_events_url":"https://api.github.com/repos/diemtvu/proxy/issues/events{/number}","events_url":"https://api.github.com/repos/diemtvu/proxy/events","assignees_url":"https://api.github.com/repos/diemtvu/proxy/assignees{/user}","branches_url":"https://api.github.com/repos/diemtvu/proxy/branches{/branch}","tags_url":"https://api.github.com/repos/diemtvu/proxy/tags","blobs_url":"https://api.github.com/repos/diemtvu/proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diemtvu/proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diemtvu/proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/diemtvu/proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diemtvu/proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/diemtvu/proxy/languages","stargazers_url":"https://api.github.com/repos/diemtvu/proxy/stargazers","contributors_url":"https://api.github.com/repos/diemtvu/proxy/contributors","subscribers_url":"https://api.github.com/repos/diemtvu/proxy/subscribers","subscription_url":"https://api.github.com/repos/diemtvu/proxy/subscription","commits_url":"https://api.github.com/repos/diemtvu/proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/diemtvu/proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/diemtvu/proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/diemtvu/proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/diemtvu/proxy/contents/{+path}","compare_url":"https://api.github.com/repos/diemtvu/proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diemtvu/proxy/merges","archive_url":"https://api.github.com/repos/diemtvu/proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diemtvu/proxy/downloads","issues_url":"https://api.github.com/repos/diemtvu/proxy/issues{/number}","pulls_url":"https://api.github.com/repos/diemtvu/proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/diemtvu/proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/diemtvu/proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diemtvu/proxy/labels{/name}","releases_url":"https://api.github.com/repos/diemtvu/proxy/releases{/id}","deployments_url":"https://api.github.com/repos/diemtvu/proxy/deployments","created_at":"2017-09-12T18:57:50Z","updated_at":"2018-07-19T15:44:19Z","pushed_at":"2018-08-03T19:09:03Z","git_url":"git://github.com/diemtvu/proxy.git","ssh_url":"git@github.com:diemtvu/proxy.git","clone_url":"https://github.com/diemtvu/proxy.git","svn_url":"https://github.com/diemtvu/proxy","homepage":"","size":2655,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"istio:master","ref":"master","sha":"c42e08bf3c7b97a1e20441fff126be15cc5a86ff","user":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":75322405,"node_id":"MDEwOlJlcG9zaXRvcnk3NTMyMjQwNQ==","name":"proxy","full_name":"istio/proxy","owner":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istio/proxy","description":"The Istio proxy components.","fork":false,"url":"https://api.github.com/repos/istio/proxy","forks_url":"https://api.github.com/repos/istio/proxy/forks","keys_url":"https://api.github.com/repos/istio/proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/proxy/teams","hooks_url":"https://api.github.com/repos/istio/proxy/hooks","issue_events_url":"https://api.github.com/repos/istio/proxy/issues/events{/number}","events_url":"https://api.github.com/repos/istio/proxy/events","assignees_url":"https://api.github.com/repos/istio/proxy/assignees{/user}","branches_url":"https://api.github.com/repos/istio/proxy/branches{/branch}","tags_url":"https://api.github.com/repos/istio/proxy/tags","blobs_url":"https://api.github.com/repos/istio/proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/proxy/languages","stargazers_url":"https://api.github.com/repos/istio/proxy/stargazers","contributors_url":"https://api.github.com/repos/istio/proxy/contributors","subscribers_url":"https://api.github.com/repos/istio/proxy/subscribers","subscription_url":"https://api.github.com/repos/istio/proxy/subscription","commits_url":"https://api.github.com/repos/istio/proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/proxy/contents/{+path}","compare_url":"https://api.github.com/repos/istio/proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/proxy/merges","archive_url":"https://api.github.com/repos/istio/proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/proxy/downloads","issues_url":"https://api.github.com/repos/istio/proxy/issues{/number}","pulls_url":"https://api.github.com/repos/istio/proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/proxy/labels{/name}","releases_url":"https://api.github.com/repos/istio/proxy/releases{/id}","deployments_url":"https://api.github.com/repos/istio/proxy/deployments","created_at":"2016-12-01T18:51:04Z","updated_at":"2018-08-06T15:33:42Z","pushed_at":"2018-08-06T15:33:39Z","git_url":"git://github.com/istio/proxy.git","ssh_url":"git@github.com:istio/proxy.git","clone_url":"https://github.com/istio/proxy.git","svn_url":"https://github.com/istio/proxy","homepage":"","size":2646,"stargazers_count":150,"watchers_count":150,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":110,"open_issues":38,"watchers":150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/proxy/pulls/1893"},"html":{"href":"https://github.com/istio/proxy/pull/1893"},"issue":{"href":"https://api.github.com/repos/istio/proxy/issues/1893"},"comments":{"href":"https://api.github.com/repos/istio/proxy/issues/1893/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/proxy/pulls/1893/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/proxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/proxy/pulls/1893/commits"},"statuses":{"href":"https://api.github.com/repos/istio/proxy/statuses/fd51c41b520a44b8586e1632d9f4d40d3fc6cd69"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rshriram"}}