{"action":"created","comment":{"url":"https://api.github.com/repos/cilium/cilium/pulls/comments/209387361","pull_request_review_id":145401550,"id":209387361,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTM4NzM2MQ==","diff_hunk":"@@ -0,0 +1,266 @@\n+package main\n+\n+import (\n+\t\"fmt\"\n+\t\"strings\"\n+\t\"strconv\"\n+\n+\tlog \"github.com/sirupsen/logrus\"\n+)\n+\n+type PasserParserFactory struct{}\n+\n+func init() {\n+\tlog.Info(\"init(): Registering PasserParserFactory\")\n+\tRegisterParserFactory(\"passer\", &PasserParserFactory{})\n+}\n+\n+type PasserParser struct{}\n+\n+func (p *PasserParserFactory) Create(connection *Connection) Parser {\n+\tlog.Infof(\"PasserParserFactory: Create: %v\", connection)\n+\treturn &PasserParser{}\n+}\n+\n+//\n+// This simply passes all data in either direction.\n+//\n+func (p *PasserParser) OnData(reply, endStream bool, data []string, offset uint) (FilterOpType, uint) {\n+\tn_bytes := uint(0)\n+\tfor _, s := range data {\n+\t\tn_bytes += uint(len(s)) - offset\n+\t\toffset = 0\n+\t}\n+\tif n_bytes == 0 {\n+\t\treturn FILTEROP_NOP, 0\n+\t}\n+\tif !reply {\n+\t\tlog.Infof(\"PasserParser: Request: %d bytes\", n_bytes)\n+\t} else {\n+\t\tlog.Infof(\"PasserParser: Response: %d bytes\", n_bytes)\n+\t}\n+\treturn FILTEROP_PASS, n_bytes\n+}\n+\n+//\n+// Line parser used for testing\n+//\n+\n+type LineParserFactory struct{}\n+\n+var lineParserFactory *LineParserFactory\n+\n+func init() {\n+\tlog.Info(\"init(): Registering lineParserFactory\")\n+\tRegisterParserFactory(\"linetester\", lineParserFactory)\n+}\n+\n+type LineParser struct {\n+\tconnection     *Connection\n+\tinserted       bool\n+}\n+\n+func (p *LineParserFactory) Create(connection *Connection) Parser {\n+\tlog.Infof(\"LineParserFactory: Create: %v\", connection)\n+\treturn &LineParser{connection: connection}\n+}\n+\n+func getLine(data []string, offset uint) (string, bool) {\n+\tvar line string\n+\tfor _, s := range data {\n+\t\tindex := strings.IndexByte(s[offset:], '\\n')\n+\t\tif index < 0 {\n+\t\t\tline += s[offset:]\n+\t\t} else {\n+\t\t\tline += s[offset : offset+uint(index)+1]\n+\t\t\treturn line, true\n+\t\t}\n+\t\toffset = 0\n+\t}\n+\treturn line, false\n+}\n+\n+//\n+// Parses individual lines that must start with one of:\n+// \"PASS\" the line is passed\n+// \"DROP\" the line is dropped\n+// \"INJECT\" the line is injected in reverse direction\n+// \"INSERT\" the line is injected in current direction\n+//\n+func (p *LineParser) OnData(reply, endStream bool, data []string, offset uint) (FilterOpType, uint) {\n+\tline, ok := getLine(data, offset)\n+\tline_len := uint(len(line))\n+\n+\tif p.inserted {\n+\t\tp.inserted = false\n+\t\treturn FILTEROP_DROP, line_len\n+\t}\n+\n+\tif !reply {\n+\t\tlog.Infof(\"LineParser: Request: %s\", line)\n+\t} else {\n+\t\tlog.Infof(\"LineParser: Response: %s\", line)\n+\t}\n+\n+\tif !ok {\n+\t\tif line_len > 0 {\n+\t\t\t// Partial line received, but no newline, ask for more\n+\t\t\treturn FILTEROP_MORE, 1\n+\t\t} else {","path":"envoy/gotestparser.go","position":109,"original_position":109,"commit_id":"fd5b5596648fd74da305407e18a6ac38f7365f65","original_commit_id":"fd5b5596648fd74da305407e18a6ac38f7365f65","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"if block ends with a return statement, so drop this else and outdent its block","created_at":"2018-08-10T21:18:46Z","updated_at":"2018-08-10T21:18:47Z","html_url":"https://github.com/cilium/cilium/pull/5174#discussion_r209387361","pull_request_url":"https://api.github.com/repos/cilium/cilium/pulls/5174","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/cilium/cilium/pulls/comments/209387361"},"html":{"href":"https://github.com/cilium/cilium/pull/5174#discussion_r209387361"},"pull_request":{"href":"https://api.github.com/repos/cilium/cilium/pulls/5174"}}},"pull_request":{"url":"https://api.github.com/repos/cilium/cilium/pulls/5174","id":207724738,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NzI0NzM4","html_url":"https://github.com/cilium/cilium/pull/5174","diff_url":"https://github.com/cilium/cilium/pull/5174.diff","patch_url":"https://github.com/cilium/cilium/pull/5174.patch","issue_url":"https://api.github.com/repos/cilium/cilium/issues/5174","number":5174,"state":"open","locked":false,"title":"envoy: Proof-of-concept golang Envoy filter","user":{"login":"jrajahalme","id":6518235,"node_id":"MDQ6VXNlcjY1MTgyMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/6518235?v=4","gravatar_id":"","url":"https://api.github.com/users/jrajahalme","html_url":"https://github.com/jrajahalme","followers_url":"https://api.github.com/users/jrajahalme/followers","following_url":"https://api.github.com/users/jrajahalme/following{/other_user}","gists_url":"https://api.github.com/users/jrajahalme/gists{/gist_id}","starred_url":"https://api.github.com/users/jrajahalme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrajahalme/subscriptions","organizations_url":"https://api.github.com/users/jrajahalme/orgs","repos_url":"https://api.github.com/users/jrajahalme/repos","events_url":"https://api.github.com/users/jrajahalme/events{/privacy}","received_events_url":"https://api.github.com/users/jrajahalme/received_events","type":"User","site_admin":false},"body":"This PR adds a Go interface to the `cilium.network` filter and the Go implementation of three simple test protocols exercised by running `make tests` in `/envoy`.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cilium/cilium/5174)\n<!-- Reviewable:end -->\n","created_at":"2018-08-10T21:18:37Z","updated_at":"2018-08-10T21:18:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"351c64fd5409352f86e00ed1e9d3cd758261a578","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"proxy","id":2519788,"node_id":"MDQ6VGVhbTI1MTk3ODg=","slug":"proxy","description":"Proxy layer","privacy":"closed","url":"https://api.github.com/teams/2519788","members_url":"https://api.github.com/teams/2519788/members{/member}","repositories_url":"https://api.github.com/teams/2519788/repos","permission":"pull"}],"labels":[{"id":721424175,"node_id":"MDU6TGFiZWw3MjE0MjQxNzU=","url":"https://api.github.com/repos/cilium/cilium/labels/area/proxy","name":"area/proxy","color":"fef2c0","default":false},{"id":403244562,"node_id":"MDU6TGFiZWw0MDMyNDQ1NjI=","url":"https://api.github.com/repos/cilium/cilium/labels/wip","name":"wip","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cilium/cilium/pulls/5174/commits","review_comments_url":"https://api.github.com/repos/cilium/cilium/pulls/5174/comments","review_comment_url":"https://api.github.com/repos/cilium/cilium/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cilium/cilium/issues/5174/comments","statuses_url":"https://api.github.com/repos/cilium/cilium/statuses/fd5b5596648fd74da305407e18a6ac38f7365f65","head":{"label":"cilium:pr/envoy-go-filter","ref":"pr/envoy-go-filter","sha":"fd5b5596648fd74da305407e18a6ac38f7365f65","user":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"repo":{"id":48109239,"node_id":"MDEwOlJlcG9zaXRvcnk0ODEwOTIzOQ==","name":"cilium","full_name":"cilium/cilium","owner":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cilium/cilium","description":"HTTP, gRPC, and Kafka Aware Security and Networking for Containers with BPF and XDP","fork":false,"url":"https://api.github.com/repos/cilium/cilium","forks_url":"https://api.github.com/repos/cilium/cilium/forks","keys_url":"https://api.github.com/repos/cilium/cilium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cilium/cilium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cilium/cilium/teams","hooks_url":"https://api.github.com/repos/cilium/cilium/hooks","issue_events_url":"https://api.github.com/repos/cilium/cilium/issues/events{/number}","events_url":"https://api.github.com/repos/cilium/cilium/events","assignees_url":"https://api.github.com/repos/cilium/cilium/assignees{/user}","branches_url":"https://api.github.com/repos/cilium/cilium/branches{/branch}","tags_url":"https://api.github.com/repos/cilium/cilium/tags","blobs_url":"https://api.github.com/repos/cilium/cilium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cilium/cilium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cilium/cilium/git/refs{/sha}","trees_url":"https://api.github.com/repos/cilium/cilium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cilium/cilium/statuses/{sha}","languages_url":"https://api.github.com/repos/cilium/cilium/languages","stargazers_url":"https://api.github.com/repos/cilium/cilium/stargazers","contributors_url":"https://api.github.com/repos/cilium/cilium/contributors","subscribers_url":"https://api.github.com/repos/cilium/cilium/subscribers","subscription_url":"https://api.github.com/repos/cilium/cilium/subscription","commits_url":"https://api.github.com/repos/cilium/cilium/commits{/sha}","git_commits_url":"https://api.github.com/repos/cilium/cilium/git/commits{/sha}","comments_url":"https://api.github.com/repos/cilium/cilium/comments{/number}","issue_comment_url":"https://api.github.com/repos/cilium/cilium/issues/comments{/number}","contents_url":"https://api.github.com/repos/cilium/cilium/contents/{+path}","compare_url":"https://api.github.com/repos/cilium/cilium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cilium/cilium/merges","archive_url":"https://api.github.com/repos/cilium/cilium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cilium/cilium/downloads","issues_url":"https://api.github.com/repos/cilium/cilium/issues{/number}","pulls_url":"https://api.github.com/repos/cilium/cilium/pulls{/number}","milestones_url":"https://api.github.com/repos/cilium/cilium/milestones{/number}","notifications_url":"https://api.github.com/repos/cilium/cilium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cilium/cilium/labels{/name}","releases_url":"https://api.github.com/repos/cilium/cilium/releases{/id}","deployments_url":"https://api.github.com/repos/cilium/cilium/deployments","created_at":"2015-12-16T12:33:31Z","updated_at":"2018-08-10T21:15:46Z","pushed_at":"2018-08-10T21:18:45Z","git_url":"git://github.com/cilium/cilium.git","ssh_url":"git@github.com:cilium/cilium.git","clone_url":"https://github.com/cilium/cilium.git","svn_url":"https://github.com/cilium/cilium","homepage":"","size":56638,"stargazers_count":2652,"watchers_count":2652,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":501,"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":236,"open_issues":501,"watchers":2652,"default_branch":"master"}},"base":{"label":"cilium:master","ref":"master","sha":"03f63bc3f1dd84c22e61340296080c692689e4d2","user":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"repo":{"id":48109239,"node_id":"MDEwOlJlcG9zaXRvcnk0ODEwOTIzOQ==","name":"cilium","full_name":"cilium/cilium","owner":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cilium/cilium","description":"HTTP, gRPC, and Kafka Aware Security and Networking for Containers with BPF and XDP","fork":false,"url":"https://api.github.com/repos/cilium/cilium","forks_url":"https://api.github.com/repos/cilium/cilium/forks","keys_url":"https://api.github.com/repos/cilium/cilium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cilium/cilium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cilium/cilium/teams","hooks_url":"https://api.github.com/repos/cilium/cilium/hooks","issue_events_url":"https://api.github.com/repos/cilium/cilium/issues/events{/number}","events_url":"https://api.github.com/repos/cilium/cilium/events","assignees_url":"https://api.github.com/repos/cilium/cilium/assignees{/user}","branches_url":"https://api.github.com/repos/cilium/cilium/branches{/branch}","tags_url":"https://api.github.com/repos/cilium/cilium/tags","blobs_url":"https://api.github.com/repos/cilium/cilium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cilium/cilium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cilium/cilium/git/refs{/sha}","trees_url":"https://api.github.com/repos/cilium/cilium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cilium/cilium/statuses/{sha}","languages_url":"https://api.github.com/repos/cilium/cilium/languages","stargazers_url":"https://api.github.com/repos/cilium/cilium/stargazers","contributors_url":"https://api.github.com/repos/cilium/cilium/contributors","subscribers_url":"https://api.github.com/repos/cilium/cilium/subscribers","subscription_url":"https://api.github.com/repos/cilium/cilium/subscription","commits_url":"https://api.github.com/repos/cilium/cilium/commits{/sha}","git_commits_url":"https://api.github.com/repos/cilium/cilium/git/commits{/sha}","comments_url":"https://api.github.com/repos/cilium/cilium/comments{/number}","issue_comment_url":"https://api.github.com/repos/cilium/cilium/issues/comments{/number}","contents_url":"https://api.github.com/repos/cilium/cilium/contents/{+path}","compare_url":"https://api.github.com/repos/cilium/cilium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cilium/cilium/merges","archive_url":"https://api.github.com/repos/cilium/cilium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cilium/cilium/downloads","issues_url":"https://api.github.com/repos/cilium/cilium/issues{/number}","pulls_url":"https://api.github.com/repos/cilium/cilium/pulls{/number}","milestones_url":"https://api.github.com/repos/cilium/cilium/milestones{/number}","notifications_url":"https://api.github.com/repos/cilium/cilium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cilium/cilium/labels{/name}","releases_url":"https://api.github.com/repos/cilium/cilium/releases{/id}","deployments_url":"https://api.github.com/repos/cilium/cilium/deployments","created_at":"2015-12-16T12:33:31Z","updated_at":"2018-08-10T21:15:46Z","pushed_at":"2018-08-10T21:18:45Z","git_url":"git://github.com/cilium/cilium.git","ssh_url":"git@github.com:cilium/cilium.git","clone_url":"https://github.com/cilium/cilium.git","svn_url":"https://github.com/cilium/cilium","homepage":"","size":56638,"stargazers_count":2652,"watchers_count":2652,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":501,"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":236,"open_issues":501,"watchers":2652,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cilium/cilium/pulls/5174"},"html":{"href":"https://github.com/cilium/cilium/pull/5174"},"issue":{"href":"https://api.github.com/repos/cilium/cilium/issues/5174"},"comments":{"href":"https://api.github.com/repos/cilium/cilium/issues/5174/comments"},"review_comments":{"href":"https://api.github.com/repos/cilium/cilium/pulls/5174/comments"},"review_comment":{"href":"https://api.github.com/repos/cilium/cilium/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cilium/cilium/pulls/5174/commits"},"statuses":{"href":"https://api.github.com/repos/cilium/cilium/statuses/fd5b5596648fd74da305407e18a6ac38f7365f65"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}