{"action":"opened","number":447,"pull_request":{"url":"https://api.github.com/repos/cms-dev/cms/pulls/447","id":39887297,"html_url":"https://github.com/cms-dev/cms/pull/447","diff_url":"https://github.com/cms-dev/cms/pull/447.diff","patch_url":"https://github.com/cms-dev/cms/pull/447.patch","issue_url":"https://api.github.com/repos/cms-dev/cms/issues/447","number":447,"state":"open","locked":false,"title":"Administrative accounts","user":{"login":"stefano-maggiolo","id":485490,"avatar_url":"https://avatars.githubusercontent.com/u/485490?v=3","gravatar_id":"","url":"https://api.github.com/users/stefano-maggiolo","html_url":"https://github.com/stefano-maggiolo","followers_url":"https://api.github.com/users/stefano-maggiolo/followers","following_url":"https://api.github.com/users/stefano-maggiolo/following{/other_user}","gists_url":"https://api.github.com/users/stefano-maggiolo/gists{/gist_id}","starred_url":"https://api.github.com/users/stefano-maggiolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefano-maggiolo/subscriptions","organizations_url":"https://api.github.com/users/stefano-maggiolo/orgs","repos_url":"https://api.github.com/users/stefano-maggiolo/repos","events_url":"https://api.github.com/users/stefano-maggiolo/events{/privacy}","received_events_url":"https://api.github.com/users/stefano-maggiolo/received_events","type":"User","site_admin":false},"body":"This was longer than expected... but I believe that the code is better organized now.\r\n\r\nThe end structure is comprised of:\r\n- a cookie-based authentication middleware that can be passed to WebService; this translate authentication cookies into authentication headers for the underlying WSGI apps, and viceversa (the app can say when it wants a cookie to be set, deleted, or refreshed);\r\n- the tornado app is similar to CWS, just it doesn't do any cookie-based authentication; the templates change based on the capabilities of the current user;\r\n- the rpc middleware has a new parameter, a function that does authorization based on the cookie.\r\n\r\nThe capability _jobs that Giovanni suggested is missing, but it is simple enough to add it now (just add the field, change the reevaluation template to enable the buttons in that case, and add the rpc methods to the whitelist).\r\n\r\nAs for the commits, they are as self-contained as possible. Feel free to review them one at a time, but I think you'd like to see the complete result as well.\r\n\r\nOne thing that is missing is the possibility of revoking a cookie-based authentication (that in CWS happens when you change the password), because I wanted to avoid DB access in the authentication middleware. The admins can be disabled, or deleted and recreated, so I think that's not a big problem.\r\n","created_at":"2015-07-14T07:03:33Z","updated_at":"2015-07-14T07:03:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cms-dev/cms/pulls/447/commits","review_comments_url":"https://api.github.com/repos/cms-dev/cms/pulls/447/comments","review_comment_url":"https://api.github.com/repos/cms-dev/cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cms-dev/cms/issues/447/comments","statuses_url":"https://api.github.com/repos/cms-dev/cms/statuses/d21aefa879200cc6e8c7cc82abb8382f6535fb08","head":{"label":"stefano-maggiolo:awslogin","ref":"awslogin","sha":"d21aefa879200cc6e8c7cc82abb8382f6535fb08","user":{"login":"stefano-maggiolo","id":485490,"avatar_url":"https://avatars.githubusercontent.com/u/485490?v=3","gravatar_id":"","url":"https://api.github.com/users/stefano-maggiolo","html_url":"https://github.com/stefano-maggiolo","followers_url":"https://api.github.com/users/stefano-maggiolo/followers","following_url":"https://api.github.com/users/stefano-maggiolo/following{/other_user}","gists_url":"https://api.github.com/users/stefano-maggiolo/gists{/gist_id}","starred_url":"https://api.github.com/users/stefano-maggiolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefano-maggiolo/subscriptions","organizations_url":"https://api.github.com/users/stefano-maggiolo/orgs","repos_url":"https://api.github.com/users/stefano-maggiolo/repos","events_url":"https://api.github.com/users/stefano-maggiolo/events{/privacy}","received_events_url":"https://api.github.com/users/stefano-maggiolo/received_events","type":"User","site_admin":false},"repo":{"id":6205668,"name":"cms","full_name":"stefano-maggiolo/cms","owner":{"login":"stefano-maggiolo","id":485490,"avatar_url":"https://avatars.githubusercontent.com/u/485490?v=3","gravatar_id":"","url":"https://api.github.com/users/stefano-maggiolo","html_url":"https://github.com/stefano-maggiolo","followers_url":"https://api.github.com/users/stefano-maggiolo/followers","following_url":"https://api.github.com/users/stefano-maggiolo/following{/other_user}","gists_url":"https://api.github.com/users/stefano-maggiolo/gists{/gist_id}","starred_url":"https://api.github.com/users/stefano-maggiolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefano-maggiolo/subscriptions","organizations_url":"https://api.github.com/users/stefano-maggiolo/orgs","repos_url":"https://api.github.com/users/stefano-maggiolo/repos","events_url":"https://api.github.com/users/stefano-maggiolo/events{/privacy}","received_events_url":"https://api.github.com/users/stefano-maggiolo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefano-maggiolo/cms","description":"Contest Management System","fork":true,"url":"https://api.github.com/repos/stefano-maggiolo/cms","forks_url":"https://api.github.com/repos/stefano-maggiolo/cms/forks","keys_url":"https://api.github.com/repos/stefano-maggiolo/cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefano-maggiolo/cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefano-maggiolo/cms/teams","hooks_url":"https://api.github.com/repos/stefano-maggiolo/cms/hooks","issue_events_url":"https://api.github.com/repos/stefano-maggiolo/cms/issues/events{/number}","events_url":"https://api.github.com/repos/stefano-maggiolo/cms/events","assignees_url":"https://api.github.com/repos/stefano-maggiolo/cms/assignees{/user}","branches_url":"https://api.github.com/repos/stefano-maggiolo/cms/branches{/branch}","tags_url":"https://api.github.com/repos/stefano-maggiolo/cms/tags","blobs_url":"https://api.github.com/repos/stefano-maggiolo/cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefano-maggiolo/cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefano-maggiolo/cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefano-maggiolo/cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefano-maggiolo/cms/statuses/{sha}","languages_url":"https://api.github.com/repos/stefano-maggiolo/cms/languages","stargazers_url":"https://api.github.com/repos/stefano-maggiolo/cms/stargazers","contributors_url":"https://api.github.com/repos/stefano-maggiolo/cms/contributors","subscribers_url":"https://api.github.com/repos/stefano-maggiolo/cms/subscribers","subscription_url":"https://api.github.com/repos/stefano-maggiolo/cms/subscription","commits_url":"https://api.github.com/repos/stefano-maggiolo/cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefano-maggiolo/cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefano-maggiolo/cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefano-maggiolo/cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefano-maggiolo/cms/contents/{+path}","compare_url":"https://api.github.com/repos/stefano-maggiolo/cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefano-maggiolo/cms/merges","archive_url":"https://api.github.com/repos/stefano-maggiolo/cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefano-maggiolo/cms/downloads","issues_url":"https://api.github.com/repos/stefano-maggiolo/cms/issues{/number}","pulls_url":"https://api.github.com/repos/stefano-maggiolo/cms/pulls{/number}","milestones_url":"https://api.github.com/repos/stefano-maggiolo/cms/milestones{/number}","notifications_url":"https://api.github.com/repos/stefano-maggiolo/cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefano-maggiolo/cms/labels{/name}","releases_url":"https://api.github.com/repos/stefano-maggiolo/cms/releases{/id}","created_at":"2012-10-13T17:51:32Z","updated_at":"2015-04-29T23:38:43Z","pushed_at":"2015-07-14T06:55:53Z","git_url":"git://github.com/stefano-maggiolo/cms.git","ssh_url":"git@github.com:stefano-maggiolo/cms.git","clone_url":"https://github.com/stefano-maggiolo/cms.git","svn_url":"https://github.com/stefano-maggiolo/cms","homepage":"","size":14092,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"cms-dev:master","ref":"master","sha":"e253d76098802abf3f560589628c52d47e312c6a","user":{"login":"cms-dev","id":1671612,"avatar_url":"https://avatars.githubusercontent.com/u/1671612?v=3","gravatar_id":"","url":"https://api.github.com/users/cms-dev","html_url":"https://github.com/cms-dev","followers_url":"https://api.github.com/users/cms-dev/followers","following_url":"https://api.github.com/users/cms-dev/following{/other_user}","gists_url":"https://api.github.com/users/cms-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-dev/subscriptions","organizations_url":"https://api.github.com/users/cms-dev/orgs","repos_url":"https://api.github.com/users/cms-dev/repos","events_url":"https://api.github.com/users/cms-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cms-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":2504741,"name":"cms","full_name":"cms-dev/cms","owner":{"login":"cms-dev","id":1671612,"avatar_url":"https://avatars.githubusercontent.com/u/1671612?v=3","gravatar_id":"","url":"https://api.github.com/users/cms-dev","html_url":"https://github.com/cms-dev","followers_url":"https://api.github.com/users/cms-dev/followers","following_url":"https://api.github.com/users/cms-dev/following{/other_user}","gists_url":"https://api.github.com/users/cms-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-dev/subscriptions","organizations_url":"https://api.github.com/users/cms-dev/orgs","repos_url":"https://api.github.com/users/cms-dev/repos","events_url":"https://api.github.com/users/cms-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cms-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cms-dev/cms","description":"Contest Management System","fork":false,"url":"https://api.github.com/repos/cms-dev/cms","forks_url":"https://api.github.com/repos/cms-dev/cms/forks","keys_url":"https://api.github.com/repos/cms-dev/cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cms-dev/cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cms-dev/cms/teams","hooks_url":"https://api.github.com/repos/cms-dev/cms/hooks","issue_events_url":"https://api.github.com/repos/cms-dev/cms/issues/events{/number}","events_url":"https://api.github.com/repos/cms-dev/cms/events","assignees_url":"https://api.github.com/repos/cms-dev/cms/assignees{/user}","branches_url":"https://api.github.com/repos/cms-dev/cms/branches{/branch}","tags_url":"https://api.github.com/repos/cms-dev/cms/tags","blobs_url":"https://api.github.com/repos/cms-dev/cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cms-dev/cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cms-dev/cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/cms-dev/cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cms-dev/cms/statuses/{sha}","languages_url":"https://api.github.com/repos/cms-dev/cms/languages","stargazers_url":"https://api.github.com/repos/cms-dev/cms/stargazers","contributors_url":"https://api.github.com/repos/cms-dev/cms/contributors","subscribers_url":"https://api.github.com/repos/cms-dev/cms/subscribers","subscription_url":"https://api.github.com/repos/cms-dev/cms/subscription","commits_url":"https://api.github.com/repos/cms-dev/cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/cms-dev/cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/cms-dev/cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/cms-dev/cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/cms-dev/cms/contents/{+path}","compare_url":"https://api.github.com/repos/cms-dev/cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cms-dev/cms/merges","archive_url":"https://api.github.com/repos/cms-dev/cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cms-dev/cms/downloads","issues_url":"https://api.github.com/repos/cms-dev/cms/issues{/number}","pulls_url":"https://api.github.com/repos/cms-dev/cms/pulls{/number}","milestones_url":"https://api.github.com/repos/cms-dev/cms/milestones{/number}","notifications_url":"https://api.github.com/repos/cms-dev/cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cms-dev/cms/labels{/name}","releases_url":"https://api.github.com/repos/cms-dev/cms/releases{/id}","created_at":"2011-10-03T13:37:02Z","updated_at":"2015-07-03T02:54:01Z","pushed_at":"2015-07-14T07:03:33Z","git_url":"git://github.com/cms-dev/cms.git","ssh_url":"git@github.com:cms-dev/cms.git","clone_url":"https://github.com/cms-dev/cms.git","svn_url":"https://github.com/cms-dev/cms","homepage":"http://cms-dev.github.io/","size":17998,"stargazers_count":212,"watchers_count":212,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":100,"forks":116,"open_issues":100,"watchers":212,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/447"},"html":{"href":"https://github.com/cms-dev/cms/pull/447"},"issue":{"href":"https://api.github.com/repos/cms-dev/cms/issues/447"},"comments":{"href":"https://api.github.com/repos/cms-dev/cms/issues/447/comments"},"review_comments":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/447/comments"},"review_comment":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/447/commits"},"statuses":{"href":"https://api.github.com/repos/cms-dev/cms/statuses/d21aefa879200cc6e8c7cc82abb8382f6535fb08"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":10,"additions":1377,"deletions":133,"changed_files":49}}