{"action":"created","comment":{"url":"https://api.github.com/repos/3scale/apicast/pulls/comments/150189067","pull_request_review_id":75703165,"id":150189067,"diff_hunk":"@@ -0,0 +1,45 @@\n+local setmetatable = setmetatable\n+\n+local _M = {\n+\n+}\n+\n+local noop = function() end\n+\n+\n+local empty_t = setmetatable({}, { __newindex = noop })\n+local __index = function(t,k)\n+    return t.current[k] or t.next[k]\n+end\n+\n+local ro_mt = {\n+    __index = __index,\n+    __newindex = noop,","path":"apicast/src/linked_list.lua","position":17,"original_position":17,"commit_id":"6964c9e0f856f5a385d7e22c56b0858666cbfb5f","original_commit_id":"6964c9e0f856f5a385d7e22c56b0858666cbfb5f","user":{"login":"mikz","id":154571,"avatar_url":"https://avatars3.githubusercontent.com/u/154571?v=4","gravatar_id":"","url":"https://api.github.com/users/mikz","html_url":"https://github.com/mikz","followers_url":"https://api.github.com/users/mikz/followers","following_url":"https://api.github.com/users/mikz/following{/other_user}","gists_url":"https://api.github.com/users/mikz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikz/subscriptions","organizations_url":"https://api.github.com/users/mikz/orgs","repos_url":"https://api.github.com/users/mikz/repos","events_url":"https://api.github.com/users/mikz/events{/privacy}","received_events_url":"https://api.github.com/users/mikz/received_events","type":"User","site_admin":false},"body":"Good point.","created_at":"2017-11-10T09:35:15Z","updated_at":"2017-11-10T09:35:15Z","html_url":"https://github.com/3scale/apicast/pull/450#discussion_r150189067","pull_request_url":"https://api.github.com/repos/3scale/apicast/pulls/450","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/3scale/apicast/pulls/comments/150189067"},"html":{"href":"https://github.com/3scale/apicast/pull/450#discussion_r150189067"},"pull_request":{"href":"https://api.github.com/repos/3scale/apicast/pulls/450"}},"in_reply_to_id":150177920},"pull_request":{"url":"https://api.github.com/repos/3scale/apicast/pulls/450","id":145680237,"html_url":"https://github.com/3scale/apicast/pull/450","diff_url":"https://github.com/3scale/apicast/pull/450.diff","patch_url":"https://github.com/3scale/apicast/pull/450.patch","issue_url":"https://api.github.com/repos/3scale/apicast/issues/450","number":450,"state":"open","locked":false,"title":"[WIP] policy chain prototype","user":{"login":"mikz","id":154571,"avatar_url":"https://avatars3.githubusercontent.com/u/154571?v=4","gravatar_id":"","url":"https://api.github.com/users/mikz","html_url":"https://github.com/mikz","followers_url":"https://api.github.com/users/mikz/followers","following_url":"https://api.github.com/users/mikz/following{/other_user}","gists_url":"https://api.github.com/users/mikz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikz/subscriptions","organizations_url":"https://api.github.com/users/mikz/orgs","repos_url":"https://api.github.com/users/mikz/repos","events_url":"https://api.github.com/users/mikz/events{/privacy}","received_events_url":"https://api.github.com/users/mikz/received_events","type":"User","site_admin":false},"body":"Early prototype of how we could chain policies.\r\n\r\nPolicies can export data that is stored in read only structure and resolved in order they are defined in.\r\nSo values can be overlaid, but not overridden and only the latest one is being used.\r\nThis would allow overriding some internal structures being passed between policies.\r\n\r\nContext object is passed to each policy phase invocation method. This context object has last layer mutable so policies can pass data.\r\n\r\nPolicy chain is itself a policy. All phase methods are compatible. So policy chain can contain policy chains.\r\nThis is used to split the chain into two: global and local. Global chain is responsible for loading configuration and local can be created based on downloaded configuration. \r\n\r\n\r\n# TODO\r\n\r\n- [ ] figure out how installed policies can change the nginx template \r\n  - the list of policies enabled globally can be defined by some global config\r\n  - the important piece is how would the policy be able to extend the nginx template\r\n  - consider how policies would interact with each other and blocks that could extend\r\n  - decide if it is template manipulation (like something like https://github.com/spree/deface ) or some dsl compiled to nginx config","created_at":"2017-10-10T12:39:03Z","updated_at":"2017-11-10T09:35:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14d5ce9ca3e6e2abe94f81c8b463c45df5993292","assignee":{"login":"mikz","id":154571,"avatar_url":"https://avatars3.githubusercontent.com/u/154571?v=4","gravatar_id":"","url":"https://api.github.com/users/mikz","html_url":"https://github.com/mikz","followers_url":"https://api.github.com/users/mikz/followers","following_url":"https://api.github.com/users/mikz/following{/other_user}","gists_url":"https://api.github.com/users/mikz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikz/subscriptions","organizations_url":"https://api.github.com/users/mikz/orgs","repos_url":"https://api.github.com/users/mikz/repos","events_url":"https://api.github.com/users/mikz/events{/privacy}","received_events_url":"https://api.github.com/users/mikz/received_events","type":"User","site_admin":false},"assignees":[{"login":"mikz","id":154571,"avatar_url":"https://avatars3.githubusercontent.com/u/154571?v=4","gravatar_id":"","url":"https://api.github.com/users/mikz","html_url":"https://github.com/mikz","followers_url":"https://api.github.com/users/mikz/followers","following_url":"https://api.github.com/users/mikz/following{/other_user}","gists_url":"https://api.github.com/users/mikz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikz/subscriptions","organizations_url":"https://api.github.com/users/mikz/orgs","repos_url":"https://api.github.com/users/mikz/repos","events_url":"https://api.github.com/users/mikz/events{/privacy}","received_events_url":"https://api.github.com/users/mikz/received_events","type":"User","site_admin":false},{"login":"davidor","id":907223,"avatar_url":"https://avatars2.githubusercontent.com/u/907223?v=4","gravatar_id":"","url":"https://api.github.com/users/davidor","html_url":"https://github.com/davidor","followers_url":"https://api.github.com/users/davidor/followers","following_url":"https://api.github.com/users/davidor/following{/other_user}","gists_url":"https://api.github.com/users/davidor/gists{/gist_id}","starred_url":"https://api.github.com/users/davidor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidor/subscriptions","organizations_url":"https://api.github.com/users/davidor/orgs","repos_url":"https://api.github.com/users/davidor/repos","events_url":"https://api.github.com/users/davidor/events{/privacy}","received_events_url":"https://api.github.com/users/davidor/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/3scale/apicast/pulls/450/commits","review_comments_url":"https://api.github.com/repos/3scale/apicast/pulls/450/comments","review_comment_url":"https://api.github.com/repos/3scale/apicast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/3scale/apicast/issues/450/comments","statuses_url":"https://api.github.com/repos/3scale/apicast/statuses/6964c9e0f856f5a385d7e22c56b0858666cbfb5f","head":{"label":"3scale:policy-chain","ref":"policy-chain","sha":"6964c9e0f856f5a385d7e22c56b0858666cbfb5f","user":{"login":"3scale","id":21415,"avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":53965666,"name":"apicast","full_name":"3scale/apicast","owner":{"login":"3scale","id":21415,"avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/3scale/apicast","description":"3scale api gateway reloaded","fork":false,"url":"https://api.github.com/repos/3scale/apicast","forks_url":"https://api.github.com/repos/3scale/apicast/forks","keys_url":"https://api.github.com/repos/3scale/apicast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/apicast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/apicast/teams","hooks_url":"https://api.github.com/repos/3scale/apicast/hooks","issue_events_url":"https://api.github.com/repos/3scale/apicast/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/apicast/events","assignees_url":"https://api.github.com/repos/3scale/apicast/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/apicast/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/apicast/tags","blobs_url":"https://api.github.com/repos/3scale/apicast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/apicast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/apicast/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/apicast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/apicast/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/apicast/languages","stargazers_url":"https://api.github.com/repos/3scale/apicast/stargazers","contributors_url":"https://api.github.com/repos/3scale/apicast/contributors","subscribers_url":"https://api.github.com/repos/3scale/apicast/subscribers","subscription_url":"https://api.github.com/repos/3scale/apicast/subscription","commits_url":"https://api.github.com/repos/3scale/apicast/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/apicast/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/apicast/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/apicast/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/apicast/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/apicast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/apicast/merges","archive_url":"https://api.github.com/repos/3scale/apicast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/apicast/downloads","issues_url":"https://api.github.com/repos/3scale/apicast/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/apicast/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/apicast/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/apicast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/apicast/labels{/name}","releases_url":"https://api.github.com/repos/3scale/apicast/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/apicast/deployments","created_at":"2016-03-15T17:41:51Z","updated_at":"2017-11-01T11:02:18Z","pushed_at":"2017-11-09T17:05:44Z","git_url":"git://github.com/3scale/apicast.git","ssh_url":"git@github.com:3scale/apicast.git","clone_url":"https://github.com/3scale/apicast.git","svn_url":"https://github.com/3scale/apicast","homepage":"","size":1847,"stargazers_count":54,"watchers_count":54,"language":"Lua","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"archived":false,"open_issues_count":30,"forks":41,"open_issues":30,"watchers":54,"default_branch":"master"}},"base":{"label":"3scale:master","ref":"master","sha":"1ada72fc2ca5c11f4685f2e035f7ecaa0af1b296","user":{"login":"3scale","id":21415,"avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":53965666,"name":"apicast","full_name":"3scale/apicast","owner":{"login":"3scale","id":21415,"avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/3scale/apicast","description":"3scale api gateway reloaded","fork":false,"url":"https://api.github.com/repos/3scale/apicast","forks_url":"https://api.github.com/repos/3scale/apicast/forks","keys_url":"https://api.github.com/repos/3scale/apicast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/apicast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/apicast/teams","hooks_url":"https://api.github.com/repos/3scale/apicast/hooks","issue_events_url":"https://api.github.com/repos/3scale/apicast/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/apicast/events","assignees_url":"https://api.github.com/repos/3scale/apicast/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/apicast/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/apicast/tags","blobs_url":"https://api.github.com/repos/3scale/apicast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/apicast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/apicast/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/apicast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/apicast/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/apicast/languages","stargazers_url":"https://api.github.com/repos/3scale/apicast/stargazers","contributors_url":"https://api.github.com/repos/3scale/apicast/contributors","subscribers_url":"https://api.github.com/repos/3scale/apicast/subscribers","subscription_url":"https://api.github.com/repos/3scale/apicast/subscription","commits_url":"https://api.github.com/repos/3scale/apicast/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/apicast/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/apicast/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/apicast/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/apicast/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/apicast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/apicast/merges","archive_url":"https://api.github.com/repos/3scale/apicast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/apicast/downloads","issues_url":"https://api.github.com/repos/3scale/apicast/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/apicast/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/apicast/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/apicast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/apicast/labels{/name}","releases_url":"https://api.github.com/repos/3scale/apicast/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/apicast/deployments","created_at":"2016-03-15T17:41:51Z","updated_at":"2017-11-01T11:02:18Z","pushed_at":"2017-11-09T17:05:44Z","git_url":"git://github.com/3scale/apicast.git","ssh_url":"git@github.com:3scale/apicast.git","clone_url":"https://github.com/3scale/apicast.git","svn_url":"https://github.com/3scale/apicast","homepage":"","size":1847,"stargazers_count":54,"watchers_count":54,"language":"Lua","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"archived":false,"open_issues_count":30,"forks":41,"open_issues":30,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/3scale/apicast/pulls/450"},"html":{"href":"https://github.com/3scale/apicast/pull/450"},"issue":{"href":"https://api.github.com/repos/3scale/apicast/issues/450"},"comments":{"href":"https://api.github.com/repos/3scale/apicast/issues/450/comments"},"review_comments":{"href":"https://api.github.com/repos/3scale/apicast/pulls/450/comments"},"review_comment":{"href":"https://api.github.com/repos/3scale/apicast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/3scale/apicast/pulls/450/commits"},"statuses":{"href":"https://api.github.com/repos/3scale/apicast/statuses/6964c9e0f856f5a385d7e22c56b0858666cbfb5f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mikz"}}