{"action":"created","comment":{"url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/comments/114022697","pull_request_review_id":35464839,"id":114022697,"diff_hunk":"@@ -0,0 +1,95 @@\n+/*\n+ * Copyright 2016 The OpenYOLO Authors. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n+ * in compliance with the License. You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed under the\n+ * License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.openyolo.protocol;\n+\n+import static org.valid4j.Assertive.require;\n+\n+import android.support.annotation.NonNull;\n+import java.io.IOException;\n+import org.openyolo.protocol.internal.CustomMatchers;\n+\n+\n+/**\n+ * A URI-based representation of an authentication method, which describes how a credential is\n+ * used to authenticate a user.\n+ */\n+public final class AuthenticationMethod implements Comparable<AuthenticationMethod> {\n+\n+    /**\n+     * Creates an authentication method from its protocol buffer equivalent, in byte form.\n+     * @throws IOException if the protocol buffer cannot be parsed.\n+     */\n+    public static AuthenticationMethod fromProtobufBytes(byte[] protoBufBytes) throws IOException {\n+        return fromProtobuf(Protobufs.AuthenticationMethod.parseFrom(protoBufBytes));\n+    }\n+\n+    /**\n+     * Creates an authentication method from its protocol buffer equivalent.\n+     */\n+    public static AuthenticationMethod fromProtobuf(Protobufs.AuthenticationMethod authMethod) {\n+        return new AuthenticationMethod(authMethod.getUri());\n+    }\n+\n+    private final String mUri;\n+\n+    /**\n+     * Creates an authentication method from a URI string.\n+     */\n+    public AuthenticationMethod(@NonNull String authMethodUriStr) {\n+        mUri = require(authMethodUriStr, CustomMatchers.isValidAuthenticationMethod());\n+    }\n+\n+    public boolean isFederated() {\n+        return mUri.startsWith(\"https://\");","path":"protocol/java/org/openyolo/protocol/AuthenticationMethod.java","position":null,"original_position":55,"commit_id":"2d583e7f1ccedeaa8fc8e6d678e371a53bc778a9","original_commit_id":"f9f65974da22fda3cc09d129319b18f50b35cc4b","user":{"login":"iainmcgin","id":309153,"avatar_url":"https://avatars3.githubusercontent.com/u/309153?v=3","gravatar_id":"","url":"https://api.github.com/users/iainmcgin","html_url":"https://github.com/iainmcgin","followers_url":"https://api.github.com/users/iainmcgin/followers","following_url":"https://api.github.com/users/iainmcgin/following{/other_user}","gists_url":"https://api.github.com/users/iainmcgin/gists{/gist_id}","starred_url":"https://api.github.com/users/iainmcgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainmcgin/subscriptions","organizations_url":"https://api.github.com/users/iainmcgin/orgs","repos_url":"https://api.github.com/users/iainmcgin/repos","events_url":"https://api.github.com/users/iainmcgin/events{/privacy}","received_events_url":"https://api.github.com/users/iainmcgin/received_events","type":"User","site_admin":false},"body":"Agreed, this is pretty shaky now that I think about it more. Removed.","created_at":"2017-04-28T21:25:40Z","updated_at":"2017-04-28T21:39:03Z","html_url":"https://github.com/openid/OpenYOLO-Android/pull/29#discussion_r114022697","pull_request_url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/comments/114022697"},"html":{"href":"https://github.com/openid/OpenYOLO-Android/pull/29#discussion_r114022697"},"pull_request":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29","id":118037987,"html_url":"https://github.com/openid/OpenYOLO-Android/pull/29","diff_url":"https://github.com/openid/OpenYOLO-Android/pull/29.diff","patch_url":"https://github.com/openid/OpenYOLO-Android/pull/29.patch","issue_url":"https://api.github.com/repos/openid/OpenYOLO-Android/issues/29","number":29,"state":"open","locked":false,"title":"Introduction of AuthenticationMethod/Domain model types and protos","user":{"login":"iainmcgin","id":309153,"avatar_url":"https://avatars3.githubusercontent.com/u/309153?v=3","gravatar_id":"","url":"https://api.github.com/users/iainmcgin","html_url":"https://github.com/iainmcgin","followers_url":"https://api.github.com/users/iainmcgin/followers","following_url":"https://api.github.com/users/iainmcgin/following{/other_user}","gists_url":"https://api.github.com/users/iainmcgin/gists{/gist_id}","starred_url":"https://api.github.com/users/iainmcgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainmcgin/subscriptions","organizations_url":"https://api.github.com/users/iainmcgin/orgs","repos_url":"https://api.github.com/users/iainmcgin/repos","events_url":"https://api.github.com/users/iainmcgin/events{/privacy}","received_events_url":"https://api.github.com/users/iainmcgin/received_events","type":"User","site_admin":false},"body":"This is the first step in migrating to the protocol buffers in the\r\nthe OpenYOLO for Android spec. Many more to come.","created_at":"2017-04-27T21:37:49Z","updated_at":"2017-04-28T21:39:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abb8eeb6d1663babbc7b5aba0b78f31fa55e1667","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29/commits","review_comments_url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29/comments","review_comment_url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openid/OpenYOLO-Android/issues/29/comments","statuses_url":"https://api.github.com/repos/openid/OpenYOLO-Android/statuses/2d583e7f1ccedeaa8fc8e6d678e371a53bc778a9","head":{"label":"iainmcgin:authmethod","ref":"authmethod","sha":"2d583e7f1ccedeaa8fc8e6d678e371a53bc778a9","user":{"login":"iainmcgin","id":309153,"avatar_url":"https://avatars3.githubusercontent.com/u/309153?v=3","gravatar_id":"","url":"https://api.github.com/users/iainmcgin","html_url":"https://github.com/iainmcgin","followers_url":"https://api.github.com/users/iainmcgin/followers","following_url":"https://api.github.com/users/iainmcgin/following{/other_user}","gists_url":"https://api.github.com/users/iainmcgin/gists{/gist_id}","starred_url":"https://api.github.com/users/iainmcgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainmcgin/subscriptions","organizations_url":"https://api.github.com/users/iainmcgin/orgs","repos_url":"https://api.github.com/users/iainmcgin/repos","events_url":"https://api.github.com/users/iainmcgin/events{/privacy}","received_events_url":"https://api.github.com/users/iainmcgin/received_events","type":"User","site_admin":false},"repo":{"id":87985968,"name":"OpenYOLO-Android","full_name":"iainmcgin/OpenYOLO-Android","owner":{"login":"iainmcgin","id":309153,"avatar_url":"https://avatars3.githubusercontent.com/u/309153?v=3","gravatar_id":"","url":"https://api.github.com/users/iainmcgin","html_url":"https://github.com/iainmcgin","followers_url":"https://api.github.com/users/iainmcgin/followers","following_url":"https://api.github.com/users/iainmcgin/following{/other_user}","gists_url":"https://api.github.com/users/iainmcgin/gists{/gist_id}","starred_url":"https://api.github.com/users/iainmcgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainmcgin/subscriptions","organizations_url":"https://api.github.com/users/iainmcgin/orgs","repos_url":"https://api.github.com/users/iainmcgin/repos","events_url":"https://api.github.com/users/iainmcgin/events{/privacy}","received_events_url":"https://api.github.com/users/iainmcgin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iainmcgin/OpenYOLO-Android","description":"Android protocol for credential exchange and update - \"You Only Login Once\"","fork":true,"url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android","forks_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/forks","keys_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/teams","hooks_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/hooks","issue_events_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/issues/events{/number}","events_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/events","assignees_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/assignees{/user}","branches_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/branches{/branch}","tags_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/tags","blobs_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/languages","stargazers_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/stargazers","contributors_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/contributors","subscribers_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/subscribers","subscription_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/subscription","commits_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/contents/{+path}","compare_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/merges","archive_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/downloads","issues_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/issues{/number}","pulls_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/labels{/name}","releases_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/releases{/id}","deployments_url":"https://api.github.com/repos/iainmcgin/OpenYOLO-Android/deployments","created_at":"2017-04-11T22:45:31Z","updated_at":"2017-04-11T22:45:33Z","pushed_at":"2017-04-28T21:38:58Z","git_url":"git://github.com/iainmcgin/OpenYOLO-Android.git","ssh_url":"git@github.com:iainmcgin/OpenYOLO-Android.git","clone_url":"https://github.com/iainmcgin/OpenYOLO-Android.git","svn_url":"https://github.com/iainmcgin/OpenYOLO-Android","homepage":"http://openid.net/wg/ac/","size":478,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"openid:master","ref":"master","sha":"9d136d2a55ed9fe3d7ed07a388c24d4466416a22","user":{"login":"openid","id":71971,"avatar_url":"https://avatars1.githubusercontent.com/u/71971?v=3","gravatar_id":"","url":"https://api.github.com/users/openid","html_url":"https://github.com/openid","followers_url":"https://api.github.com/users/openid/followers","following_url":"https://api.github.com/users/openid/following{/other_user}","gists_url":"https://api.github.com/users/openid/gists{/gist_id}","starred_url":"https://api.github.com/users/openid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openid/subscriptions","organizations_url":"https://api.github.com/users/openid/orgs","repos_url":"https://api.github.com/users/openid/repos","events_url":"https://api.github.com/users/openid/events{/privacy}","received_events_url":"https://api.github.com/users/openid/received_events","type":"Organization","site_admin":false},"repo":{"id":81376694,"name":"OpenYOLO-Android","full_name":"openid/OpenYOLO-Android","owner":{"login":"openid","id":71971,"avatar_url":"https://avatars1.githubusercontent.com/u/71971?v=3","gravatar_id":"","url":"https://api.github.com/users/openid","html_url":"https://github.com/openid","followers_url":"https://api.github.com/users/openid/followers","following_url":"https://api.github.com/users/openid/following{/other_user}","gists_url":"https://api.github.com/users/openid/gists{/gist_id}","starred_url":"https://api.github.com/users/openid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openid/subscriptions","organizations_url":"https://api.github.com/users/openid/orgs","repos_url":"https://api.github.com/users/openid/repos","events_url":"https://api.github.com/users/openid/events{/privacy}","received_events_url":"https://api.github.com/users/openid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openid/OpenYOLO-Android","description":"Android protocol for credential exchange and update - \"You Only Login Once\"","fork":false,"url":"https://api.github.com/repos/openid/OpenYOLO-Android","forks_url":"https://api.github.com/repos/openid/OpenYOLO-Android/forks","keys_url":"https://api.github.com/repos/openid/OpenYOLO-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openid/OpenYOLO-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openid/OpenYOLO-Android/teams","hooks_url":"https://api.github.com/repos/openid/OpenYOLO-Android/hooks","issue_events_url":"https://api.github.com/repos/openid/OpenYOLO-Android/issues/events{/number}","events_url":"https://api.github.com/repos/openid/OpenYOLO-Android/events","assignees_url":"https://api.github.com/repos/openid/OpenYOLO-Android/assignees{/user}","branches_url":"https://api.github.com/repos/openid/OpenYOLO-Android/branches{/branch}","tags_url":"https://api.github.com/repos/openid/OpenYOLO-Android/tags","blobs_url":"https://api.github.com/repos/openid/OpenYOLO-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openid/OpenYOLO-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openid/OpenYOLO-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/openid/OpenYOLO-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openid/OpenYOLO-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/openid/OpenYOLO-Android/languages","stargazers_url":"https://api.github.com/repos/openid/OpenYOLO-Android/stargazers","contributors_url":"https://api.github.com/repos/openid/OpenYOLO-Android/contributors","subscribers_url":"https://api.github.com/repos/openid/OpenYOLO-Android/subscribers","subscription_url":"https://api.github.com/repos/openid/OpenYOLO-Android/subscription","commits_url":"https://api.github.com/repos/openid/OpenYOLO-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/openid/OpenYOLO-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/openid/OpenYOLO-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/openid/OpenYOLO-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/openid/OpenYOLO-Android/contents/{+path}","compare_url":"https://api.github.com/repos/openid/OpenYOLO-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openid/OpenYOLO-Android/merges","archive_url":"https://api.github.com/repos/openid/OpenYOLO-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openid/OpenYOLO-Android/downloads","issues_url":"https://api.github.com/repos/openid/OpenYOLO-Android/issues{/number}","pulls_url":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/openid/OpenYOLO-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/openid/OpenYOLO-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openid/OpenYOLO-Android/labels{/name}","releases_url":"https://api.github.com/repos/openid/OpenYOLO-Android/releases{/id}","deployments_url":"https://api.github.com/repos/openid/OpenYOLO-Android/deployments","created_at":"2017-02-08T21:15:55Z","updated_at":"2017-03-16T06:39:14Z","pushed_at":"2017-04-28T21:38:59Z","git_url":"git://github.com/openid/OpenYOLO-Android.git","ssh_url":"git@github.com:openid/OpenYOLO-Android.git","clone_url":"https://github.com/openid/OpenYOLO-Android.git","svn_url":"https://github.com/openid/OpenYOLO-Android","homepage":"http://openid.net/wg/ac/","size":452,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29"},"html":{"href":"https://github.com/openid/OpenYOLO-Android/pull/29"},"issue":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/issues/29"},"comments":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/openid/OpenYOLO-Android/statuses/2d583e7f1ccedeaa8fc8e6d678e371a53bc778a9"}}}}
{"actor":{"display_login":"iainmcgin"}}