{"action":"created","comment":{"url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/comments/173616244","pull_request_review_id":102844956,"id":173616244,"diff_hunk":"@@ -0,0 +1,138 @@\n+import logging\n+\n+from django.conf import settings\n+from django.db.models import Q\n+from django.shortcuts import get_object_or_404\n+from oidc_provider.models import Client\n+\n+from authentication_service.api.stubs import AbstractStubClass\n+from authentication_service.models import CoreUser\n+from authentication_service.utils import set_listing_limit, \\\n+    strip_empty_optional_fields\n+\n+LOGGER = logging.getLogger(__name__)\n+\n+CLIENT_VALUES = [\n+    \"id\", \"_post_logout_redirect_uris\", \"_redirect_uris\", \"client_id\",\n+    \"contact_email\", \"logo\", \"name\", \"require_consent\", \"response_type\",\n+    \"reuse_consent\", \"terms_url\", \"website_url\"\n+]\n+USER_VALUES = [\n+    \"id\", \"username\", \"first_name\", \"last_name\", \"email\", \"is_active\",\n+    \"date_joined\", \"last_login\", \"email_verified\", \"msisdn_verified\", \"msisdn\",\n+    \"gender\", \"birth_date\", \"avatar\", \"country\", \"created_at\", \"updated_at\"\n+]\n+\n+\n+class Implementation(AbstractStubClass):\n+\n+    @staticmethod\n+    def client_list(request, offset=None, limit=None, client_ids=None,\n+                    client_token_id=None, *args, **kwargs):\n+        \"\"\"\n+        :param request: An HttpRequest\n+        :param offset (optional): integer An optional query parameter specifying the offset in the result set to start from.\n+        :param limit (optional): integer An optional query parameter to limit the number of results returned.\n+        :param client_ids (optional): string An optional query parameter to filter by a list of client.id.\n+        :param clent_token_id (optional): string An optional query parameter to filter by a single client.client_id.\n+        \"\"\"\n+        offset = int(offset if offset else settings.DEFAULT_LISTING_OFFSET)\n+        limit = set_listing_limit(limit)\n+\n+        clients = Client.objects.values(*CLIENT_VALUES)\n+\n+        q_objects = Q()\n+\n+        if client_ids:\n+            q_objects |= Q(id__in=client_ids)\n+        if client_token_id:\n+            q_objects |= Q(client_id=client_token_id)\n+\n+        clients = clients.filter(q_objects)\n+\n+        clients = clients[offset:limit]\n+        return list(clients)\n+\n+\n+    @staticmethod\n+    def client_read(request, client_id, *args, **kwargs):\n+        \"\"\"\n+        :param request: An HttpRequest\n+        :param client_id: string A string value identifying the client\n+        \"\"\"\n+        result = Client.objects.filter(\n+            client_id=client_id).values(*CLIENT_VALUES).get()\n+        return result\n+\n+    @staticmethod\n+    def user_list(request, offset=None, limit=None, email=None,\n+                  username_prefix=None, user_ids=None, *args, **kwargs):\n+        \"\"\"\n+        :param request: An HttpRequest\n+        \"\"\"\n+        offset = int(offset if offset else settings.DEFAULT_LISTING_OFFSET)\n+        limit = set_listing_limit(limit)\n+\n+        users = CoreUser.objects.values(*USER_VALUES)\n+\n+        q_objects = Q()","path":"authentication_service/integration.py","position":78,"original_position":78,"commit_id":"8da4d8a70e8df18ac4cedf1308c7f00d2e1ee57d","original_commit_id":"8da4d8a70e8df18ac4cedf1308c7f00d2e1ee57d","user":{"login":"cobusc","id":574390,"avatar_url":"https://avatars1.githubusercontent.com/u/574390?v=4","gravatar_id":"","url":"https://api.github.com/users/cobusc","html_url":"https://github.com/cobusc","followers_url":"https://api.github.com/users/cobusc/followers","following_url":"https://api.github.com/users/cobusc/following{/other_user}","gists_url":"https://api.github.com/users/cobusc/gists{/gist_id}","starred_url":"https://api.github.com/users/cobusc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cobusc/subscriptions","organizations_url":"https://api.github.com/users/cobusc/orgs","repos_url":"https://api.github.com/users/cobusc/repos","events_url":"https://api.github.com/users/cobusc/events{/privacy}","received_events_url":"https://api.github.com/users/cobusc/received_events","type":"User","site_admin":false},"body":"Same comment as the previous one\r\n","created_at":"2018-03-10T08:43:38Z","updated_at":"2018-03-10T08:43:38Z","html_url":"https://github.com/girleffect/core-authentication-service/pull/43#discussion_r173616244","pull_request_url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/comments/173616244"},"html":{"href":"https://github.com/girleffect/core-authentication-service/pull/43#discussion_r173616244"},"pull_request":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43","id":173112273,"html_url":"https://github.com/girleffect/core-authentication-service/pull/43","diff_url":"https://github.com/girleffect/core-authentication-service/pull/43.diff","patch_url":"https://github.com/girleffect/core-authentication-service/pull/43.patch","issue_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues/43","number":43,"state":"open","locked":false,"title":"Feature/ge 858","user":{"login":"ruands","id":19821343,"avatar_url":"https://avatars1.githubusercontent.com/u/19821343?v=4","gravatar_id":"","url":"https://api.github.com/users/ruands","html_url":"https://github.com/ruands","followers_url":"https://api.github.com/users/ruands/followers","following_url":"https://api.github.com/users/ruands/following{/other_user}","gists_url":"https://api.github.com/users/ruands/gists{/gist_id}","starred_url":"https://api.github.com/users/ruands/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruands/subscriptions","organizations_url":"https://api.github.com/users/ruands/orgs","repos_url":"https://api.github.com/users/ruands/repos","events_url":"https://api.github.com/users/ruands/events{/privacy}","received_events_url":"https://api.github.com/users/ruands/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-06T10:14:23Z","updated_at":"2018-03-10T08:43:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f1f1e59088d1cd29f03449f1f13455c5bc685f4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43/commits","review_comments_url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43/comments","review_comment_url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues/43/comments","statuses_url":"https://api.github.com/repos/girleffect/core-authentication-service/statuses/8da4d8a70e8df18ac4cedf1308c7f00d2e1ee57d","head":{"label":"girleffect:feature/GE-858","ref":"feature/GE-858","sha":"8da4d8a70e8df18ac4cedf1308c7f00d2e1ee57d","user":{"login":"girleffect","id":33266906,"avatar_url":"https://avatars2.githubusercontent.com/u/33266906?v=4","gravatar_id":"","url":"https://api.github.com/users/girleffect","html_url":"https://github.com/girleffect","followers_url":"https://api.github.com/users/girleffect/followers","following_url":"https://api.github.com/users/girleffect/following{/other_user}","gists_url":"https://api.github.com/users/girleffect/gists{/gist_id}","starred_url":"https://api.github.com/users/girleffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girleffect/subscriptions","organizations_url":"https://api.github.com/users/girleffect/orgs","repos_url":"https://api.github.com/users/girleffect/repos","events_url":"https://api.github.com/users/girleffect/events{/privacy}","received_events_url":"https://api.github.com/users/girleffect/received_events","type":"Organization","site_admin":false},"repo":{"id":112724628,"name":"core-authentication-service","full_name":"girleffect/core-authentication-service","owner":{"login":"girleffect","id":33266906,"avatar_url":"https://avatars2.githubusercontent.com/u/33266906?v=4","gravatar_id":"","url":"https://api.github.com/users/girleffect","html_url":"https://github.com/girleffect","followers_url":"https://api.github.com/users/girleffect/followers","following_url":"https://api.github.com/users/girleffect/following{/other_user}","gists_url":"https://api.github.com/users/girleffect/gists{/gist_id}","starred_url":"https://api.github.com/users/girleffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girleffect/subscriptions","organizations_url":"https://api.github.com/users/girleffect/orgs","repos_url":"https://api.github.com/users/girleffect/repos","events_url":"https://api.github.com/users/girleffect/events{/privacy}","received_events_url":"https://api.github.com/users/girleffect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/girleffect/core-authentication-service","description":null,"fork":false,"url":"https://api.github.com/repos/girleffect/core-authentication-service","forks_url":"https://api.github.com/repos/girleffect/core-authentication-service/forks","keys_url":"https://api.github.com/repos/girleffect/core-authentication-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/girleffect/core-authentication-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/girleffect/core-authentication-service/teams","hooks_url":"https://api.github.com/repos/girleffect/core-authentication-service/hooks","issue_events_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues/events{/number}","events_url":"https://api.github.com/repos/girleffect/core-authentication-service/events","assignees_url":"https://api.github.com/repos/girleffect/core-authentication-service/assignees{/user}","branches_url":"https://api.github.com/repos/girleffect/core-authentication-service/branches{/branch}","tags_url":"https://api.github.com/repos/girleffect/core-authentication-service/tags","blobs_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/girleffect/core-authentication-service/statuses/{sha}","languages_url":"https://api.github.com/repos/girleffect/core-authentication-service/languages","stargazers_url":"https://api.github.com/repos/girleffect/core-authentication-service/stargazers","contributors_url":"https://api.github.com/repos/girleffect/core-authentication-service/contributors","subscribers_url":"https://api.github.com/repos/girleffect/core-authentication-service/subscribers","subscription_url":"https://api.github.com/repos/girleffect/core-authentication-service/subscription","commits_url":"https://api.github.com/repos/girleffect/core-authentication-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/girleffect/core-authentication-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/girleffect/core-authentication-service/contents/{+path}","compare_url":"https://api.github.com/repos/girleffect/core-authentication-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/girleffect/core-authentication-service/merges","archive_url":"https://api.github.com/repos/girleffect/core-authentication-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/girleffect/core-authentication-service/downloads","issues_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues{/number}","pulls_url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls{/number}","milestones_url":"https://api.github.com/repos/girleffect/core-authentication-service/milestones{/number}","notifications_url":"https://api.github.com/repos/girleffect/core-authentication-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/girleffect/core-authentication-service/labels{/name}","releases_url":"https://api.github.com/repos/girleffect/core-authentication-service/releases{/id}","deployments_url":"https://api.github.com/repos/girleffect/core-authentication-service/deployments","created_at":"2017-12-01T10:01:56Z","updated_at":"2017-12-20T14:19:03Z","pushed_at":"2018-03-10T07:36:18Z","git_url":"git://github.com/girleffect/core-authentication-service.git","ssh_url":"git@github.com:girleffect/core-authentication-service.git","clone_url":"https://github.com/girleffect/core-authentication-service.git","svn_url":"https://github.com/girleffect/core-authentication-service","homepage":null,"size":710,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"girleffect:develop","ref":"develop","sha":"213734cf8089f4684fee0a147c316f874854aafc","user":{"login":"girleffect","id":33266906,"avatar_url":"https://avatars2.githubusercontent.com/u/33266906?v=4","gravatar_id":"","url":"https://api.github.com/users/girleffect","html_url":"https://github.com/girleffect","followers_url":"https://api.github.com/users/girleffect/followers","following_url":"https://api.github.com/users/girleffect/following{/other_user}","gists_url":"https://api.github.com/users/girleffect/gists{/gist_id}","starred_url":"https://api.github.com/users/girleffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girleffect/subscriptions","organizations_url":"https://api.github.com/users/girleffect/orgs","repos_url":"https://api.github.com/users/girleffect/repos","events_url":"https://api.github.com/users/girleffect/events{/privacy}","received_events_url":"https://api.github.com/users/girleffect/received_events","type":"Organization","site_admin":false},"repo":{"id":112724628,"name":"core-authentication-service","full_name":"girleffect/core-authentication-service","owner":{"login":"girleffect","id":33266906,"avatar_url":"https://avatars2.githubusercontent.com/u/33266906?v=4","gravatar_id":"","url":"https://api.github.com/users/girleffect","html_url":"https://github.com/girleffect","followers_url":"https://api.github.com/users/girleffect/followers","following_url":"https://api.github.com/users/girleffect/following{/other_user}","gists_url":"https://api.github.com/users/girleffect/gists{/gist_id}","starred_url":"https://api.github.com/users/girleffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girleffect/subscriptions","organizations_url":"https://api.github.com/users/girleffect/orgs","repos_url":"https://api.github.com/users/girleffect/repos","events_url":"https://api.github.com/users/girleffect/events{/privacy}","received_events_url":"https://api.github.com/users/girleffect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/girleffect/core-authentication-service","description":null,"fork":false,"url":"https://api.github.com/repos/girleffect/core-authentication-service","forks_url":"https://api.github.com/repos/girleffect/core-authentication-service/forks","keys_url":"https://api.github.com/repos/girleffect/core-authentication-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/girleffect/core-authentication-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/girleffect/core-authentication-service/teams","hooks_url":"https://api.github.com/repos/girleffect/core-authentication-service/hooks","issue_events_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues/events{/number}","events_url":"https://api.github.com/repos/girleffect/core-authentication-service/events","assignees_url":"https://api.github.com/repos/girleffect/core-authentication-service/assignees{/user}","branches_url":"https://api.github.com/repos/girleffect/core-authentication-service/branches{/branch}","tags_url":"https://api.github.com/repos/girleffect/core-authentication-service/tags","blobs_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/girleffect/core-authentication-service/statuses/{sha}","languages_url":"https://api.github.com/repos/girleffect/core-authentication-service/languages","stargazers_url":"https://api.github.com/repos/girleffect/core-authentication-service/stargazers","contributors_url":"https://api.github.com/repos/girleffect/core-authentication-service/contributors","subscribers_url":"https://api.github.com/repos/girleffect/core-authentication-service/subscribers","subscription_url":"https://api.github.com/repos/girleffect/core-authentication-service/subscription","commits_url":"https://api.github.com/repos/girleffect/core-authentication-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/girleffect/core-authentication-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/girleffect/core-authentication-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/girleffect/core-authentication-service/contents/{+path}","compare_url":"https://api.github.com/repos/girleffect/core-authentication-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/girleffect/core-authentication-service/merges","archive_url":"https://api.github.com/repos/girleffect/core-authentication-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/girleffect/core-authentication-service/downloads","issues_url":"https://api.github.com/repos/girleffect/core-authentication-service/issues{/number}","pulls_url":"https://api.github.com/repos/girleffect/core-authentication-service/pulls{/number}","milestones_url":"https://api.github.com/repos/girleffect/core-authentication-service/milestones{/number}","notifications_url":"https://api.github.com/repos/girleffect/core-authentication-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/girleffect/core-authentication-service/labels{/name}","releases_url":"https://api.github.com/repos/girleffect/core-authentication-service/releases{/id}","deployments_url":"https://api.github.com/repos/girleffect/core-authentication-service/deployments","created_at":"2017-12-01T10:01:56Z","updated_at":"2017-12-20T14:19:03Z","pushed_at":"2018-03-10T07:36:18Z","git_url":"git://github.com/girleffect/core-authentication-service.git","ssh_url":"git@github.com:girleffect/core-authentication-service.git","clone_url":"https://github.com/girleffect/core-authentication-service.git","svn_url":"https://github.com/girleffect/core-authentication-service","homepage":null,"size":710,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43"},"html":{"href":"https://github.com/girleffect/core-authentication-service/pull/43"},"issue":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/issues/43"},"comments":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/girleffect/core-authentication-service/statuses/8da4d8a70e8df18ac4cedf1308c7f00d2e1ee57d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cobusc"}}