GitHub PullRequestReviewCommentEvent at 2014-11-05 13:07:42
Repository: ruby-saml
Actor: buffym
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/onelogin/ruby-saml/pulls/comments/19871425","id":19871425,"diff_hunk":"@@ -19,38 +19,45 @@ def generate(settings)\n         }\n         sp_sso = root.add_element \"md:SPSSODescriptor\", {\n             \"protocolSupportEnumeration\" => \"urn:oasis:names:tc:SAML:2.0:protocol\",\n-            # Metadata request need not be signed (as we don't publish our cert)\n-            \"AuthnRequestsSigned\" => false,\n+            \"AuthnRequestsSigned\" => settings.security[:authn_requests_signed],\n             # However we would like assertions signed if idp_cert_fingerprint or idp_cert is set\n             \"WantAssertionsSigned\" => (!settings.idp_cert_fingerprint.nil? || !settings.idp_cert.nil?)\n         }\n         if settings.issuer != nil\n           root.attributes[\"entityID\"] = settings.issuer\n         end\n-        if settings.assertion_consumer_logout_service_url != nil\n+        if !settings.single_logout_service_url.nil?\n           sp_sso.add_element \"md:SingleLogoutService\", {\n-              # Add this as a setting to create different bindings?\n-              \"Binding\" => \"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect\",\n-              \"Location\" => settings.assertion_consumer_logout_service_url,\n-              \"ResponseLocation\" => settings.assertion_consumer_logout_service_url,\n+              \"Binding\" => settings.single_logout_service_binding,\n+              \"Location\" => settings.single_logout_service_url,\n+              \"ResponseLocation\" => settings.single_logout_service_url,\n               \"isDefault\" => true,\n               \"index\" => 0\n           }\n         end\n-        if settings.name_identifier_format != nil\n+        if !settings.name_identifier_format.nil?\n           name_id = sp_sso.add_element \"md:NameIDFormat\"\n           name_id.text = settings.name_identifier_format\n         end\n-        if settings.assertion_consumer_service_url != nil\n+        if !settings.assertion_consumer_service_url.nil?\n           sp_sso.add_element \"md:AssertionConsumerService\", {\n-              # Add this as a setting to create different bindings?\n-              \"Binding\" => \"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\",\n+              \"Binding\" => settings.assertion_consumer_service_binding,\n               \"Location\" => settings.assertion_consumer_service_url,\n               \"isDefault\" => true,\n               \"index\" => 0\n           }\n         end\n \n+        # Add KeyDescriptor if messages will be signed\n+        cert = settings.get_sp_cert()\n+        if !cert.nil?\n+          kd = sp_sso.add_element \"md:KeyDescriptor\", { \"use\" => \"signing\" }\n+          ki = kd.add_element \"ds:KeyInfo\", {\"xmlns:ds\" => \"http://www.w3.org/2000/09/xmldsig#\"}\n+          xd = ki.add_element \"ds:X509Data\"\n+          xc = xd.add_element \"ds:X509Certificate\"\n+          xc.text = Base64.encode64(cert.to_der)","path":"lib/onelogin/ruby-saml/metadata.rb","position":51,"original_position":51,"commit_id":"5ac4c31adce710e8e04186031ba93b08a4e71c55","original_commit_id":"5ac4c31adce710e8e04186031ba93b08a4e71c55","user":{"login":"buffym","id":98859,"avatar_url":"https://avatars.githubusercontent.com/u/98859?v=2","gravatar_id":"","url":"https://api.github.com/users/buffym","html_url":"https://github.com/buffym","followers_url":"https://api.github.com/users/buffym/followers","following_url":"https://api.github.com/users/buffym/following{/other_user}","gists_url":"https://api.github.com/users/buffym/gists{/gist_id}","starred_url":"https://api.github.com/users/buffym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buffym/subscriptions","organizations_url":"https://api.github.com/users/buffym/orgs","repos_url":"https://api.github.com/users/buffym/repos","events_url":"https://api.github.com/users/buffym/events{/privacy}","received_events_url":"https://api.github.com/users/buffym/received_events","type":"User","site_admin":false},"body":"I think that you need to strip newlines here - to make it match the format I've seen in other metadata.xml.\r\n\r\n```\r\nxc.text = Base64.encode64(cert.to_der).gsub(\"\\n\", '')\r\n```","created_at":"2014-11-05T13:07:42Z","updated_at":"2014-11-05T13:07:42Z","html_url":"https://github.com/onelogin/ruby-saml/pull/164#discussion_r19871425","pull_request_url":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/onelogin/ruby-saml/pulls/comments/19871425"},"html":{"href":"https://github.com/onelogin/ruby-saml/pull/164#discussion_r19871425"},"pull_request":{"href":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164","id":23677938,"html_url":"https://github.com/onelogin/ruby-saml/pull/164","diff_url":"https://github.com/onelogin/ruby-saml/pull/164.diff","patch_url":"https://github.com/onelogin/ruby-saml/pull/164.patch","issue_url":"https://api.github.com/repos/onelogin/ruby-saml/issues/164","number":164,"state":"open","locked":false,"title":"Merge 159 and 162","user":{"login":"pitbulk","id":600897,"avatar_url":"https://avatars.githubusercontent.com/u/600897?v=2","gravatar_id":"","url":"https://api.github.com/users/pitbulk","html_url":"https://github.com/pitbulk","followers_url":"https://api.github.com/users/pitbulk/followers","following_url":"https://api.github.com/users/pitbulk/following{/other_user}","gists_url":"https://api.github.com/users/pitbulk/gists{/gist_id}","starred_url":"https://api.github.com/users/pitbulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitbulk/subscriptions","organizations_url":"https://api.github.com/users/pitbulk/orgs","repos_url":"https://api.github.com/users/pitbulk/repos","events_url":"https://api.github.com/users/pitbulk/events{/privacy}","received_events_url":"https://api.github.com/users/pitbulk/received_events","type":"User","site_admin":false},"body":"In this PR I will merge the PR #159 and #162 and try to add signature to logout request and response","created_at":"2014-10-31T14:06:27Z","updated_at":"2014-11-05T13:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e4f6adb8cd47e794ddcd9afa9a310f5a7e198be","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164/commits","review_comments_url":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164/comments","review_comment_url":"https://api.github.com/repos/onelogin/ruby-saml/pulls/comments/{number}","comments_url":"https://api.github.com/repos/onelogin/ruby-saml/issues/164/comments","statuses_url":"https://api.github.com/repos/onelogin/ruby-saml/statuses/5ac4c31adce710e8e04186031ba93b08a4e71c55","head":{"label":"onelogin:merge_159_and_162","ref":"merge_159_and_162","sha":"5ac4c31adce710e8e04186031ba93b08a4e71c55","user":{"login":"onelogin","id":263373,"avatar_url":"https://avatars.githubusercontent.com/u/263373?v=2","gravatar_id":"","url":"https://api.github.com/users/onelogin","html_url":"https://github.com/onelogin","followers_url":"https://api.github.com/users/onelogin/followers","following_url":"https://api.github.com/users/onelogin/following{/other_user}","gists_url":"https://api.github.com/users/onelogin/gists{/gist_id}","starred_url":"https://api.github.com/users/onelogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onelogin/subscriptions","organizations_url":"https://api.github.com/users/onelogin/orgs","repos_url":"https://api.github.com/users/onelogin/repos","events_url":"https://api.github.com/users/onelogin/events{/privacy}","received_events_url":"https://api.github.com/users/onelogin/received_events","type":"Organization","site_admin":false},"repo":{"id":644899,"name":"ruby-saml","full_name":"onelogin/ruby-saml","owner":{"login":"onelogin","id":263373,"avatar_url":"https://avatars.githubusercontent.com/u/263373?v=2","gravatar_id":"","url":"https://api.github.com/users/onelogin","html_url":"https://github.com/onelogin","followers_url":"https://api.github.com/users/onelogin/followers","following_url":"https://api.github.com/users/onelogin/following{/other_user}","gists_url":"https://api.github.com/users/onelogin/gists{/gist_id}","starred_url":"https://api.github.com/users/onelogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onelogin/subscriptions","organizations_url":"https://api.github.com/users/onelogin/orgs","repos_url":"https://api.github.com/users/onelogin/repos","events_url":"https://api.github.com/users/onelogin/events{/privacy}","received_events_url":"https://api.github.com/users/onelogin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onelogin/ruby-saml","description":"SAML SSO for Ruby","fork":false,"url":"https://api.github.com/repos/onelogin/ruby-saml","forks_url":"https://api.github.com/repos/onelogin/ruby-saml/forks","keys_url":"https://api.github.com/repos/onelogin/ruby-saml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onelogin/ruby-saml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onelogin/ruby-saml/teams","hooks_url":"https://api.github.com/repos/onelogin/ruby-saml/hooks","issue_events_url":"https://api.github.com/repos/onelogin/ruby-saml/issues/events{/number}","events_url":"https://api.github.com/repos/onelogin/ruby-saml/events","assignees_url":"https://api.github.com/repos/onelogin/ruby-saml/assignees{/user}","branches_url":"https://api.github.com/repos/onelogin/ruby-saml/branches{/branch}","tags_url":"https://api.github.com/repos/onelogin/ruby-saml/tags","blobs_url":"https://api.github.com/repos/onelogin/ruby-saml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onelogin/ruby-saml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onelogin/ruby-saml/git/refs{/sha}","trees_url":"https://api.github.com/repos/onelogin/ruby-saml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onelogin/ruby-saml/statuses/{sha}","languages_url":"https://api.github.com/repos/onelogin/ruby-saml/languages","stargazers_url":"https://api.github.com/repos/onelogin/ruby-saml/stargazers","contributors_url":"https://api.github.com/repos/onelogin/ruby-saml/contributors","subscribers_url":"https://api.github.com/repos/onelogin/ruby-saml/subscribers","subscription_url":"https://api.github.com/repos/onelogin/ruby-saml/subscription","commits_url":"https://api.github.com/repos/onelogin/ruby-saml/commits{/sha}","git_commits_url":"https://api.github.com/repos/onelogin/ruby-saml/git/commits{/sha}","comments_url":"https://api.github.com/repos/onelogin/ruby-saml/comments{/number}","issue_comment_url":"https://api.github.com/repos/onelogin/ruby-saml/issues/comments/{number}","contents_url":"https://api.github.com/repos/onelogin/ruby-saml/contents/{+path}","compare_url":"https://api.github.com/repos/onelogin/ruby-saml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onelogin/ruby-saml/merges","archive_url":"https://api.github.com/repos/onelogin/ruby-saml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onelogin/ruby-saml/downloads","issues_url":"https://api.github.com/repos/onelogin/ruby-saml/issues{/number}","pulls_url":"https://api.github.com/repos/onelogin/ruby-saml/pulls{/number}","milestones_url":"https://api.github.com/repos/onelogin/ruby-saml/milestones{/number}","notifications_url":"https://api.github.com/repos/onelogin/ruby-saml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onelogin/ruby-saml/labels{/name}","releases_url":"https://api.github.com/repos/onelogin/ruby-saml/releases{/id}","created_at":"2010-05-03T18:39:04Z","updated_at":"2014-11-03T18:48:02Z","pushed_at":"2014-11-05T01:59:16Z","git_url":"git://github.com/onelogin/ruby-saml.git","ssh_url":"git@github.com:onelogin/ruby-saml.git","clone_url":"https://github.com/onelogin/ruby-saml.git","svn_url":"https://github.com/onelogin/ruby-saml","homepage":"http://support.onelogin.com/entries/165434-saml-toolkit-for-ruby-on-rails","size":3238,"stargazers_count":261,"watchers_count":261,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":14,"forks":212,"open_issues":14,"watchers":261,"default_branch":"master"}},"base":{"label":"onelogin:master","ref":"master","sha":"48e874261f82ee9a66241ac4fe2cc6664721636b","user":{"login":"onelogin","id":263373,"avatar_url":"https://avatars.githubusercontent.com/u/263373?v=2","gravatar_id":"","url":"https://api.github.com/users/onelogin","html_url":"https://github.com/onelogin","followers_url":"https://api.github.com/users/onelogin/followers","following_url":"https://api.github.com/users/onelogin/following{/other_user}","gists_url":"https://api.github.com/users/onelogin/gists{/gist_id}","starred_url":"https://api.github.com/users/onelogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onelogin/subscriptions","organizations_url":"https://api.github.com/users/onelogin/orgs","repos_url":"https://api.github.com/users/onelogin/repos","events_url":"https://api.github.com/users/onelogin/events{/privacy}","received_events_url":"https://api.github.com/users/onelogin/received_events","type":"Organization","site_admin":false},"repo":{"id":644899,"name":"ruby-saml","full_name":"onelogin/ruby-saml","owner":{"login":"onelogin","id":263373,"avatar_url":"https://avatars.githubusercontent.com/u/263373?v=2","gravatar_id":"","url":"https://api.github.com/users/onelogin","html_url":"https://github.com/onelogin","followers_url":"https://api.github.com/users/onelogin/followers","following_url":"https://api.github.com/users/onelogin/following{/other_user}","gists_url":"https://api.github.com/users/onelogin/gists{/gist_id}","starred_url":"https://api.github.com/users/onelogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onelogin/subscriptions","organizations_url":"https://api.github.com/users/onelogin/orgs","repos_url":"https://api.github.com/users/onelogin/repos","events_url":"https://api.github.com/users/onelogin/events{/privacy}","received_events_url":"https://api.github.com/users/onelogin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onelogin/ruby-saml","description":"SAML SSO for Ruby","fork":false,"url":"https://api.github.com/repos/onelogin/ruby-saml","forks_url":"https://api.github.com/repos/onelogin/ruby-saml/forks","keys_url":"https://api.github.com/repos/onelogin/ruby-saml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onelogin/ruby-saml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onelogin/ruby-saml/teams","hooks_url":"https://api.github.com/repos/onelogin/ruby-saml/hooks","issue_events_url":"https://api.github.com/repos/onelogin/ruby-saml/issues/events{/number}","events_url":"https://api.github.com/repos/onelogin/ruby-saml/events","assignees_url":"https://api.github.com/repos/onelogin/ruby-saml/assignees{/user}","branches_url":"https://api.github.com/repos/onelogin/ruby-saml/branches{/branch}","tags_url":"https://api.github.com/repos/onelogin/ruby-saml/tags","blobs_url":"https://api.github.com/repos/onelogin/ruby-saml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onelogin/ruby-saml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onelogin/ruby-saml/git/refs{/sha}","trees_url":"https://api.github.com/repos/onelogin/ruby-saml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onelogin/ruby-saml/statuses/{sha}","languages_url":"https://api.github.com/repos/onelogin/ruby-saml/languages","stargazers_url":"https://api.github.com/repos/onelogin/ruby-saml/stargazers","contributors_url":"https://api.github.com/repos/onelogin/ruby-saml/contributors","subscribers_url":"https://api.github.com/repos/onelogin/ruby-saml/subscribers","subscription_url":"https://api.github.com/repos/onelogin/ruby-saml/subscription","commits_url":"https://api.github.com/repos/onelogin/ruby-saml/commits{/sha}","git_commits_url":"https://api.github.com/repos/onelogin/ruby-saml/git/commits{/sha}","comments_url":"https://api.github.com/repos/onelogin/ruby-saml/comments{/number}","issue_comment_url":"https://api.github.com/repos/onelogin/ruby-saml/issues/comments/{number}","contents_url":"https://api.github.com/repos/onelogin/ruby-saml/contents/{+path}","compare_url":"https://api.github.com/repos/onelogin/ruby-saml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onelogin/ruby-saml/merges","archive_url":"https://api.github.com/repos/onelogin/ruby-saml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onelogin/ruby-saml/downloads","issues_url":"https://api.github.com/repos/onelogin/ruby-saml/issues{/number}","pulls_url":"https://api.github.com/repos/onelogin/ruby-saml/pulls{/number}","milestones_url":"https://api.github.com/repos/onelogin/ruby-saml/milestones{/number}","notifications_url":"https://api.github.com/repos/onelogin/ruby-saml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onelogin/ruby-saml/labels{/name}","releases_url":"https://api.github.com/repos/onelogin/ruby-saml/releases{/id}","created_at":"2010-05-03T18:39:04Z","updated_at":"2014-11-03T18:48:02Z","pushed_at":"2014-11-05T01:59:16Z","git_url":"git://github.com/onelogin/ruby-saml.git","ssh_url":"git@github.com:onelogin/ruby-saml.git","clone_url":"https://github.com/onelogin/ruby-saml.git","svn_url":"https://github.com/onelogin/ruby-saml","homepage":"http://support.onelogin.com/entries/165434-saml-toolkit-for-ruby-on-rails","size":3238,"stargazers_count":261,"watchers_count":261,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":14,"forks":212,"open_issues":14,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164"},"html":{"href":"https://github.com/onelogin/ruby-saml/pull/164"},"issue":{"href":"https://api.github.com/repos/onelogin/ruby-saml/issues/164"},"comments":{"href":"https://api.github.com/repos/onelogin/ruby-saml/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/onelogin/ruby-saml/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/onelogin/ruby-saml/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/onelogin/ruby-saml/statuses/5ac4c31adce710e8e04186031ba93b08a4e71c55"}}}}