{"action":"opened","number":33,"pull_request":{"url":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/33","id":99609398,"html_url":"https://github.com/prosemeteor/prosemirror/pull/33","diff_url":"https://github.com/prosemeteor/prosemirror/pull/33.diff","patch_url":"https://github.com/prosemeteor/prosemirror/pull/33.patch","issue_url":"https://api.github.com/repos/prosemeteor/prosemirror/issues/33","number":33,"state":"open","locked":false,"title":"Feature/authenticate editing","user":{"login":"ejfrancis","id":3171352,"avatar_url":"https://avatars.githubusercontent.com/u/3171352?v=3","gravatar_id":"","url":"https://api.github.com/users/ejfrancis","html_url":"https://github.com/ejfrancis","followers_url":"https://api.github.com/users/ejfrancis/followers","following_url":"https://api.github.com/users/ejfrancis/following{/other_user}","gists_url":"https://api.github.com/users/ejfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/ejfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejfrancis/subscriptions","organizations_url":"https://api.github.com/users/ejfrancis/orgs","repos_url":"https://api.github.com/users/ejfrancis/repos","events_url":"https://api.github.com/users/ejfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/ejfrancis/received_events","type":"User","site_admin":false},"body":"for issue #9 \r\n\r\n## High Level\r\n* allows package implementor to provide authentication hook functions for ProseMeteor to call to determine if users are able to perform authenticated actions against documents\r\n* implements authentication for editing documents\r\n* added a client-side callback that package implementors can user to handle authentication errors\r\n* adds an authenticated document to the demo app\r\n\r\nSee the demo app in `/demo` for examples of the public API on the client and server.\r\n\r\n## Details\r\nThis lays down the groundwork for authentication and permissions within the ProseMeteor Authority. Users of the package can provide hooks, which return `true`/`false` that ProseMeteor calls to determine if a user can perform certain authenticated actions. Currently we provide hooks for:\r\n\r\n* \"edit\" a doc\r\n* \"view\" a doc\r\n* \"delete\" a doc\r\n* \"create\" a doc is not in the code, but will probably need to be added\r\n\r\nWhen a user connects to an Authority, the Authority will call all provided authentication hooks and store permissions in memory for that user. Each consecutive time that user performs an authenticated action the Authority checks those in-memory permissions and sends down an error event.\r\n\r\n\r\n---\r\n#### Notes\r\n1. This only authenticates for the \"edit\" action. When we implement read-only mode (#15) the same approach will be used for the \"view\" action. In the future we'll probably need to handle \"create\" and \"delete\" docs as well since we'll need an API to do those things.\r\n\r\n2. One thing not done yet is invalidating permissions. For instance, if in my application that uses ProseMeteor an admin has removed userA from being able to edit docA, ProseMeteor must allow a way to make the Authority that's currently managing docA (if it's currently being edited) call the authentication hooks again so that it can update its permissions in memory and realize that userA can no longer edit docA. ","created_at":"2016-12-29T01:27:13Z","updated_at":"2016-12-29T01:27:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/prosemeteor/prosemirror/milestones/1","html_url":"https://github.com/prosemeteor/prosemirror/milestone/1","labels_url":"https://api.github.com/repos/prosemeteor/prosemirror/milestones/1/labels","id":2203240,"number":1,"title":"Beta","description":"Beta at a usable state with core features functioning.","creator":{"login":"ejfrancis","id":3171352,"avatar_url":"https://avatars.githubusercontent.com/u/3171352?v=3","gravatar_id":"","url":"https://api.github.com/users/ejfrancis","html_url":"https://github.com/ejfrancis","followers_url":"https://api.github.com/users/ejfrancis/followers","following_url":"https://api.github.com/users/ejfrancis/following{/other_user}","gists_url":"https://api.github.com/users/ejfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/ejfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejfrancis/subscriptions","organizations_url":"https://api.github.com/users/ejfrancis/orgs","repos_url":"https://api.github.com/users/ejfrancis/repos","events_url":"https://api.github.com/users/ejfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/ejfrancis/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":6,"state":"open","created_at":"2016-12-18T21:26:34Z","updated_at":"2016-12-29T01:27:13Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/33/commits","review_comments_url":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/33/comments","review_comment_url":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prosemeteor/prosemirror/issues/33/comments","statuses_url":"https://api.github.com/repos/prosemeteor/prosemirror/statuses/b85cdc90c8023a78e65f0cd1960bd04d6e49f4a8","head":{"label":"ejfrancis:feature/authenticate-editing","ref":"feature/authenticate-editing","sha":"b85cdc90c8023a78e65f0cd1960bd04d6e49f4a8","user":{"login":"ejfrancis","id":3171352,"avatar_url":"https://avatars.githubusercontent.com/u/3171352?v=3","gravatar_id":"","url":"https://api.github.com/users/ejfrancis","html_url":"https://github.com/ejfrancis","followers_url":"https://api.github.com/users/ejfrancis/followers","following_url":"https://api.github.com/users/ejfrancis/following{/other_user}","gists_url":"https://api.github.com/users/ejfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/ejfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejfrancis/subscriptions","organizations_url":"https://api.github.com/users/ejfrancis/orgs","repos_url":"https://api.github.com/users/ejfrancis/repos","events_url":"https://api.github.com/users/ejfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/ejfrancis/received_events","type":"User","site_admin":false},"repo":{"id":59076602,"name":"prosemirror","full_name":"ejfrancis/prosemirror","owner":{"login":"ejfrancis","id":3171352,"avatar_url":"https://avatars.githubusercontent.com/u/3171352?v=3","gravatar_id":"","url":"https://api.github.com/users/ejfrancis","html_url":"https://github.com/ejfrancis","followers_url":"https://api.github.com/users/ejfrancis/followers","following_url":"https://api.github.com/users/ejfrancis/following{/other_user}","gists_url":"https://api.github.com/users/ejfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/ejfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejfrancis/subscriptions","organizations_url":"https://api.github.com/users/ejfrancis/orgs","repos_url":"https://api.github.com/users/ejfrancis/repos","events_url":"https://api.github.com/users/ejfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/ejfrancis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ejfrancis/prosemirror","description":"Prosemirror integration for Meteor.js","fork":true,"url":"https://api.github.com/repos/ejfrancis/prosemirror","forks_url":"https://api.github.com/repos/ejfrancis/prosemirror/forks","keys_url":"https://api.github.com/repos/ejfrancis/prosemirror/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ejfrancis/prosemirror/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ejfrancis/prosemirror/teams","hooks_url":"https://api.github.com/repos/ejfrancis/prosemirror/hooks","issue_events_url":"https://api.github.com/repos/ejfrancis/prosemirror/issues/events{/number}","events_url":"https://api.github.com/repos/ejfrancis/prosemirror/events","assignees_url":"https://api.github.com/repos/ejfrancis/prosemirror/assignees{/user}","branches_url":"https://api.github.com/repos/ejfrancis/prosemirror/branches{/branch}","tags_url":"https://api.github.com/repos/ejfrancis/prosemirror/tags","blobs_url":"https://api.github.com/repos/ejfrancis/prosemirror/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ejfrancis/prosemirror/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ejfrancis/prosemirror/git/refs{/sha}","trees_url":"https://api.github.com/repos/ejfrancis/prosemirror/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ejfrancis/prosemirror/statuses/{sha}","languages_url":"https://api.github.com/repos/ejfrancis/prosemirror/languages","stargazers_url":"https://api.github.com/repos/ejfrancis/prosemirror/stargazers","contributors_url":"https://api.github.com/repos/ejfrancis/prosemirror/contributors","subscribers_url":"https://api.github.com/repos/ejfrancis/prosemirror/subscribers","subscription_url":"https://api.github.com/repos/ejfrancis/prosemirror/subscription","commits_url":"https://api.github.com/repos/ejfrancis/prosemirror/commits{/sha}","git_commits_url":"https://api.github.com/repos/ejfrancis/prosemirror/git/commits{/sha}","comments_url":"https://api.github.com/repos/ejfrancis/prosemirror/comments{/number}","issue_comment_url":"https://api.github.com/repos/ejfrancis/prosemirror/issues/comments{/number}","contents_url":"https://api.github.com/repos/ejfrancis/prosemirror/contents/{+path}","compare_url":"https://api.github.com/repos/ejfrancis/prosemirror/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ejfrancis/prosemirror/merges","archive_url":"https://api.github.com/repos/ejfrancis/prosemirror/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ejfrancis/prosemirror/downloads","issues_url":"https://api.github.com/repos/ejfrancis/prosemirror/issues{/number}","pulls_url":"https://api.github.com/repos/ejfrancis/prosemirror/pulls{/number}","milestones_url":"https://api.github.com/repos/ejfrancis/prosemirror/milestones{/number}","notifications_url":"https://api.github.com/repos/ejfrancis/prosemirror/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ejfrancis/prosemirror/labels{/name}","releases_url":"https://api.github.com/repos/ejfrancis/prosemirror/releases{/id}","deployments_url":"https://api.github.com/repos/ejfrancis/prosemirror/deployments","created_at":"2016-05-18T02:51:04Z","updated_at":"2016-05-18T02:51:04Z","pushed_at":"2016-12-27T17:03:52Z","git_url":"git://github.com/ejfrancis/prosemirror.git","ssh_url":"git@github.com:ejfrancis/prosemirror.git","clone_url":"https://github.com/ejfrancis/prosemirror.git","svn_url":"https://github.com/ejfrancis/prosemirror","homepage":null,"size":6592,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":0,"default_branch":"master"}},"base":{"label":"prosemeteor:master","ref":"master","sha":"51c0a304338228102edc75427f72e689a7aafb8a","user":{"login":"prosemeteor","id":18057278,"avatar_url":"https://avatars.githubusercontent.com/u/18057278?v=3","gravatar_id":"","url":"https://api.github.com/users/prosemeteor","html_url":"https://github.com/prosemeteor","followers_url":"https://api.github.com/users/prosemeteor/followers","following_url":"https://api.github.com/users/prosemeteor/following{/other_user}","gists_url":"https://api.github.com/users/prosemeteor/gists{/gist_id}","starred_url":"https://api.github.com/users/prosemeteor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prosemeteor/subscriptions","organizations_url":"https://api.github.com/users/prosemeteor/orgs","repos_url":"https://api.github.com/users/prosemeteor/repos","events_url":"https://api.github.com/users/prosemeteor/events{/privacy}","received_events_url":"https://api.github.com/users/prosemeteor/received_events","type":"Organization","site_admin":false},"repo":{"id":54666446,"name":"prosemirror","full_name":"prosemeteor/prosemirror","owner":{"login":"prosemeteor","id":18057278,"avatar_url":"https://avatars.githubusercontent.com/u/18057278?v=3","gravatar_id":"","url":"https://api.github.com/users/prosemeteor","html_url":"https://github.com/prosemeteor","followers_url":"https://api.github.com/users/prosemeteor/followers","following_url":"https://api.github.com/users/prosemeteor/following{/other_user}","gists_url":"https://api.github.com/users/prosemeteor/gists{/gist_id}","starred_url":"https://api.github.com/users/prosemeteor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prosemeteor/subscriptions","organizations_url":"https://api.github.com/users/prosemeteor/orgs","repos_url":"https://api.github.com/users/prosemeteor/repos","events_url":"https://api.github.com/users/prosemeteor/events{/privacy}","received_events_url":"https://api.github.com/users/prosemeteor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prosemeteor/prosemirror","description":"Prosemirror integration for Meteor.js","fork":false,"url":"https://api.github.com/repos/prosemeteor/prosemirror","forks_url":"https://api.github.com/repos/prosemeteor/prosemirror/forks","keys_url":"https://api.github.com/repos/prosemeteor/prosemirror/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prosemeteor/prosemirror/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prosemeteor/prosemirror/teams","hooks_url":"https://api.github.com/repos/prosemeteor/prosemirror/hooks","issue_events_url":"https://api.github.com/repos/prosemeteor/prosemirror/issues/events{/number}","events_url":"https://api.github.com/repos/prosemeteor/prosemirror/events","assignees_url":"https://api.github.com/repos/prosemeteor/prosemirror/assignees{/user}","branches_url":"https://api.github.com/repos/prosemeteor/prosemirror/branches{/branch}","tags_url":"https://api.github.com/repos/prosemeteor/prosemirror/tags","blobs_url":"https://api.github.com/repos/prosemeteor/prosemirror/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prosemeteor/prosemirror/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prosemeteor/prosemirror/git/refs{/sha}","trees_url":"https://api.github.com/repos/prosemeteor/prosemirror/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prosemeteor/prosemirror/statuses/{sha}","languages_url":"https://api.github.com/repos/prosemeteor/prosemirror/languages","stargazers_url":"https://api.github.com/repos/prosemeteor/prosemirror/stargazers","contributors_url":"https://api.github.com/repos/prosemeteor/prosemirror/contributors","subscribers_url":"https://api.github.com/repos/prosemeteor/prosemirror/subscribers","subscription_url":"https://api.github.com/repos/prosemeteor/prosemirror/subscription","commits_url":"https://api.github.com/repos/prosemeteor/prosemirror/commits{/sha}","git_commits_url":"https://api.github.com/repos/prosemeteor/prosemirror/git/commits{/sha}","comments_url":"https://api.github.com/repos/prosemeteor/prosemirror/comments{/number}","issue_comment_url":"https://api.github.com/repos/prosemeteor/prosemirror/issues/comments{/number}","contents_url":"https://api.github.com/repos/prosemeteor/prosemirror/contents/{+path}","compare_url":"https://api.github.com/repos/prosemeteor/prosemirror/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prosemeteor/prosemirror/merges","archive_url":"https://api.github.com/repos/prosemeteor/prosemirror/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prosemeteor/prosemirror/downloads","issues_url":"https://api.github.com/repos/prosemeteor/prosemirror/issues{/number}","pulls_url":"https://api.github.com/repos/prosemeteor/prosemirror/pulls{/number}","milestones_url":"https://api.github.com/repos/prosemeteor/prosemirror/milestones{/number}","notifications_url":"https://api.github.com/repos/prosemeteor/prosemirror/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prosemeteor/prosemirror/labels{/name}","releases_url":"https://api.github.com/repos/prosemeteor/prosemirror/releases{/id}","deployments_url":"https://api.github.com/repos/prosemeteor/prosemirror/deployments","created_at":"2016-03-24T18:52:45Z","updated_at":"2016-12-20T07:26:16Z","pushed_at":"2016-12-24T02:00:55Z","git_url":"git://github.com/prosemeteor/prosemirror.git","ssh_url":"git@github.com:prosemeteor/prosemirror.git","clone_url":"https://github.com/prosemeteor/prosemirror.git","svn_url":"https://github.com/prosemeteor/prosemirror","homepage":null,"size":6495,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/33"},"html":{"href":"https://github.com/prosemeteor/prosemirror/pull/33"},"issue":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/issues/33"},"comments":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/prosemeteor/prosemirror/statuses/b85cdc90c8023a78e65f0cd1960bd04d6e49f4a8"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":23,"additions":10702,"deletions":69,"changed_files":24}}
{"actor":{"display_login":"ejfrancis"}}