{"action":"created","comment":{"url":"https://api.github.com/repos/google/google-auth-library-java/pulls/comments/33382136","id":33382136,"diff_hunk":"@@ -0,0 +1,87 @@\n+/*\n+ * Copyright 2015, Google Inc. All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are\n+ * met:\n+ *\n+ *    * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ *    * Redistributions in binary form must reproduce the above\n+ * copyright notice, this list of conditions and the following disclaimer\n+ * in the documentation and/or other materials provided with the\n+ * distribution.\n+ *\n+ *    * Neither the name of Google Inc. nor the names of its\n+ * contributors may be used to endorse or promote products derived from\n+ * this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+package com.google.auth.appengine;\n+\n+import com.google.auth.oauth2.AccessToken;\n+import com.google.auth.oauth2.GoogleCredentials;\n+import com.google.appengine.api.appidentity.AppIdentityService;\n+import com.google.appengine.api.appidentity.AppIdentityServiceFactory;\n+\n+import java.io.IOException;\n+import java.util.Collection;\n+\n+/**\n+ * OAuth2 credentials representing the built-in service account for Google App ENgine.\n+ *\n+ * <p>Fetches access tokens from the App Identity service.\n+ */\n+public class AppEngineCredentials extends GoogleCredentials {\n+  \n+  private final AppIdentityService appIdentityService;\n+  \n+  private final Collection<String> scopes;\n+  \n+  private final boolean scopesRequired;  \n+  \n+  public AppEngineCredentials(Collection<String> scopes) {\n+    this(scopes, null);\n+  }\n+\n+  public AppEngineCredentials(Collection<String> scopes, AppIdentityService appIdentityService) {\n+    this.scopes = scopes;","path":"appengine/java/com/google/auth/appengine/AppEngineCredentials.java","position":60,"original_position":60,"commit_id":"96f1e415142702ea1efb8742435fe5345bd597e8","original_commit_id":"96f1e415142702ea1efb8742435fe5345bd597e8","user":{"login":"ejona86","id":2811396,"avatar_url":"https://avatars.githubusercontent.com/u/2811396?v=3","gravatar_id":"","url":"https://api.github.com/users/ejona86","html_url":"https://github.com/ejona86","followers_url":"https://api.github.com/users/ejona86/followers","following_url":"https://api.github.com/users/ejona86/following{/other_user}","gists_url":"https://api.github.com/users/ejona86/gists{/gist_id}","starred_url":"https://api.github.com/users/ejona86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejona86/subscriptions","organizations_url":"https://api.github.com/users/ejona86/orgs","repos_url":"https://api.github.com/users/ejona86/repos","events_url":"https://api.github.com/users/ejona86/events{/privacy}","received_events_url":"https://api.github.com/users/ejona86/received_events","type":"User","site_admin":false},"body":"Do we need to make a defensive copy?","created_at":"2015-06-26T18:27:19Z","updated_at":"2015-06-26T18:27:19Z","html_url":"https://github.com/google/google-auth-library-java/pull/16#discussion_r33382136","pull_request_url":"https://api.github.com/repos/google/google-auth-library-java/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/google/google-auth-library-java/pulls/comments/33382136"},"html":{"href":"https://github.com/google/google-auth-library-java/pull/16#discussion_r33382136"},"pull_request":{"href":"https://api.github.com/repos/google/google-auth-library-java/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/google/google-auth-library-java/pulls/16","id":38604916,"html_url":"https://github.com/google/google-auth-library-java/pull/16","diff_url":"https://github.com/google/google-auth-library-java/pull/16.diff","patch_url":"https://github.com/google/google-auth-library-java/pull/16.patch","issue_url":"https://api.github.com/repos/google/google-auth-library-java/issues/16","number":16,"state":"open","locked":false,"title":"Google App Engine Credentials.","user":{"login":"anthmgoogle","id":6653712,"avatar_url":"https://avatars.githubusercontent.com/u/6653712?v=3","gravatar_id":"","url":"https://api.github.com/users/anthmgoogle","html_url":"https://github.com/anthmgoogle","followers_url":"https://api.github.com/users/anthmgoogle/followers","following_url":"https://api.github.com/users/anthmgoogle/following{/other_user}","gists_url":"https://api.github.com/users/anthmgoogle/gists{/gist_id}","starred_url":"https://api.github.com/users/anthmgoogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthmgoogle/subscriptions","organizations_url":"https://api.github.com/users/anthmgoogle/orgs","repos_url":"https://api.github.com/users/anthmgoogle/repos","events_url":"https://api.github.com/users/anthmgoogle/events{/privacy}","received_events_url":"https://api.github.com/users/anthmgoogle/received_events","type":"User","site_admin":false},"body":"Initial implementation of AppEngineCredentials in new module because of GAE SDK dependencies.","created_at":"2015-06-25T23:36:54Z","updated_at":"2015-06-26T18:27:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd5b0a40e053d49b79cf2c5f4b4fc08faf283afa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/google-auth-library-java/pulls/16/commits","review_comments_url":"https://api.github.com/repos/google/google-auth-library-java/pulls/16/comments","review_comment_url":"https://api.github.com/repos/google/google-auth-library-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/google-auth-library-java/issues/16/comments","statuses_url":"https://api.github.com/repos/google/google-auth-library-java/statuses/96f1e415142702ea1efb8742435fe5345bd597e8","head":{"label":"anthmgoogle:gaecred01","ref":"gaecred01","sha":"96f1e415142702ea1efb8742435fe5345bd597e8","user":{"login":"anthmgoogle","id":6653712,"avatar_url":"https://avatars.githubusercontent.com/u/6653712?v=3","gravatar_id":"","url":"https://api.github.com/users/anthmgoogle","html_url":"https://github.com/anthmgoogle","followers_url":"https://api.github.com/users/anthmgoogle/followers","following_url":"https://api.github.com/users/anthmgoogle/following{/other_user}","gists_url":"https://api.github.com/users/anthmgoogle/gists{/gist_id}","starred_url":"https://api.github.com/users/anthmgoogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthmgoogle/subscriptions","organizations_url":"https://api.github.com/users/anthmgoogle/orgs","repos_url":"https://api.github.com/users/anthmgoogle/repos","events_url":"https://api.github.com/users/anthmgoogle/events{/privacy}","received_events_url":"https://api.github.com/users/anthmgoogle/received_events","type":"User","site_admin":false},"repo":{"id":31392167,"name":"google-auth-library-java","full_name":"anthmgoogle/google-auth-library-java","owner":{"login":"anthmgoogle","id":6653712,"avatar_url":"https://avatars.githubusercontent.com/u/6653712?v=3","gravatar_id":"","url":"https://api.github.com/users/anthmgoogle","html_url":"https://github.com/anthmgoogle","followers_url":"https://api.github.com/users/anthmgoogle/followers","following_url":"https://api.github.com/users/anthmgoogle/following{/other_user}","gists_url":"https://api.github.com/users/anthmgoogle/gists{/gist_id}","starred_url":"https://api.github.com/users/anthmgoogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthmgoogle/subscriptions","organizations_url":"https://api.github.com/users/anthmgoogle/orgs","repos_url":"https://api.github.com/users/anthmgoogle/repos","events_url":"https://api.github.com/users/anthmgoogle/events{/privacy}","received_events_url":"https://api.github.com/users/anthmgoogle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anthmgoogle/google-auth-library-java","description":null,"fork":true,"url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java","forks_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/forks","keys_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/teams","hooks_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/hooks","issue_events_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/issues/events{/number}","events_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/events","assignees_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/assignees{/user}","branches_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/branches{/branch}","tags_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/tags","blobs_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/statuses/{sha}","languages_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/languages","stargazers_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/stargazers","contributors_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/contributors","subscribers_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/subscribers","subscription_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/subscription","commits_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/contents/{+path}","compare_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/merges","archive_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/downloads","issues_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/issues{/number}","pulls_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/pulls{/number}","milestones_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/milestones{/number}","notifications_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/labels{/name}","releases_url":"https://api.github.com/repos/anthmgoogle/google-auth-library-java/releases{/id}","created_at":"2015-02-26T22:27:30Z","updated_at":"2015-04-15T17:54:56Z","pushed_at":"2015-06-25T23:35:49Z","git_url":"git://github.com/anthmgoogle/google-auth-library-java.git","ssh_url":"git@github.com:anthmgoogle/google-auth-library-java.git","clone_url":"https://github.com/anthmgoogle/google-auth-library-java.git","svn_url":"https://github.com/anthmgoogle/google-auth-library-java","homepage":null,"size":177,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"google:master","ref":"master","sha":"1ced89f94fdf0257c801339bc6a3bc93105c3745","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":30676648,"name":"google-auth-library-java","full_name":"google/google-auth-library-java","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/google-auth-library-java","description":null,"fork":false,"url":"https://api.github.com/repos/google/google-auth-library-java","forks_url":"https://api.github.com/repos/google/google-auth-library-java/forks","keys_url":"https://api.github.com/repos/google/google-auth-library-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/google-auth-library-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/google-auth-library-java/teams","hooks_url":"https://api.github.com/repos/google/google-auth-library-java/hooks","issue_events_url":"https://api.github.com/repos/google/google-auth-library-java/issues/events{/number}","events_url":"https://api.github.com/repos/google/google-auth-library-java/events","assignees_url":"https://api.github.com/repos/google/google-auth-library-java/assignees{/user}","branches_url":"https://api.github.com/repos/google/google-auth-library-java/branches{/branch}","tags_url":"https://api.github.com/repos/google/google-auth-library-java/tags","blobs_url":"https://api.github.com/repos/google/google-auth-library-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/google-auth-library-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/google-auth-library-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/google-auth-library-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/google-auth-library-java/statuses/{sha}","languages_url":"https://api.github.com/repos/google/google-auth-library-java/languages","stargazers_url":"https://api.github.com/repos/google/google-auth-library-java/stargazers","contributors_url":"https://api.github.com/repos/google/google-auth-library-java/contributors","subscribers_url":"https://api.github.com/repos/google/google-auth-library-java/subscribers","subscription_url":"https://api.github.com/repos/google/google-auth-library-java/subscription","commits_url":"https://api.github.com/repos/google/google-auth-library-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/google-auth-library-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/google-auth-library-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/google-auth-library-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/google-auth-library-java/contents/{+path}","compare_url":"https://api.github.com/repos/google/google-auth-library-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/google-auth-library-java/merges","archive_url":"https://api.github.com/repos/google/google-auth-library-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/google-auth-library-java/downloads","issues_url":"https://api.github.com/repos/google/google-auth-library-java/issues{/number}","pulls_url":"https://api.github.com/repos/google/google-auth-library-java/pulls{/number}","milestones_url":"https://api.github.com/repos/google/google-auth-library-java/milestones{/number}","notifications_url":"https://api.github.com/repos/google/google-auth-library-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/google-auth-library-java/labels{/name}","releases_url":"https://api.github.com/repos/google/google-auth-library-java/releases{/id}","created_at":"2015-02-12T00:06:15Z","updated_at":"2015-06-22T18:34:38Z","pushed_at":"2015-06-25T23:36:56Z","git_url":"git://github.com/google/google-auth-library-java.git","ssh_url":"git@github.com:google/google-auth-library-java.git","clone_url":"https://github.com/google/google-auth-library-java.git","svn_url":"https://github.com/google/google-auth-library-java","homepage":null,"size":260,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":7,"forks":8,"open_issues":7,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/google-auth-library-java/pulls/16"},"html":{"href":"https://github.com/google/google-auth-library-java/pull/16"},"issue":{"href":"https://api.github.com/repos/google/google-auth-library-java/issues/16"},"comments":{"href":"https://api.github.com/repos/google/google-auth-library-java/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/google/google-auth-library-java/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/google/google-auth-library-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/google-auth-library-java/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/google/google-auth-library-java/statuses/96f1e415142702ea1efb8742435fe5345bd597e8"}}}}