{"action":"created","comment":{"url":"https://api.github.com/repos/triplea-game/triplea/pulls/comments/223193481","pull_request_review_id":162269808,"id":223193481,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzE5MzQ4MQ==","diff_hunk":"@@ -0,0 +1,17 @@\n+package org.triplea.lobby.server.controller.rest;\n+\n+import static spark.Spark.path;\n+\n+import org.triplea.lobby.server.config.LobbyConfiguration;\n+import org.triplea.lobby.server.db.Database;\n+\n+/**\n+ * Main Routing class to connect all Controllers together.\n+ */\n+public class ControllerHub {\n+\n+  public static void initializeControllers(final LobbyConfiguration configuration) {\n+    final Database database = new Database(configuration);\n+    path(\"/api/v0\", new ModeratorActionController(database)::initializeRoutes);","path":"lobby/src/main/java/org/triplea/lobby/server/controller/rest/ControllerHub.java","position":15,"original_position":15,"commit_id":"ba547d072d952e7614486362ab734e280285d395","original_commit_id":"ba547d072d952e7614486362ab734e280285d395","user":{"login":"RoiEXLab","id":8350879,"node_id":"MDQ6VXNlcjgzNTA4Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/8350879?v=4","gravatar_id":"","url":"https://api.github.com/users/RoiEXLab","html_url":"https://github.com/RoiEXLab","followers_url":"https://api.github.com/users/RoiEXLab/followers","following_url":"https://api.github.com/users/RoiEXLab/following{/other_user}","gists_url":"https://api.github.com/users/RoiEXLab/gists{/gist_id}","starred_url":"https://api.github.com/users/RoiEXLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoiEXLab/subscriptions","organizations_url":"https://api.github.com/users/RoiEXLab/orgs","repos_url":"https://api.github.com/users/RoiEXLab/repos","events_url":"https://api.github.com/users/RoiEXLab/events{/privacy}","received_events_url":"https://api.github.com/users/RoiEXLab/received_events","type":"User","site_admin":false},"body":"I wasn't aware that the `http-server` module aims to replace the lobby entirely, mainly because currently the only classes that are implemented relate to the error reporting mechanism, which I'm not sure if it should be part of the same server as the lobby","created_at":"2018-10-06T20:52:38Z","updated_at":"2018-10-06T20:52:39Z","html_url":"https://github.com/triplea-game/triplea/pull/4148#discussion_r223193481","pull_request_url":"https://api.github.com/repos/triplea-game/triplea/pulls/4148","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/comments/223193481"},"html":{"href":"https://github.com/triplea-game/triplea/pull/4148#discussion_r223193481"},"pull_request":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/4148"}},"in_reply_to_id":223161997},"pull_request":{"url":"https://api.github.com/repos/triplea-game/triplea/pulls/4148","id":220830482,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwODMwNDgy","html_url":"https://github.com/triplea-game/triplea/pull/4148","diff_url":"https://github.com/triplea-game/triplea/pull/4148.diff","patch_url":"https://github.com/triplea-game/triplea/pull/4148.patch","issue_url":"https://api.github.com/repos/triplea-game/triplea/issues/4148","number":4148,"state":"open","locked":false,"title":"Add Proof-of-Concept controller for moderation actions","user":{"login":"RoiEXLab","id":8350879,"node_id":"MDQ6VXNlcjgzNTA4Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/8350879?v=4","gravatar_id":"","url":"https://api.github.com/users/RoiEXLab","html_url":"https://github.com/RoiEXLab","followers_url":"https://api.github.com/users/RoiEXLab/followers","following_url":"https://api.github.com/users/RoiEXLab/following{/other_user}","gists_url":"https://api.github.com/users/RoiEXLab/gists{/gist_id}","starred_url":"https://api.github.com/users/RoiEXLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoiEXLab/subscriptions","organizations_url":"https://api.github.com/users/RoiEXLab/orgs","repos_url":"https://api.github.com/users/RoiEXLab/repos","events_url":"https://api.github.com/users/RoiEXLab/events{/privacy}","received_events_url":"https://api.github.com/users/RoiEXLab/received_events","type":"User","site_admin":false},"body":"## Overview\r\nThis PR adds a working prototype that could be extended for all moderation commands to work with it.\r\nI'd like to hear your opinion on the general class layout and the resulting dependencies on each other.\r\nI'm also planning to read some properties from the lobby config to allow for HTTPS and custom port numbers.\r\nAlso we should probably introduce a sophisticated authentification system like JSON Web Tokens or something, so w don't have to pass the password every time, but could send a Bearer Token in the header instead.\r\n\r\n## Functional Changes\r\nThe Lobby now launches a HTTP server as well, which can be communicated with using  simple HTTP requests.\r\nCurrently available endpoint (cURL):\r\nScheme:\r\n```\r\ncurl \\\r\n-d \"username=<moderator username>\" \\\r\n-d \"password=<moderator password>\" \\\r\nhttp://localhost:4567/api/v0/moderate/<user to change role>/set-permission/<role>\r\n```\r\nExample:\r\n```\r\ncurl \\\r\n-d \"username=RoiEX\" \\\r\n-d \"password=23829f97d7095e1dbc6a5c4d001e76e3ebc3254d0<cropped>\" \\\r\nhttp://localhost:4567/api/v0/moderate/RoiEX/set-permission/ADMIN\r\n```\r\n\r\n## Manual Testing Performed\r\nI verified I could perform a couple of actions using curl.\r\n\r\n##### Unrelated\r\nDuring testing I noticed a potential security issue. Not sure how severe it is, but I'll describe it in gitter.","created_at":"2018-10-05T21:35:43Z","updated_at":"2018-10-06T20:52:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d1e2c84f22d47f8cf494000a68bb3fca505b9b8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":834326390,"node_id":"MDU6TGFiZWw4MzQzMjYzOTA=","url":"https://api.github.com/repos/triplea-game/triplea/labels/PR:%20%3CPREVIEW%3E","name":"PR: <PREVIEW>","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/triplea-game/triplea/pulls/4148/commits","review_comments_url":"https://api.github.com/repos/triplea-game/triplea/pulls/4148/comments","review_comment_url":"https://api.github.com/repos/triplea-game/triplea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/triplea-game/triplea/issues/4148/comments","statuses_url":"https://api.github.com/repos/triplea-game/triplea/statuses/ba547d072d952e7614486362ab734e280285d395","head":{"label":"RoiEXLab:add-rest-controller","ref":"add-rest-controller","sha":"ba547d072d952e7614486362ab734e280285d395","user":{"login":"RoiEXLab","id":8350879,"node_id":"MDQ6VXNlcjgzNTA4Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/8350879?v=4","gravatar_id":"","url":"https://api.github.com/users/RoiEXLab","html_url":"https://github.com/RoiEXLab","followers_url":"https://api.github.com/users/RoiEXLab/followers","following_url":"https://api.github.com/users/RoiEXLab/following{/other_user}","gists_url":"https://api.github.com/users/RoiEXLab/gists{/gist_id}","starred_url":"https://api.github.com/users/RoiEXLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoiEXLab/subscriptions","organizations_url":"https://api.github.com/users/RoiEXLab/orgs","repos_url":"https://api.github.com/users/RoiEXLab/repos","events_url":"https://api.github.com/users/RoiEXLab/events{/privacy}","received_events_url":"https://api.github.com/users/RoiEXLab/received_events","type":"User","site_admin":false},"repo":{"id":57201503,"node_id":"MDEwOlJlcG9zaXRvcnk1NzIwMTUwMw==","name":"triplea","full_name":"RoiEXLab/triplea","private":false,"owner":{"login":"RoiEXLab","id":8350879,"node_id":"MDQ6VXNlcjgzNTA4Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/8350879?v=4","gravatar_id":"","url":"https://api.github.com/users/RoiEXLab","html_url":"https://github.com/RoiEXLab","followers_url":"https://api.github.com/users/RoiEXLab/followers","following_url":"https://api.github.com/users/RoiEXLab/following{/other_user}","gists_url":"https://api.github.com/users/RoiEXLab/gists{/gist_id}","starred_url":"https://api.github.com/users/RoiEXLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoiEXLab/subscriptions","organizations_url":"https://api.github.com/users/RoiEXLab/orgs","repos_url":"https://api.github.com/users/RoiEXLab/repos","events_url":"https://api.github.com/users/RoiEXLab/events{/privacy}","received_events_url":"https://api.github.com/users/RoiEXLab/received_events","type":"User","site_admin":false},"html_url":"https://github.com/RoiEXLab/triplea","description":"TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.","fork":true,"url":"https://api.github.com/repos/RoiEXLab/triplea","forks_url":"https://api.github.com/repos/RoiEXLab/triplea/forks","keys_url":"https://api.github.com/repos/RoiEXLab/triplea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RoiEXLab/triplea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RoiEXLab/triplea/teams","hooks_url":"https://api.github.com/repos/RoiEXLab/triplea/hooks","issue_events_url":"https://api.github.com/repos/RoiEXLab/triplea/issues/events{/number}","events_url":"https://api.github.com/repos/RoiEXLab/triplea/events","assignees_url":"https://api.github.com/repos/RoiEXLab/triplea/assignees{/user}","branches_url":"https://api.github.com/repos/RoiEXLab/triplea/branches{/branch}","tags_url":"https://api.github.com/repos/RoiEXLab/triplea/tags","blobs_url":"https://api.github.com/repos/RoiEXLab/triplea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RoiEXLab/triplea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RoiEXLab/triplea/git/refs{/sha}","trees_url":"https://api.github.com/repos/RoiEXLab/triplea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RoiEXLab/triplea/statuses/{sha}","languages_url":"https://api.github.com/repos/RoiEXLab/triplea/languages","stargazers_url":"https://api.github.com/repos/RoiEXLab/triplea/stargazers","contributors_url":"https://api.github.com/repos/RoiEXLab/triplea/contributors","subscribers_url":"https://api.github.com/repos/RoiEXLab/triplea/subscribers","subscription_url":"https://api.github.com/repos/RoiEXLab/triplea/subscription","commits_url":"https://api.github.com/repos/RoiEXLab/triplea/commits{/sha}","git_commits_url":"https://api.github.com/repos/RoiEXLab/triplea/git/commits{/sha}","comments_url":"https://api.github.com/repos/RoiEXLab/triplea/comments{/number}","issue_comment_url":"https://api.github.com/repos/RoiEXLab/triplea/issues/comments{/number}","contents_url":"https://api.github.com/repos/RoiEXLab/triplea/contents/{+path}","compare_url":"https://api.github.com/repos/RoiEXLab/triplea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RoiEXLab/triplea/merges","archive_url":"https://api.github.com/repos/RoiEXLab/triplea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RoiEXLab/triplea/downloads","issues_url":"https://api.github.com/repos/RoiEXLab/triplea/issues{/number}","pulls_url":"https://api.github.com/repos/RoiEXLab/triplea/pulls{/number}","milestones_url":"https://api.github.com/repos/RoiEXLab/triplea/milestones{/number}","notifications_url":"https://api.github.com/repos/RoiEXLab/triplea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RoiEXLab/triplea/labels{/name}","releases_url":"https://api.github.com/repos/RoiEXLab/triplea/releases{/id}","deployments_url":"https://api.github.com/repos/RoiEXLab/triplea/deployments","created_at":"2016-04-27T09:32:28Z","updated_at":"2018-10-05T12:23:59Z","pushed_at":"2018-10-05T21:54:24Z","git_url":"git://github.com/RoiEXLab/triplea.git","ssh_url":"git@github.com:RoiEXLab/triplea.git","clone_url":"https://github.com/RoiEXLab/triplea.git","svn_url":"https://github.com/RoiEXLab/triplea","homepage":null,"size":741414,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"triplea-game:master","ref":"master","sha":"063306564e71d03ea5c2e4a1dc0dc446996da98b","user":{"login":"triplea-game","id":13318615,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzE4NjE1","avatar_url":"https://avatars0.githubusercontent.com/u/13318615?v=4","gravatar_id":"","url":"https://api.github.com/users/triplea-game","html_url":"https://github.com/triplea-game","followers_url":"https://api.github.com/users/triplea-game/followers","following_url":"https://api.github.com/users/triplea-game/following{/other_user}","gists_url":"https://api.github.com/users/triplea-game/gists{/gist_id}","starred_url":"https://api.github.com/users/triplea-game/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triplea-game/subscriptions","organizations_url":"https://api.github.com/users/triplea-game/orgs","repos_url":"https://api.github.com/users/triplea-game/repos","events_url":"https://api.github.com/users/triplea-game/events{/privacy}","received_events_url":"https://api.github.com/users/triplea-game/received_events","type":"Organization","site_admin":false},"repo":{"id":39766308,"node_id":"MDEwOlJlcG9zaXRvcnkzOTc2NjMwOA==","name":"triplea","full_name":"triplea-game/triplea","private":false,"owner":{"login":"triplea-game","id":13318615,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzE4NjE1","avatar_url":"https://avatars0.githubusercontent.com/u/13318615?v=4","gravatar_id":"","url":"https://api.github.com/users/triplea-game","html_url":"https://github.com/triplea-game","followers_url":"https://api.github.com/users/triplea-game/followers","following_url":"https://api.github.com/users/triplea-game/following{/other_user}","gists_url":"https://api.github.com/users/triplea-game/gists{/gist_id}","starred_url":"https://api.github.com/users/triplea-game/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triplea-game/subscriptions","organizations_url":"https://api.github.com/users/triplea-game/orgs","repos_url":"https://api.github.com/users/triplea-game/repos","events_url":"https://api.github.com/users/triplea-game/events{/privacy}","received_events_url":"https://api.github.com/users/triplea-game/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/triplea-game/triplea","description":"TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.","fork":false,"url":"https://api.github.com/repos/triplea-game/triplea","forks_url":"https://api.github.com/repos/triplea-game/triplea/forks","keys_url":"https://api.github.com/repos/triplea-game/triplea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/triplea-game/triplea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/triplea-game/triplea/teams","hooks_url":"https://api.github.com/repos/triplea-game/triplea/hooks","issue_events_url":"https://api.github.com/repos/triplea-game/triplea/issues/events{/number}","events_url":"https://api.github.com/repos/triplea-game/triplea/events","assignees_url":"https://api.github.com/repos/triplea-game/triplea/assignees{/user}","branches_url":"https://api.github.com/repos/triplea-game/triplea/branches{/branch}","tags_url":"https://api.github.com/repos/triplea-game/triplea/tags","blobs_url":"https://api.github.com/repos/triplea-game/triplea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/triplea-game/triplea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/triplea-game/triplea/git/refs{/sha}","trees_url":"https://api.github.com/repos/triplea-game/triplea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/triplea-game/triplea/statuses/{sha}","languages_url":"https://api.github.com/repos/triplea-game/triplea/languages","stargazers_url":"https://api.github.com/repos/triplea-game/triplea/stargazers","contributors_url":"https://api.github.com/repos/triplea-game/triplea/contributors","subscribers_url":"https://api.github.com/repos/triplea-game/triplea/subscribers","subscription_url":"https://api.github.com/repos/triplea-game/triplea/subscription","commits_url":"https://api.github.com/repos/triplea-game/triplea/commits{/sha}","git_commits_url":"https://api.github.com/repos/triplea-game/triplea/git/commits{/sha}","comments_url":"https://api.github.com/repos/triplea-game/triplea/comments{/number}","issue_comment_url":"https://api.github.com/repos/triplea-game/triplea/issues/comments{/number}","contents_url":"https://api.github.com/repos/triplea-game/triplea/contents/{+path}","compare_url":"https://api.github.com/repos/triplea-game/triplea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/triplea-game/triplea/merges","archive_url":"https://api.github.com/repos/triplea-game/triplea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/triplea-game/triplea/downloads","issues_url":"https://api.github.com/repos/triplea-game/triplea/issues{/number}","pulls_url":"https://api.github.com/repos/triplea-game/triplea/pulls{/number}","milestones_url":"https://api.github.com/repos/triplea-game/triplea/milestones{/number}","notifications_url":"https://api.github.com/repos/triplea-game/triplea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/triplea-game/triplea/labels{/name}","releases_url":"https://api.github.com/repos/triplea-game/triplea/releases{/id}","deployments_url":"https://api.github.com/repos/triplea-game/triplea/deployments","created_at":"2015-07-27T09:32:58Z","updated_at":"2018-10-06T06:51:56Z","pushed_at":"2018-10-06T19:58:02Z","git_url":"git://github.com/triplea-game/triplea.git","ssh_url":"git@github.com:triplea-game/triplea.git","clone_url":"https://github.com/triplea-game/triplea.git","svn_url":"https://github.com/triplea-game/triplea","homepage":"https://triplea-game.org/","size":749933,"stargazers_count":124,"watchers_count":124,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"archived":false,"open_issues_count":86,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":58,"open_issues":86,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/4148"},"html":{"href":"https://github.com/triplea-game/triplea/pull/4148"},"issue":{"href":"https://api.github.com/repos/triplea-game/triplea/issues/4148"},"comments":{"href":"https://api.github.com/repos/triplea-game/triplea/issues/4148/comments"},"review_comments":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/4148/comments"},"review_comment":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/4148/commits"},"statuses":{"href":"https://api.github.com/repos/triplea-game/triplea/statuses/ba547d072d952e7614486362ab734e280285d395"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"RoiEXLab"}}