{"action":"created","comment":{"url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/comments/202616247","pull_request_review_id":137342557,"id":202616247,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjYxNjI0Nw==","diff_hunk":"@@ -61,13 +62,28 @@ def __init__(self, chat_id):\n     def __repr__(self):\n         return \"<Restrictions for %s>\" % self.chat_id\n \n+class URLWhitelist(BASE):\n+    __tablename__ = \"permissions_urls\"\n+    chat_id = Column(String(14), primary_key=True, nullable=False)\n+    url = Column(UnicodeText, primary_key=True, nullable=False)\n+\n+    def __init__(self, chat_id, url):\n+        self.chat_id = str(chat_id)  # ensure string\n+        self.url = url\n+\n+    def __repr__(self):\n+        return \"<Permission url whitelist for %s>\" % self.chat_id\n \n Permissions.__table__.create(checkfirst=True)\n Restrictions.__table__.create(checkfirst=True)\n+URLWhitelist.__table__.create(checkfirst=True)\n \n \n PERM_LOCK = threading.RLock()\n RESTR_LOCK = threading.RLock()\n+WHITELIST_LOCK = threading.RLock()\n+CHAT_WHITELIST = {}\n+URL_REGEXP = re.compile(r'(^http:\\/\\/|^https:\\/\\/|^ftp:\\/\\/|^)(www\\.)?(\\S*)', flags=re.I)","path":"tg_bot/modules/sql/locks_sql.py","position":35,"original_position":35,"commit_id":"10cbadf73095b1f34c2f17f4a2596f3eabb6916f","original_commit_id":"10cbadf73095b1f34c2f17f4a2596f3eabb6916f","user":{"login":"PaulSonOfLars","id":17353640,"node_id":"MDQ6VXNlcjE3MzUzNjQw","avatar_url":"https://avatars3.githubusercontent.com/u/17353640?v=4","gravatar_id":"","url":"https://api.github.com/users/PaulSonOfLars","html_url":"https://github.com/PaulSonOfLars","followers_url":"https://api.github.com/users/PaulSonOfLars/followers","following_url":"https://api.github.com/users/PaulSonOfLars/following{/other_user}","gists_url":"https://api.github.com/users/PaulSonOfLars/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulSonOfLars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulSonOfLars/subscriptions","organizations_url":"https://api.github.com/users/PaulSonOfLars/orgs","repos_url":"https://api.github.com/users/PaulSonOfLars/repos","events_url":"https://api.github.com/users/PaulSonOfLars/events{/privacy}","received_events_url":"https://api.github.com/users/PaulSonOfLars/received_events","type":"User","site_admin":false},"body":"this logic should be a part of the module, not the sql","created_at":"2018-07-16T09:12:56Z","updated_at":"2018-07-16T09:15:59Z","html_url":"https://github.com/PaulSonOfLars/tgbot/pull/27#discussion_r202616247","pull_request_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/comments/202616247"},"html":{"href":"https://github.com/PaulSonOfLars/tgbot/pull/27#discussion_r202616247"},"pull_request":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27","id":190479315,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNDc5MzE1","html_url":"https://github.com/PaulSonOfLars/tgbot/pull/27","diff_url":"https://github.com/PaulSonOfLars/tgbot/pull/27.diff","patch_url":"https://github.com/PaulSonOfLars/tgbot/pull/27.patch","issue_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues/27","number":27,"state":"open","locked":false,"title":"Add whitelist option to URL lock","user":{"login":"garciaw","id":16128722,"node_id":"MDQ6VXNlcjE2MTI4NzIy","avatar_url":"https://avatars0.githubusercontent.com/u/16128722?v=4","gravatar_id":"","url":"https://api.github.com/users/garciaw","html_url":"https://github.com/garciaw","followers_url":"https://api.github.com/users/garciaw/followers","following_url":"https://api.github.com/users/garciaw/following{/other_user}","gists_url":"https://api.github.com/users/garciaw/gists{/gist_id}","starred_url":"https://api.github.com/users/garciaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garciaw/subscriptions","organizations_url":"https://api.github.com/users/garciaw/orgs","repos_url":"https://api.github.com/users/garciaw/repos","events_url":"https://api.github.com/users/garciaw/events{/privacy}","received_events_url":"https://api.github.com/users/garciaw/received_events","type":"User","site_admin":false},"body":"Also adds missing filters to lock text links.","created_at":"2018-05-25T04:30:51Z","updated_at":"2018-07-16T09:15:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2a97a2b26b3ae911d10733e2ede7e4a32a154a2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27/commits","review_comments_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27/comments","review_comment_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues/27/comments","statuses_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/statuses/10cbadf73095b1f34c2f17f4a2596f3eabb6916f","head":{"label":"garciaw:white","ref":"white","sha":"10cbadf73095b1f34c2f17f4a2596f3eabb6916f","user":{"login":"garciaw","id":16128722,"node_id":"MDQ6VXNlcjE2MTI4NzIy","avatar_url":"https://avatars0.githubusercontent.com/u/16128722?v=4","gravatar_id":"","url":"https://api.github.com/users/garciaw","html_url":"https://github.com/garciaw","followers_url":"https://api.github.com/users/garciaw/followers","following_url":"https://api.github.com/users/garciaw/following{/other_user}","gists_url":"https://api.github.com/users/garciaw/gists{/gist_id}","starred_url":"https://api.github.com/users/garciaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garciaw/subscriptions","organizations_url":"https://api.github.com/users/garciaw/orgs","repos_url":"https://api.github.com/users/garciaw/repos","events_url":"https://api.github.com/users/garciaw/events{/privacy}","received_events_url":"https://api.github.com/users/garciaw/received_events","type":"User","site_admin":false},"repo":{"id":134802474,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ4MDI0NzQ=","name":"tgbot","full_name":"garciaw/tgbot","owner":{"login":"garciaw","id":16128722,"node_id":"MDQ6VXNlcjE2MTI4NzIy","avatar_url":"https://avatars0.githubusercontent.com/u/16128722?v=4","gravatar_id":"","url":"https://api.github.com/users/garciaw","html_url":"https://github.com/garciaw","followers_url":"https://api.github.com/users/garciaw/followers","following_url":"https://api.github.com/users/garciaw/following{/other_user}","gists_url":"https://api.github.com/users/garciaw/gists{/gist_id}","starred_url":"https://api.github.com/users/garciaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garciaw/subscriptions","organizations_url":"https://api.github.com/users/garciaw/orgs","repos_url":"https://api.github.com/users/garciaw/repos","events_url":"https://api.github.com/users/garciaw/events{/privacy}","received_events_url":"https://api.github.com/users/garciaw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garciaw/tgbot","description":"Modular telegram group management bot","fork":true,"url":"https://api.github.com/repos/garciaw/tgbot","forks_url":"https://api.github.com/repos/garciaw/tgbot/forks","keys_url":"https://api.github.com/repos/garciaw/tgbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garciaw/tgbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garciaw/tgbot/teams","hooks_url":"https://api.github.com/repos/garciaw/tgbot/hooks","issue_events_url":"https://api.github.com/repos/garciaw/tgbot/issues/events{/number}","events_url":"https://api.github.com/repos/garciaw/tgbot/events","assignees_url":"https://api.github.com/repos/garciaw/tgbot/assignees{/user}","branches_url":"https://api.github.com/repos/garciaw/tgbot/branches{/branch}","tags_url":"https://api.github.com/repos/garciaw/tgbot/tags","blobs_url":"https://api.github.com/repos/garciaw/tgbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garciaw/tgbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garciaw/tgbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/garciaw/tgbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garciaw/tgbot/statuses/{sha}","languages_url":"https://api.github.com/repos/garciaw/tgbot/languages","stargazers_url":"https://api.github.com/repos/garciaw/tgbot/stargazers","contributors_url":"https://api.github.com/repos/garciaw/tgbot/contributors","subscribers_url":"https://api.github.com/repos/garciaw/tgbot/subscribers","subscription_url":"https://api.github.com/repos/garciaw/tgbot/subscription","commits_url":"https://api.github.com/repos/garciaw/tgbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/garciaw/tgbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/garciaw/tgbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/garciaw/tgbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/garciaw/tgbot/contents/{+path}","compare_url":"https://api.github.com/repos/garciaw/tgbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garciaw/tgbot/merges","archive_url":"https://api.github.com/repos/garciaw/tgbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garciaw/tgbot/downloads","issues_url":"https://api.github.com/repos/garciaw/tgbot/issues{/number}","pulls_url":"https://api.github.com/repos/garciaw/tgbot/pulls{/number}","milestones_url":"https://api.github.com/repos/garciaw/tgbot/milestones{/number}","notifications_url":"https://api.github.com/repos/garciaw/tgbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garciaw/tgbot/labels{/name}","releases_url":"https://api.github.com/repos/garciaw/tgbot/releases{/id}","deployments_url":"https://api.github.com/repos/garciaw/tgbot/deployments","created_at":"2018-05-25T04:15:17Z","updated_at":"2018-05-25T04:15:19Z","pushed_at":"2018-06-06T02:32:09Z","git_url":"git://github.com/garciaw/tgbot.git","ssh_url":"git@github.com:garciaw/tgbot.git","clone_url":"https://github.com/garciaw/tgbot.git","svn_url":"https://github.com/garciaw/tgbot","homepage":"","size":661,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"PaulSonOfLars:master","ref":"master","sha":"84ab5880d238edfba3d47dbe6c28d13a3cce67df","user":{"login":"PaulSonOfLars","id":17353640,"node_id":"MDQ6VXNlcjE3MzUzNjQw","avatar_url":"https://avatars3.githubusercontent.com/u/17353640?v=4","gravatar_id":"","url":"https://api.github.com/users/PaulSonOfLars","html_url":"https://github.com/PaulSonOfLars","followers_url":"https://api.github.com/users/PaulSonOfLars/followers","following_url":"https://api.github.com/users/PaulSonOfLars/following{/other_user}","gists_url":"https://api.github.com/users/PaulSonOfLars/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulSonOfLars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulSonOfLars/subscriptions","organizations_url":"https://api.github.com/users/PaulSonOfLars/orgs","repos_url":"https://api.github.com/users/PaulSonOfLars/repos","events_url":"https://api.github.com/users/PaulSonOfLars/events{/privacy}","received_events_url":"https://api.github.com/users/PaulSonOfLars/received_events","type":"User","site_admin":false},"repo":{"id":98918956,"node_id":"MDEwOlJlcG9zaXRvcnk5ODkxODk1Ng==","name":"tgbot","full_name":"PaulSonOfLars/tgbot","owner":{"login":"PaulSonOfLars","id":17353640,"node_id":"MDQ6VXNlcjE3MzUzNjQw","avatar_url":"https://avatars3.githubusercontent.com/u/17353640?v=4","gravatar_id":"","url":"https://api.github.com/users/PaulSonOfLars","html_url":"https://github.com/PaulSonOfLars","followers_url":"https://api.github.com/users/PaulSonOfLars/followers","following_url":"https://api.github.com/users/PaulSonOfLars/following{/other_user}","gists_url":"https://api.github.com/users/PaulSonOfLars/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulSonOfLars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulSonOfLars/subscriptions","organizations_url":"https://api.github.com/users/PaulSonOfLars/orgs","repos_url":"https://api.github.com/users/PaulSonOfLars/repos","events_url":"https://api.github.com/users/PaulSonOfLars/events{/privacy}","received_events_url":"https://api.github.com/users/PaulSonOfLars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PaulSonOfLars/tgbot","description":"Modular telegram group management bot","fork":false,"url":"https://api.github.com/repos/PaulSonOfLars/tgbot","forks_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/forks","keys_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/teams","hooks_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/hooks","issue_events_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues/events{/number}","events_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/events","assignees_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/assignees{/user}","branches_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/branches{/branch}","tags_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/tags","blobs_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/statuses/{sha}","languages_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/languages","stargazers_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/stargazers","contributors_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/contributors","subscribers_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/subscribers","subscription_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/subscription","commits_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/contents/{+path}","compare_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/merges","archive_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/downloads","issues_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues{/number}","pulls_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls{/number}","milestones_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/milestones{/number}","notifications_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/labels{/name}","releases_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/releases{/id}","deployments_url":"https://api.github.com/repos/PaulSonOfLars/tgbot/deployments","created_at":"2017-07-31T18:44:57Z","updated_at":"2018-07-14T14:15:05Z","pushed_at":"2018-07-11T09:28:54Z","git_url":"git://github.com/PaulSonOfLars/tgbot.git","ssh_url":"git@github.com:PaulSonOfLars/tgbot.git","clone_url":"https://github.com/PaulSonOfLars/tgbot.git","svn_url":"https://github.com/PaulSonOfLars/tgbot","homepage":"","size":717,"stargazers_count":62,"watchers_count":62,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"archived":false,"open_issues_count":11,"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":114,"open_issues":11,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27"},"html":{"href":"https://github.com/PaulSonOfLars/tgbot/pull/27"},"issue":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues/27"},"comments":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/PaulSonOfLars/tgbot/statuses/10cbadf73095b1f34c2f17f4a2596f3eabb6916f"}},"author_association":"NONE"}}
{"actor":{"display_login":"PaulSonOfLars"}}