{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/42470864","id":42470864,"diff_hunk":"@@ -0,0 +1,115 @@\n+<?php\n+\n+namespace OC\\Share20;\n+\n+use OCP\\IUser;\n+\n+interface IShareProvider {\n+\n+\t/**\n+\t * Share a path\n+\t * \n+\t * @param \\OCP\\Files\\Node $path\n+\t * @param int $shareType\n+\t * @param \\OCP\\IUser|\\OCP\\IGroup|string $shareWith\n+\t * @param int $permissions\n+\t * @param \\DateTime $expireDate\n+\t * @param $password\n+\t */\n+\tpublic function share(\\OCP\\Files\\Node $path,\n+\t                      $shareType,\n+\t                      $shareWith,\n+\t                      $permissions = 31,\n+\t                      \\DateTime $expireDate = null,\n+\t                      $password = null);\n+\n+\t/**\n+\t * Get all shares by the given user\n+\t *\n+\t * @param IUser $user\n+\t */\n+\tpublic function getShares(IUser $user);\n+\n+\t/**\n+\t * Get share by id\n+\t *\n+\t * @param int $id\n+\t */\n+\tpublic function getShareById($id);\n+\n+\t/**\n+\t * Get shares for a given path\n+\t *\n+\t * @param \\OCP\\Files\\Node $path\n+\t */\n+\tpublic function getSharesByPath(\\OCP\\IUser $user, \\OCP\\Files\\Node $path);\n+\n+\t/**\n+\t * Get shared with the given user\n+\t *\n+\t * @param IUser $user\n+\t * @param int $shareType\n+\t */\n+\tpublic function getSharedWithMe(IUser $user, $shareType = null);\n+\n+\t/**\n+\t * Get a share by token\n+\t *\n+\t * @param string $token\n+\t */\n+\tpublic function getShareByToken($token);\n+\n+\n+\t/**\n+\t * Set the expiration date\n+\t *\n+\t * @param int $id\n+\t * @param \\DateTime $expireDate\n+\t */\n+\tpublic function setShareExpirationDate($id, \\DateTime $expireDate);\n+\n+\t/**\n+\t * Set permissions\n+\t *\n+\t * @param int $id\n+\t * @param int $permissions\n+\t */\n+\tpublic function setSharePermissions($id, $permissions);\n+\n+\t/**\n+\t * Set password\n+\t *\n+\t * @param int $id\n+\t * @param string $password\n+\t */\n+\tpublic function setSharePassword($id, $password);\n+\n+\t/**\n+\t * Verify the password\n+\t *\n+\t * @param int $id\n+\t * @param string $password\n+\t */\n+\tpublic function verifySharePassword($id, $password);","path":"lib/private/share20/ishareprovider.php","position":93,"original_position":93,"commit_id":"6f386cdd138403cd2f14755eef291be50528c6e2","original_commit_id":"6f386cdd138403cd2f14755eef291be50528c6e2","user":{"login":"rullzer","id":45821,"avatar_url":"https://avatars.githubusercontent.com/u/45821?v=3","gravatar_id":"","url":"https://api.github.com/users/rullzer","html_url":"https://github.com/rullzer","followers_url":"https://api.github.com/users/rullzer/followers","following_url":"https://api.github.com/users/rullzer/following{/other_user}","gists_url":"https://api.github.com/users/rullzer/gists{/gist_id}","starred_url":"https://api.github.com/users/rullzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rullzer/subscriptions","organizations_url":"https://api.github.com/users/rullzer/orgs","repos_url":"https://api.github.com/users/rullzer/repos","events_url":"https://api.github.com/users/rullzer/events{/privacy}","received_events_url":"https://api.github.com/users/rullzer/received_events","type":"User","site_admin":false},"body":"So it is not checking if the password is strong enough etc. But rather if it is right.","created_at":"2015-10-20T09:02:23Z","updated_at":"2015-10-20T09:02:23Z","html_url":"https://github.com/owncloud/core/pull/19872#discussion_r42470864","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/19872","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/42470864"},"html":{"href":"https://github.com/owncloud/core/pull/19872#discussion_r42470864"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/19872"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/19872","id":48081689,"html_url":"https://github.com/owncloud/core/pull/19872","diff_url":"https://github.com/owncloud/core/pull/19872.diff","patch_url":"https://github.com/owncloud/core/pull/19872.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/19872","number":19872,"state":"open","locked":false,"title":"Share2.0 sharemanager","user":{"login":"rullzer","id":45821,"avatar_url":"https://avatars.githubusercontent.com/u/45821?v=3","gravatar_id":"","url":"https://api.github.com/users/rullzer","html_url":"https://github.com/rullzer","followers_url":"https://api.github.com/users/rullzer/followers","following_url":"https://api.github.com/users/rullzer/following{/other_user}","gists_url":"https://api.github.com/users/rullzer/gists{/gist_id}","starred_url":"https://api.github.com/users/rullzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rullzer/subscriptions","organizations_url":"https://api.github.com/users/rullzer/orgs","repos_url":"https://api.github.com/users/rullzer/repos","events_url":"https://api.github.com/users/rullzer/events{/privacy}","received_events_url":"https://api.github.com/users/rullzer/received_events","type":"User","site_admin":false},"body":"@schiesbn @DeepDiver1975 first draft is here.\r\n\r\nfor now we have a sharemanager object and a ishareprovider and that is it. So no share object. Basically everything goes trough the share manager.\r\n\r\nThe manager itself acts like some kind of middleware between the shareprovider and the OCS Share API. Making sure that arguments are in the right format (date for example). And making sure that the user we want to share with exists etc.\r\n\r\nIShareProviders register themself at the sharemanager with a callback function. And then all the magic happens.\r\n\r\nMany things in the code do not work as expected yet or are even plain wrong now. But if we agree this is the way to go I can start cleaning up and already write some simple unit tests for this part. And do some squashing of commits :P\r\n\r\nSo feedback please :)","created_at":"2015-10-19T14:50:42Z","updated_at":"2015-10-20T09:02:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74908f070f892ce141d7a01171696393205a20c1","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/48","html_url":"https://github.com/owncloud/core/milestones/9.0-next","labels_url":"https://api.github.com/repos/owncloud/core/milestones/48/labels","id":1196845,"number":48,"title":"9.0-next","description":"","creator":{"login":"cmonteroluque","id":879976,"avatar_url":"https://avatars.githubusercontent.com/u/879976?v=3","gravatar_id":"","url":"https://api.github.com/users/cmonteroluque","html_url":"https://github.com/cmonteroluque","followers_url":"https://api.github.com/users/cmonteroluque/followers","following_url":"https://api.github.com/users/cmonteroluque/following{/other_user}","gists_url":"https://api.github.com/users/cmonteroluque/gists{/gist_id}","starred_url":"https://api.github.com/users/cmonteroluque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmonteroluque/subscriptions","organizations_url":"https://api.github.com/users/cmonteroluque/orgs","repos_url":"https://api.github.com/users/cmonteroluque/repos","events_url":"https://api.github.com/users/cmonteroluque/events{/privacy}","received_events_url":"https://api.github.com/users/cmonteroluque/received_events","type":"User","site_admin":false},"open_issues":509,"closed_issues":77,"state":"open","created_at":"2015-07-07T14:21:23Z","updated_at":"2015-10-20T08:35:23Z","due_on":"2016-02-09T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/19872/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/19872/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/19872/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/6f386cdd138403cd2f14755eef291be50528c6e2","head":{"label":"owncloud:share2.0_sharemanager","ref":"share2.0_sharemanager","sha":"6f386cdd138403cd2f14755eef291be50528c6e2","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-10-20T08:40:10Z","pushed_at":"2015-10-20T08:35:24Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":"https://owncloud.org/","size":1138701,"stargazers_count":3764,"watchers_count":3764,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1204,"mirror_url":null,"open_issues_count":1825,"forks":1204,"open_issues":1825,"watchers":3764,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"c530c9c322d9475fbbeccce834ba06083d7ae36a","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-10-20T08:40:10Z","pushed_at":"2015-10-20T08:35:24Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":"https://owncloud.org/","size":1138701,"stargazers_count":3764,"watchers_count":3764,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1204,"mirror_url":null,"open_issues_count":1825,"forks":1204,"open_issues":1825,"watchers":3764,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/19872"},"html":{"href":"https://github.com/owncloud/core/pull/19872"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/19872"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/19872/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/19872/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/19872/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/6f386cdd138403cd2f14755eef291be50528c6e2"}}}}