{"action":"created","comment":{"url":"https://api.github.com/repos/connexta/saml-conformance/pulls/comments/193780219","pull_request_review_id":126820968,"id":193780219,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzc4MDIxOQ==","diff_hunk":"@@ -0,0 +1,94 @@\n+/**\n+ * Copyright (c) Codice Foundation\n+ *\n+ * <p>This is free software: you can redistribute it and/or modify it under the terms of the GNU\n+ * Lesser General Public License as published by the Free Software Foundation, either version 3 of\n+ * the License, or any later version.\n+ *\n+ * <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public\n+ * License is distributed along with this program and can be found at\n+ * <http://www.gnu.org/licenses/lgpl.html>.\n+ */\n+package org.codice.compilance.verification.core.response\n+\n+import io.kotlintest.matchers.string.shouldContain\n+import io.kotlintest.shouldThrow\n+import io.kotlintest.specs.StringSpec\n+import org.codice.compliance.Common\n+import org.codice.compliance.SAMLComplianceException\n+import org.codice.compliance.SAMLCore_3_7_3_2_b\n+import org.codice.compliance.SAMLCore_3_7_3_2_d\n+import org.codice.compliance.utils.PERSISTENT_ID\n+import org.codice.compliance.utils.RESPONDER\n+import org.codice.compliance.utils.SUCCESS\n+import org.codice.compliance.utils.TestCommon.Companion.REQUEST_ID\n+import org.codice.compliance.utils.TestCommon.Companion.currentSPIssuer\n+import org.codice.compliance.verification.core.responses.CoreLogoutResponseProtocolVerifier\n+import org.codice.security.saml.SamlProtocol.Binding.HTTP_POST\n+import org.joda.time.DateTime\n+import org.opensaml.saml.common.SAMLVersion.VERSION_20\n+import org.opensaml.saml.saml2.core.impl.IssuerBuilder\n+import org.opensaml.saml.saml2.core.impl.LogoutRequestBuilder\n+import org.opensaml.saml.saml2.core.impl.NameIDBuilder\n+import java.time.Instant\n+import java.util.UUID\n+\n+class CoreLogoutResponseProtocolVerifierSpec : StringSpec() {\n+\n+    private val logoutRequest by lazy {\n+        REQUEST_ID = \"a\" + UUID.randomUUID().toString()\n+\n+        LogoutRequestBuilder().buildObject().apply {\n+            issuer = IssuerBuilder().buildObject().apply { value = currentSPIssuer }\n+            id = REQUEST_ID\n+            version = VERSION_20\n+            issueInstant = DateTime()\n+            destination = \"https://localhost:8993/services/idp/login\"\n+            nameID = NameIDBuilder().buildObject().apply {\n+                nameQualifier = \"https://localhost:8993/services/idp/login\"\n+                spNameQualifier = currentSPIssuer\n+                format = PERSISTENT_ID\n+                value = \"admin\"\n+            }\n+        }\n+    }\n+\n+    init {\n+        \"logout response with correct second-level status code should pass\" {\n+            Common.buildDom(createLogoutResponse(SUCCESS)).let {\n+                CoreLogoutResponseProtocolVerifier(logoutRequest, it, HTTP_POST, SUCCESS).verify()\n+            }\n+        }\n+\n+        \"logout response with incorrect second-level status code should fail\" {\n+            Common.buildDom(createLogoutResponse(RESPONDER)).let {\n+                shouldThrow<SAMLComplianceException> {\n+                    CoreLogoutResponseProtocolVerifier(logoutRequest, it, HTTP_POST, SUCCESS)\n+                        .verify()\n+                }.apply {\n+                    this.message?.shouldContain(SAMLCore_3_7_3_2_b.message)\n+                    this.message?.shouldContain(SAMLCore_3_7_3_2_d.message)\n+                }\n+            }\n+        }","path":"ctk/common/src/test/kotlin/org/codice/compilance/verification/core/response/CoreLogoutResponseProtocolVerifierSpec.kt","position":75,"original_position":75,"commit_id":"bdcb53789ba77af32286afd6c22bf316ff761b08","original_commit_id":"bdcb53789ba77af32286afd6c22bf316ff761b08","user":{"login":"brjeter","id":8130140,"node_id":"MDQ6VXNlcjgxMzAxNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/8130140?v=4","gravatar_id":"","url":"https://api.github.com/users/brjeter","html_url":"https://github.com/brjeter","followers_url":"https://api.github.com/users/brjeter/followers","following_url":"https://api.github.com/users/brjeter/following{/other_user}","gists_url":"https://api.github.com/users/brjeter/gists{/gist_id}","starred_url":"https://api.github.com/users/brjeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brjeter/subscriptions","organizations_url":"https://api.github.com/users/brjeter/orgs","repos_url":"https://api.github.com/users/brjeter/repos","events_url":"https://api.github.com/users/brjeter/events{/privacy}","received_events_url":"https://api.github.com/users/brjeter/received_events","type":"User","site_admin":false},"body":"❓ Should we also have a test for:\r\n1. when there is no secondary status code (i.e. `null`) and we're expecting one, it will throw an exception (this could utilize the second test's code, just with different input)\r\n2. When we're not expecting a status code, it can have any secondary status code and it won't throw an exception (I see some benefit in doing an array of a handful of values here to make sure none of them throw an exception)","created_at":"2018-06-07T15:02:06Z","updated_at":"2018-06-07T15:03:06Z","html_url":"https://github.com/connexta/saml-conformance/pull/155#discussion_r193780219","pull_request_url":"https://api.github.com/repos/connexta/saml-conformance/pulls/155","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/connexta/saml-conformance/pulls/comments/193780219"},"html":{"href":"https://github.com/connexta/saml-conformance/pull/155#discussion_r193780219"},"pull_request":{"href":"https://api.github.com/repos/connexta/saml-conformance/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/connexta/saml-conformance/pulls/155","id":193082404,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMDgyNDA0","html_url":"https://github.com/connexta/saml-conformance/pull/155","diff_url":"https://github.com/connexta/saml-conformance/pull/155.diff","patch_url":"https://github.com/connexta/saml-conformance/pull/155.patch","issue_url":"https://api.github.com/repos/connexta/saml-conformance/issues/155","number":155,"state":"open","locked":false,"title":"MAINT - Added unit test for CoreLogoutResponseProtocolVerifier","user":{"login":"blen-desta","id":29550062,"node_id":"MDQ6VXNlcjI5NTUwMDYy","avatar_url":"https://avatars0.githubusercontent.com/u/29550062?v=4","gravatar_id":"","url":"https://api.github.com/users/blen-desta","html_url":"https://github.com/blen-desta","followers_url":"https://api.github.com/users/blen-desta/followers","following_url":"https://api.github.com/users/blen-desta/following{/other_user}","gists_url":"https://api.github.com/users/blen-desta/gists{/gist_id}","starred_url":"https://api.github.com/users/blen-desta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blen-desta/subscriptions","organizations_url":"https://api.github.com/users/blen-desta/orgs","repos_url":"https://api.github.com/users/blen-desta/repos","events_url":"https://api.github.com/users/blen-desta/events{/privacy}","received_events_url":"https://api.github.com/users/blen-desta/received_events","type":"User","site_admin":false},"body":"#### What does this PR do (if it's not clear from the Title)? Please include any specification references that apply.\r\nAdded unit test for `CoreLogoutResponseProtocolVerifier`\r\n\r\n#### Checklist:\r\n- [ ] SAML Spec Table of Contents documentation updated\r\n- [x] Unit Tests Added/Modified","created_at":"2018-06-06T17:11:38Z","updated_at":"2018-06-07T15:03:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61050632c2abd3709a94211280679f8b4d5e1a70","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bakejeyner","id":14284361,"node_id":"MDQ6VXNlcjE0Mjg0MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/14284361?v=4","gravatar_id":"","url":"https://api.github.com/users/bakejeyner","html_url":"https://github.com/bakejeyner","followers_url":"https://api.github.com/users/bakejeyner/followers","following_url":"https://api.github.com/users/bakejeyner/following{/other_user}","gists_url":"https://api.github.com/users/bakejeyner/gists{/gist_id}","starred_url":"https://api.github.com/users/bakejeyner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakejeyner/subscriptions","organizations_url":"https://api.github.com/users/bakejeyner/orgs","repos_url":"https://api.github.com/users/bakejeyner/repos","events_url":"https://api.github.com/users/bakejeyner/events{/privacy}","received_events_url":"https://api.github.com/users/bakejeyner/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/connexta/saml-conformance/pulls/155/commits","review_comments_url":"https://api.github.com/repos/connexta/saml-conformance/pulls/155/comments","review_comment_url":"https://api.github.com/repos/connexta/saml-conformance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/connexta/saml-conformance/issues/155/comments","statuses_url":"https://api.github.com/repos/connexta/saml-conformance/statuses/bdcb53789ba77af32286afd6c22bf316ff761b08","head":{"label":"blen-desta:core-logout-res-test","ref":"core-logout-res-test","sha":"bdcb53789ba77af32286afd6c22bf316ff761b08","user":{"login":"blen-desta","id":29550062,"node_id":"MDQ6VXNlcjI5NTUwMDYy","avatar_url":"https://avatars0.githubusercontent.com/u/29550062?v=4","gravatar_id":"","url":"https://api.github.com/users/blen-desta","html_url":"https://github.com/blen-desta","followers_url":"https://api.github.com/users/blen-desta/followers","following_url":"https://api.github.com/users/blen-desta/following{/other_user}","gists_url":"https://api.github.com/users/blen-desta/gists{/gist_id}","starred_url":"https://api.github.com/users/blen-desta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blen-desta/subscriptions","organizations_url":"https://api.github.com/users/blen-desta/orgs","repos_url":"https://api.github.com/users/blen-desta/repos","events_url":"https://api.github.com/users/blen-desta/events{/privacy}","received_events_url":"https://api.github.com/users/blen-desta/received_events","type":"User","site_admin":false},"repo":{"id":126052431,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYwNTI0MzE=","name":"saml-conformance","full_name":"blen-desta/saml-conformance","owner":{"login":"blen-desta","id":29550062,"node_id":"MDQ6VXNlcjI5NTUwMDYy","avatar_url":"https://avatars0.githubusercontent.com/u/29550062?v=4","gravatar_id":"","url":"https://api.github.com/users/blen-desta","html_url":"https://github.com/blen-desta","followers_url":"https://api.github.com/users/blen-desta/followers","following_url":"https://api.github.com/users/blen-desta/following{/other_user}","gists_url":"https://api.github.com/users/blen-desta/gists{/gist_id}","starred_url":"https://api.github.com/users/blen-desta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blen-desta/subscriptions","organizations_url":"https://api.github.com/users/blen-desta/orgs","repos_url":"https://api.github.com/users/blen-desta/repos","events_url":"https://api.github.com/users/blen-desta/events{/privacy}","received_events_url":"https://api.github.com/users/blen-desta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blen-desta/saml-conformance","description":null,"fork":true,"url":"https://api.github.com/repos/blen-desta/saml-conformance","forks_url":"https://api.github.com/repos/blen-desta/saml-conformance/forks","keys_url":"https://api.github.com/repos/blen-desta/saml-conformance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blen-desta/saml-conformance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blen-desta/saml-conformance/teams","hooks_url":"https://api.github.com/repos/blen-desta/saml-conformance/hooks","issue_events_url":"https://api.github.com/repos/blen-desta/saml-conformance/issues/events{/number}","events_url":"https://api.github.com/repos/blen-desta/saml-conformance/events","assignees_url":"https://api.github.com/repos/blen-desta/saml-conformance/assignees{/user}","branches_url":"https://api.github.com/repos/blen-desta/saml-conformance/branches{/branch}","tags_url":"https://api.github.com/repos/blen-desta/saml-conformance/tags","blobs_url":"https://api.github.com/repos/blen-desta/saml-conformance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blen-desta/saml-conformance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blen-desta/saml-conformance/git/refs{/sha}","trees_url":"https://api.github.com/repos/blen-desta/saml-conformance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blen-desta/saml-conformance/statuses/{sha}","languages_url":"https://api.github.com/repos/blen-desta/saml-conformance/languages","stargazers_url":"https://api.github.com/repos/blen-desta/saml-conformance/stargazers","contributors_url":"https://api.github.com/repos/blen-desta/saml-conformance/contributors","subscribers_url":"https://api.github.com/repos/blen-desta/saml-conformance/subscribers","subscription_url":"https://api.github.com/repos/blen-desta/saml-conformance/subscription","commits_url":"https://api.github.com/repos/blen-desta/saml-conformance/commits{/sha}","git_commits_url":"https://api.github.com/repos/blen-desta/saml-conformance/git/commits{/sha}","comments_url":"https://api.github.com/repos/blen-desta/saml-conformance/comments{/number}","issue_comment_url":"https://api.github.com/repos/blen-desta/saml-conformance/issues/comments{/number}","contents_url":"https://api.github.com/repos/blen-desta/saml-conformance/contents/{+path}","compare_url":"https://api.github.com/repos/blen-desta/saml-conformance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blen-desta/saml-conformance/merges","archive_url":"https://api.github.com/repos/blen-desta/saml-conformance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blen-desta/saml-conformance/downloads","issues_url":"https://api.github.com/repos/blen-desta/saml-conformance/issues{/number}","pulls_url":"https://api.github.com/repos/blen-desta/saml-conformance/pulls{/number}","milestones_url":"https://api.github.com/repos/blen-desta/saml-conformance/milestones{/number}","notifications_url":"https://api.github.com/repos/blen-desta/saml-conformance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blen-desta/saml-conformance/labels{/name}","releases_url":"https://api.github.com/repos/blen-desta/saml-conformance/releases{/id}","deployments_url":"https://api.github.com/repos/blen-desta/saml-conformance/deployments","created_at":"2018-03-20T16:57:12Z","updated_at":"2018-03-20T16:57:14Z","pushed_at":"2018-06-06T22:53:00Z","git_url":"git://github.com/blen-desta/saml-conformance.git","ssh_url":"git@github.com:blen-desta/saml-conformance.git","clone_url":"https://github.com/blen-desta/saml-conformance.git","svn_url":"https://github.com/blen-desta/saml-conformance","homepage":null,"size":1088,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"connexta:master","ref":"master","sha":"80662ff56027c55dc5a8fde140d3a1202e2dc72c","user":{"login":"connexta","id":6706726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MDY3MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/6706726?v=4","gravatar_id":"","url":"https://api.github.com/users/connexta","html_url":"https://github.com/connexta","followers_url":"https://api.github.com/users/connexta/followers","following_url":"https://api.github.com/users/connexta/following{/other_user}","gists_url":"https://api.github.com/users/connexta/gists{/gist_id}","starred_url":"https://api.github.com/users/connexta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connexta/subscriptions","organizations_url":"https://api.github.com/users/connexta/orgs","repos_url":"https://api.github.com/users/connexta/repos","events_url":"https://api.github.com/users/connexta/events{/privacy}","received_events_url":"https://api.github.com/users/connexta/received_events","type":"Organization","site_admin":false},"repo":{"id":121804316,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE4MDQzMTY=","name":"saml-conformance","full_name":"connexta/saml-conformance","owner":{"login":"connexta","id":6706726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MDY3MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/6706726?v=4","gravatar_id":"","url":"https://api.github.com/users/connexta","html_url":"https://github.com/connexta","followers_url":"https://api.github.com/users/connexta/followers","following_url":"https://api.github.com/users/connexta/following{/other_user}","gists_url":"https://api.github.com/users/connexta/gists{/gist_id}","starred_url":"https://api.github.com/users/connexta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connexta/subscriptions","organizations_url":"https://api.github.com/users/connexta/orgs","repos_url":"https://api.github.com/users/connexta/repos","events_url":"https://api.github.com/users/connexta/events{/privacy}","received_events_url":"https://api.github.com/users/connexta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/connexta/saml-conformance","description":null,"fork":false,"url":"https://api.github.com/repos/connexta/saml-conformance","forks_url":"https://api.github.com/repos/connexta/saml-conformance/forks","keys_url":"https://api.github.com/repos/connexta/saml-conformance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/connexta/saml-conformance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/connexta/saml-conformance/teams","hooks_url":"https://api.github.com/repos/connexta/saml-conformance/hooks","issue_events_url":"https://api.github.com/repos/connexta/saml-conformance/issues/events{/number}","events_url":"https://api.github.com/repos/connexta/saml-conformance/events","assignees_url":"https://api.github.com/repos/connexta/saml-conformance/assignees{/user}","branches_url":"https://api.github.com/repos/connexta/saml-conformance/branches{/branch}","tags_url":"https://api.github.com/repos/connexta/saml-conformance/tags","blobs_url":"https://api.github.com/repos/connexta/saml-conformance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/connexta/saml-conformance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/connexta/saml-conformance/git/refs{/sha}","trees_url":"https://api.github.com/repos/connexta/saml-conformance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/connexta/saml-conformance/statuses/{sha}","languages_url":"https://api.github.com/repos/connexta/saml-conformance/languages","stargazers_url":"https://api.github.com/repos/connexta/saml-conformance/stargazers","contributors_url":"https://api.github.com/repos/connexta/saml-conformance/contributors","subscribers_url":"https://api.github.com/repos/connexta/saml-conformance/subscribers","subscription_url":"https://api.github.com/repos/connexta/saml-conformance/subscription","commits_url":"https://api.github.com/repos/connexta/saml-conformance/commits{/sha}","git_commits_url":"https://api.github.com/repos/connexta/saml-conformance/git/commits{/sha}","comments_url":"https://api.github.com/repos/connexta/saml-conformance/comments{/number}","issue_comment_url":"https://api.github.com/repos/connexta/saml-conformance/issues/comments{/number}","contents_url":"https://api.github.com/repos/connexta/saml-conformance/contents/{+path}","compare_url":"https://api.github.com/repos/connexta/saml-conformance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/connexta/saml-conformance/merges","archive_url":"https://api.github.com/repos/connexta/saml-conformance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/connexta/saml-conformance/downloads","issues_url":"https://api.github.com/repos/connexta/saml-conformance/issues{/number}","pulls_url":"https://api.github.com/repos/connexta/saml-conformance/pulls{/number}","milestones_url":"https://api.github.com/repos/connexta/saml-conformance/milestones{/number}","notifications_url":"https://api.github.com/repos/connexta/saml-conformance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/connexta/saml-conformance/labels{/name}","releases_url":"https://api.github.com/repos/connexta/saml-conformance/releases{/id}","deployments_url":"https://api.github.com/repos/connexta/saml-conformance/deployments","created_at":"2018-02-16T21:48:23Z","updated_at":"2018-06-06T19:57:51Z","pushed_at":"2018-06-06T22:53:01Z","git_url":"git://github.com/connexta/saml-conformance.git","ssh_url":"git@github.com:connexta/saml-conformance.git","clone_url":"https://github.com/connexta/saml-conformance.git","svn_url":"https://github.com/connexta/saml-conformance","homepage":null,"size":1077,"stargazers_count":1,"watchers_count":1,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":6,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/connexta/saml-conformance/pulls/155"},"html":{"href":"https://github.com/connexta/saml-conformance/pull/155"},"issue":{"href":"https://api.github.com/repos/connexta/saml-conformance/issues/155"},"comments":{"href":"https://api.github.com/repos/connexta/saml-conformance/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/connexta/saml-conformance/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/connexta/saml-conformance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/connexta/saml-conformance/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/connexta/saml-conformance/statuses/bdcb53789ba77af32286afd6c22bf316ff761b08"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"brjeter"}}