{"action":"created","comment":{"url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/comments/68088002","id":68088002,"diff_hunk":"@@ -0,0 +1,14 @@\n+package org.zalando.pazuzu.security;\n+\n+public final class Roles {\n+\n+    private Roles() {\n+\n+    }\n+\n+    public static final String ANONYMOUS = \"ROLE_ANONYMOUS\";\n+\n+    public static final String USER = \"ROLE_USER\";","path":"src/main/java/org/zalando/pazuzu/security/Roles.java","position":11,"original_position":11,"commit_id":"904f2ad5ac4d6ab7a6c033a742247edee00c90e8","original_commit_id":"904f2ad5ac4d6ab7a6c033a742247edee00c90e8","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.](https://www.codacy.com/app/Pazuzu/pazuzu-registry/file/2818303620/issues/source?bid=3131965&fileBranchId=3375724#l11)","created_at":"2016-06-22T16:34:49Z","updated_at":"2016-06-22T16:34:49Z","html_url":"https://github.com/zalando/pazuzu-registry/pull/96#discussion_r68088002","pull_request_url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96","_links":{"self":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/comments/68088002"},"html":{"href":"https://github.com/zalando/pazuzu-registry/pull/96#discussion_r68088002"},"pull_request":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96","id":74806213,"html_url":"https://github.com/zalando/pazuzu-registry/pull/96","diff_url":"https://github.com/zalando/pazuzu-registry/pull/96.diff","patch_url":"https://github.com/zalando/pazuzu-registry/pull/96.patch","issue_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues/96","number":96,"state":"open","locked":false,"title":"OAuth user based roles","user":{"login":"jmnarloch","id":1581045,"avatar_url":"https://avatars.githubusercontent.com/u/1581045?v=3","gravatar_id":"","url":"https://api.github.com/users/jmnarloch","html_url":"https://github.com/jmnarloch","followers_url":"https://api.github.com/users/jmnarloch/followers","following_url":"https://api.github.com/users/jmnarloch/following{/other_user}","gists_url":"https://api.github.com/users/jmnarloch/gists{/gist_id}","starred_url":"https://api.github.com/users/jmnarloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmnarloch/subscriptions","organizations_url":"https://api.github.com/users/jmnarloch/orgs","repos_url":"https://api.github.com/users/jmnarloch/repos","events_url":"https://api.github.com/users/jmnarloch/events{/privacy}","received_events_url":"https://api.github.com/users/jmnarloch/received_events","type":"User","site_admin":false},"body":"To sum up the changes, \r\n\r\n* I had added the admin role resolution base on the predefined list of users provided through the configuration.\r\n\r\nexample:\r\n```\r\npazuzu:\r\n  registry:\r\n    admins: jdoe, jsmith\r\n```\r\nI've put the proper setting to the docker-compose file.\r\n\r\n* The access to CREATE/UPDATE/DELETE operations has been prohibited only to admin accounts, through declerative annotation based approach.\r\n\r\nexample:\r\n```\r\n@RolesAllowed({Roles.ADMIN})\r\n    @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)\r\n    public ResponseEntity<FeatureFullDto> createFeature(@RequestBody FeatureToCreateDto value) throws ServiceException {\r\n...\r\n}\r\n```\r\n\r\n* Finally I did manage to enable anonymous access to the GET methods, so in this transition period the command line tool continues to work.\r\n\r\nAs a result the pazuzu-ui needs to be modified in respect of the new authentication scheme.\r\n\r\nRelates to https://github.com/zalando/pazuzu-registry/issues/30 task.\r\n","created_at":"2016-06-22T15:34:01Z","updated_at":"2016-06-22T16:34:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e954b11ee57a9cb398b5a97974d66fe07d55f297","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96/commits","review_comments_url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96/comments","review_comment_url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues/96/comments","statuses_url":"https://api.github.com/repos/zalando/pazuzu-registry/statuses/904f2ad5ac4d6ab7a6c033a742247edee00c90e8","head":{"label":"zalando:oauth-roles-#30","ref":"oauth-roles-#30","sha":"904f2ad5ac4d6ab7a6c033a742247edee00c90e8","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":51378759,"name":"pazuzu-registry","full_name":"zalando/pazuzu-registry","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/pazuzu-registry","description":"A feature registry for customized Docker images","fork":false,"url":"https://api.github.com/repos/zalando/pazuzu-registry","forks_url":"https://api.github.com/repos/zalando/pazuzu-registry/forks","keys_url":"https://api.github.com/repos/zalando/pazuzu-registry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/pazuzu-registry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/pazuzu-registry/teams","hooks_url":"https://api.github.com/repos/zalando/pazuzu-registry/hooks","issue_events_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/pazuzu-registry/events","assignees_url":"https://api.github.com/repos/zalando/pazuzu-registry/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/pazuzu-registry/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/pazuzu-registry/tags","blobs_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/pazuzu-registry/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/pazuzu-registry/languages","stargazers_url":"https://api.github.com/repos/zalando/pazuzu-registry/stargazers","contributors_url":"https://api.github.com/repos/zalando/pazuzu-registry/contributors","subscribers_url":"https://api.github.com/repos/zalando/pazuzu-registry/subscribers","subscription_url":"https://api.github.com/repos/zalando/pazuzu-registry/subscription","commits_url":"https://api.github.com/repos/zalando/pazuzu-registry/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/pazuzu-registry/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/pazuzu-registry/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/pazuzu-registry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/pazuzu-registry/merges","archive_url":"https://api.github.com/repos/zalando/pazuzu-registry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/pazuzu-registry/downloads","issues_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/pazuzu-registry/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/pazuzu-registry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/pazuzu-registry/labels{/name}","releases_url":"https://api.github.com/repos/zalando/pazuzu-registry/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/pazuzu-registry/deployments","created_at":"2016-02-09T16:15:44Z","updated_at":"2016-05-26T12:02:47Z","pushed_at":"2016-06-22T15:34:01Z","git_url":"git://github.com/zalando/pazuzu-registry.git","ssh_url":"git@github.com:zalando/pazuzu-registry.git","clone_url":"https://github.com/zalando/pazuzu-registry.git","svn_url":"https://github.com/zalando/pazuzu-registry","homepage":"","size":502,"stargazers_count":11,"watchers_count":11,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":11,"default_branch":"master"}},"base":{"label":"zalando:master","ref":"master","sha":"752008c874757f7a9f4537fd84bb6f867d9beb3c","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":51378759,"name":"pazuzu-registry","full_name":"zalando/pazuzu-registry","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/pazuzu-registry","description":"A feature registry for customized Docker images","fork":false,"url":"https://api.github.com/repos/zalando/pazuzu-registry","forks_url":"https://api.github.com/repos/zalando/pazuzu-registry/forks","keys_url":"https://api.github.com/repos/zalando/pazuzu-registry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/pazuzu-registry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/pazuzu-registry/teams","hooks_url":"https://api.github.com/repos/zalando/pazuzu-registry/hooks","issue_events_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/pazuzu-registry/events","assignees_url":"https://api.github.com/repos/zalando/pazuzu-registry/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/pazuzu-registry/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/pazuzu-registry/tags","blobs_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/pazuzu-registry/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/pazuzu-registry/languages","stargazers_url":"https://api.github.com/repos/zalando/pazuzu-registry/stargazers","contributors_url":"https://api.github.com/repos/zalando/pazuzu-registry/contributors","subscribers_url":"https://api.github.com/repos/zalando/pazuzu-registry/subscribers","subscription_url":"https://api.github.com/repos/zalando/pazuzu-registry/subscription","commits_url":"https://api.github.com/repos/zalando/pazuzu-registry/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/pazuzu-registry/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/pazuzu-registry/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/pazuzu-registry/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/pazuzu-registry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/pazuzu-registry/merges","archive_url":"https://api.github.com/repos/zalando/pazuzu-registry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/pazuzu-registry/downloads","issues_url":"https://api.github.com/repos/zalando/pazuzu-registry/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/pazuzu-registry/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/pazuzu-registry/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/pazuzu-registry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/pazuzu-registry/labels{/name}","releases_url":"https://api.github.com/repos/zalando/pazuzu-registry/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/pazuzu-registry/deployments","created_at":"2016-02-09T16:15:44Z","updated_at":"2016-05-26T12:02:47Z","pushed_at":"2016-06-22T15:34:01Z","git_url":"git://github.com/zalando/pazuzu-registry.git","ssh_url":"git@github.com:zalando/pazuzu-registry.git","clone_url":"https://github.com/zalando/pazuzu-registry.git","svn_url":"https://github.com/zalando/pazuzu-registry","homepage":"","size":502,"stargazers_count":11,"watchers_count":11,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96"},"html":{"href":"https://github.com/zalando/pazuzu-registry/pull/96"},"issue":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/issues/96"},"comments":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/zalando/pazuzu-registry/statuses/904f2ad5ac4d6ab7a6c033a742247edee00c90e8"}}}}
{"actor":{"display_login":"codacy-bot"}}