{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/comments/229136764","pull_request_review_id":169564759,"id":229136764,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTEzNjc2NA==","diff_hunk":"@@ -16,12 +16,58 @@\n \n import json\n import os\n-from typing import List\n+from typing import Any, Dict, List\n \n from django_cloud_deploy.cloudlib import service_account\n \n from google.auth import credentials\n \n+KEY_PATH_TEMPLATE = '{}/{}.json'\n+\n+\n+class ServiceAccount(object):\n+    \"\"\" Service Accounts for permissions in Google Cloud.\n+\n+    Attributes:\n+        id_: Id of your service account. For example, a\n+            service account should be in the following format:\n+            <service_account_id>@<project_id>.iam.gserviceaccount.com\n+        name: Display name of your service account.\n+        file_name: Name of the secrets file.\n+        roles: Roles the service account should have. Valid roles can be\n+            found on https://cloud.google.com/iam/docs/understanding-roles\n+        output_path: The path to store your key.\n+    \"\"\"\n+    def __init__(self,\n+                 id_: str,\n+                 name: str,\n+                 file_name: str,\n+                 roles: List[str],\n+                 output_path: str = KEY_PATH_TEMPLATE):\n+        \"\"\"\n+\n+        Args:\n+            id_: Id of your service account. For example, a\n+                service account should be in the following format:\n+                <service_account_id>@<project_id>.iam.gserviceaccount.com\n+            name: Display name of your service account.\n+            file_name: Name of the secrets file.\n+            roles: Roles the service account should have. Valid roles can be\n+                found on https://cloud.google.com/iam/docs/understanding-roles\n+            output_path: The path to store your key.\n+\n+        Returns:\n+            service_account: ServiceAccount\n+        \"\"\"\n+        self.id_ = id_\n+        self.name = name\n+        self.file_name = file_name\n+        self.roles = roles\n+        if output_path == KEY_PATH_TEMPLATE:","path":"django_cloud_deploy/workflow/_service_account.py","position":52,"original_position":52,"commit_id":"ca4e50cd59578620e7a0741ab9347599082cb8cc","original_commit_id":"ca4e50cd59578620e7a0741ab9347599082cb8cc","user":{"login":"enriquejosepadilla","id":5668292,"node_id":"MDQ6VXNlcjU2NjgyOTI=","avatar_url":"https://avatars0.githubusercontent.com/u/5668292?v=4","gravatar_id":"","url":"https://api.github.com/users/enriquejosepadilla","html_url":"https://github.com/enriquejosepadilla","followers_url":"https://api.github.com/users/enriquejosepadilla/followers","following_url":"https://api.github.com/users/enriquejosepadilla/following{/other_user}","gists_url":"https://api.github.com/users/enriquejosepadilla/gists{/gist_id}","starred_url":"https://api.github.com/users/enriquejosepadilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enriquejosepadilla/subscriptions","organizations_url":"https://api.github.com/users/enriquejosepadilla/orgs","repos_url":"https://api.github.com/users/enriquejosepadilla/repos","events_url":"https://api.github.com/users/enriquejosepadilla/events{/privacy}","received_events_url":"https://api.github.com/users/enriquejosepadilla/received_events","type":"User","site_admin":false},"body":"Use None.","created_at":"2018-10-29T23:47:40Z","updated_at":"2018-10-29T23:47:40Z","html_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy/pull/34#discussion_r229136764","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/comments/229136764"},"html":{"href":"https://github.com/GoogleCloudPlatform/django-cloud-deploy/pull/34#discussion_r229136764"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34","id":226740628,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NzQwNjI4","html_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy/pull/34","diff_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy/pull/34.diff","patch_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy/pull/34.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/34","number":34,"state":"open","locked":false,"title":"Base for having multiple secret accounts","user":{"login":"enriquejosepadilla","id":5668292,"node_id":"MDQ6VXNlcjU2NjgyOTI=","avatar_url":"https://avatars0.githubusercontent.com/u/5668292?v=4","gravatar_id":"","url":"https://api.github.com/users/enriquejosepadilla","html_url":"https://github.com/enriquejosepadilla","followers_url":"https://api.github.com/users/enriquejosepadilla/followers","following_url":"https://api.github.com/users/enriquejosepadilla/following{/other_user}","gists_url":"https://api.github.com/users/enriquejosepadilla/gists{/gist_id}","starred_url":"https://api.github.com/users/enriquejosepadilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enriquejosepadilla/subscriptions","organizations_url":"https://api.github.com/users/enriquejosepadilla/orgs","repos_url":"https://api.github.com/users/enriquejosepadilla/repos","events_url":"https://api.github.com/users/enriquejosepadilla/events{/privacy}","received_events_url":"https://api.github.com/users/enriquejosepadilla/received_events","type":"User","site_admin":false},"body":"We need this to add another service account. The next one is necessary for getting logging out of the box. ","created_at":"2018-10-29T22:58:23Z","updated_at":"2018-10-29T23:47:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4628048055b05d6fd015d7d9832aa1f13e31f821","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1103584327,"node_id":"MDU6TGFiZWwxMTAzNTg0MzI3","url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/labels/cla:%20yes","name":"cla: yes","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/34/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/statuses/ca4e50cd59578620e7a0741ab9347599082cb8cc","head":{"label":"GoogleCloudPlatform:djangologging","ref":"djangologging","sha":"ca4e50cd59578620e7a0741ab9347599082cb8cc","user":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":153157026,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMxNTcwMjY=","name":"django-cloud-deploy","full_name":"GoogleCloudPlatform/django-cloud-deploy","private":false,"owner":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy","description":"Easier deployment of Django applications in the cloud.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/deployments","created_at":"2018-10-15T17:47:54Z","updated_at":"2018-10-29T23:06:54Z","pushed_at":"2018-10-29T23:29:39Z","git_url":"git://github.com/GoogleCloudPlatform/django-cloud-deploy.git","ssh_url":"git@github.com:GoogleCloudPlatform/django-cloud-deploy.git","clone_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy.git","svn_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy","homepage":"","size":262,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"481758cb3e2604cd2e0e2a652b83143d582b6b1a","user":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":153157026,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMxNTcwMjY=","name":"django-cloud-deploy","full_name":"GoogleCloudPlatform/django-cloud-deploy","private":false,"owner":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy","description":"Easier deployment of Django applications in the cloud.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/deployments","created_at":"2018-10-15T17:47:54Z","updated_at":"2018-10-29T23:06:54Z","pushed_at":"2018-10-29T23:29:39Z","git_url":"git://github.com/GoogleCloudPlatform/django-cloud-deploy.git","ssh_url":"git@github.com:GoogleCloudPlatform/django-cloud-deploy.git","clone_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy.git","svn_url":"https://github.com/GoogleCloudPlatform/django-cloud-deploy","homepage":"","size":262,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34"},"html":{"href":"https://github.com/GoogleCloudPlatform/django-cloud-deploy/pull/34"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/34"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/django-cloud-deploy/statuses/ca4e50cd59578620e7a0741ab9347599082cb8cc"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"enriquejosepadilla"}}