{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/44538125","id":44538125,"diff_hunk":"@@ -0,0 +1,261 @@\n+/**\n+ * Copyright (c) Codice Foundation\n+ * <p/>\n+ * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser\n+ * General Public License as published by the Free Software Foundation, either version 3 of the\n+ * License, or any later version.\n+ * <p/>\n+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\n+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ * Lesser General Public License for more details. A copy of the GNU Lesser General Public License\n+ * is distributed along with this program and can be found at\n+ * <http://www.gnu.org/licenses/lgpl.html>.\n+ */\n+package ddf.catalog.test;\n+\n+import static org.hamcrest.MatcherAssert.assertThat;\n+import static org.hamcrest.Matchers.anyOf;\n+import static org.hamcrest.Matchers.containsString;\n+import static org.hamcrest.Matchers.greaterThan;\n+import static org.hamcrest.Matchers.is;\n+import static org.hamcrest.Matchers.isEmptyOrNullString;\n+import static org.hamcrest.Matchers.lessThanOrEqualTo;\n+import static org.hamcrest.Matchers.notNullValue;\n+import static org.hamcrest.core.AllOf.allOf;\n+import static org.hamcrest.core.CombinableMatcher.both;\n+import static org.mockito.AdditionalMatchers.not;\n+import static com.jayway.restassured.RestAssured.get;\n+import static com.jayway.restassured.RestAssured.given;\n+\n+import java.io.StringReader;\n+import java.net.URI;\n+import java.net.URL;\n+import java.util.Dictionary;\n+import java.util.HashMap;\n+import java.util.Hashtable;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+import javax.xml.XMLConstants;\n+import javax.xml.transform.stream.StreamSource;\n+import javax.xml.validation.Schema;\n+import javax.xml.validation.SchemaFactory;\n+import javax.xml.validation.Validator;\n+\n+import org.apache.http.NameValuePair;\n+import org.apache.http.client.utils.URLEncodedUtils;\n+import org.codice.ddf.security.common.jaxrs.RestSecurity;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.ops4j.pax.exam.junit.PaxExam;\n+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;\n+import org.ops4j.pax.exam.spi.reactors.PerClass;\n+import org.osgi.service.cm.Configuration;\n+\n+import com.jayway.restassured.response.Response;\n+\n+import ddf.common.test.BeforeExam;\n+\n+@RunWith(PaxExam.class)\n+@ExamReactorStrategy(PerClass.class)\n+public class TestSingleSignOn extends AbstractIntegrationTest {\n+\n+    public static final String IDP_AUTH_TYPES = \"/=SAML|ANON,/search=SAML|IDP,/solr=SAML|PKI|basic\";\n+\n+    private static final DynamicUrl SEARCH_URL = new DynamicUrl(DynamicUrl.SECURE_ROOT, HTTPS_PORT,\n+            \"/search\");\n+\n+    private static final DynamicUrl WHO_AM_I_URL = new DynamicUrl(SERVICE_ROOT, \"/whoami\");\n+\n+    @BeforeExam\n+    public void beforeTest() throws Exception {\n+        basePort = getBasePort();\n+        getAdminConfig().setLogLevels();\n+        getSecurityPolicy().configureWebContextPolicy(null, IDP_AUTH_TYPES, null, null);\n+        getServiceManager().waitForAllBundles();\n+        getServiceManager().waitForHttpEndpoint(SERVICE_ROOT + \"/catalog/query\");\n+        getServiceManager().waitForHttpEndpoint(WHO_AM_I_URL.getUrl());\n+\n+        // Start the services needed for testing. We need to start the Search UI to test that it redirects properly\n+        getServiceManager().startFeature(true, \"security-idp\", \"search-ui-app\");\n+\n+        // Create a validator from the metadata schema so that we can validate the metadata\n+        // TODO: Maybe don't go out to the internet for this? The schema itself is going to go out to the internet anyway though.\n+        URL schemaFile = new URL(\n+                \"http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd\");","path":"distribution/test/itests/test-itests-catalog/src/test/java/ddf/catalog/test/TestSingleSignOn.java","position":87,"original_position":87,"commit_id":"8ee564046013232f4860432d91ac49715c047a2d","original_commit_id":"ecb640d59109f56eb8e9b2ca3fcff15acbcb5afa","user":{"login":"tbatie","id":9013620,"avatar_url":"https://avatars.githubusercontent.com/u/9013620?v=3","gravatar_id":"","url":"https://api.github.com/users/tbatie","html_url":"https://github.com/tbatie","followers_url":"https://api.github.com/users/tbatie/followers","following_url":"https://api.github.com/users/tbatie/following{/other_user}","gists_url":"https://api.github.com/users/tbatie/gists{/gist_id}","starred_url":"https://api.github.com/users/tbatie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbatie/subscriptions","organizations_url":"https://api.github.com/users/tbatie/orgs","repos_url":"https://api.github.com/users/tbatie/repos","events_url":"https://api.github.com/users/tbatie/events{/privacy}","received_events_url":"https://api.github.com/users/tbatie/received_events","type":"User","site_admin":false},"body":"I believe so","created_at":"2015-11-11T14:38:52Z","updated_at":"2015-11-11T14:38:52Z","html_url":"https://github.com/codice/ddf/pull/326#discussion_r44538125","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/326","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/44538125"},"html":{"href":"https://github.com/codice/ddf/pull/326#discussion_r44538125"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/326"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/326","id":50307379,"html_url":"https://github.com/codice/ddf/pull/326","diff_url":"https://github.com/codice/ddf/pull/326.diff","patch_url":"https://github.com/codice/ddf/pull/326.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/326","number":326,"state":"open","locked":false,"title":"DDF 1609 integration tests for IdP server and client","user":{"login":"spearskw","id":9749143,"avatar_url":"https://avatars.githubusercontent.com/u/9749143?v=3","gravatar_id":"","url":"https://api.github.com/users/spearskw","html_url":"https://github.com/spearskw","followers_url":"https://api.github.com/users/spearskw/followers","following_url":"https://api.github.com/users/spearskw/following{/other_user}","gists_url":"https://api.github.com/users/spearskw/gists{/gist_id}","starred_url":"https://api.github.com/users/spearskw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearskw/subscriptions","organizations_url":"https://api.github.com/users/spearskw/orgs","repos_url":"https://api.github.com/users/spearskw/repos","events_url":"https://api.github.com/users/spearskw/events{/privacy}","received_events_url":"https://api.github.com/users/spearskw/received_events","type":"User","site_admin":false},"body":"@ahoffer @brendan-hofmann @AzGoalie @pklinef @stustison\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/codice/ddf/326)\n<!-- Reviewable:end -->\n","created_at":"2015-11-10T20:35:51Z","updated_at":"2015-11-11T14:38:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2954b38a06b88b15598e094ee41fe8c3af1af149","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/326/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/326/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/326/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/8ee564046013232f4860432d91ac49715c047a2d","head":{"label":"spearskw:DDF-1609-Integration-tests-for-IdP-Server","ref":"DDF-1609-Integration-tests-for-IdP-Server","sha":"8ee564046013232f4860432d91ac49715c047a2d","user":{"login":"spearskw","id":9749143,"avatar_url":"https://avatars.githubusercontent.com/u/9749143?v=3","gravatar_id":"","url":"https://api.github.com/users/spearskw","html_url":"https://github.com/spearskw","followers_url":"https://api.github.com/users/spearskw/followers","following_url":"https://api.github.com/users/spearskw/following{/other_user}","gists_url":"https://api.github.com/users/spearskw/gists{/gist_id}","starred_url":"https://api.github.com/users/spearskw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearskw/subscriptions","organizations_url":"https://api.github.com/users/spearskw/orgs","repos_url":"https://api.github.com/users/spearskw/repos","events_url":"https://api.github.com/users/spearskw/events{/privacy}","received_events_url":"https://api.github.com/users/spearskw/received_events","type":"User","site_admin":false},"repo":{"id":44399285,"name":"ddf","full_name":"spearskw/ddf","owner":{"login":"spearskw","id":9749143,"avatar_url":"https://avatars.githubusercontent.com/u/9749143?v=3","gravatar_id":"","url":"https://api.github.com/users/spearskw","html_url":"https://github.com/spearskw","followers_url":"https://api.github.com/users/spearskw/followers","following_url":"https://api.github.com/users/spearskw/following{/other_user}","gists_url":"https://api.github.com/users/spearskw/gists{/gist_id}","starred_url":"https://api.github.com/users/spearskw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spearskw/subscriptions","organizations_url":"https://api.github.com/users/spearskw/orgs","repos_url":"https://api.github.com/users/spearskw/repos","events_url":"https://api.github.com/users/spearskw/events{/privacy}","received_events_url":"https://api.github.com/users/spearskw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spearskw/ddf","description":"The Distributed Data Framework - Distribution, SDK, and Test","fork":true,"url":"https://api.github.com/repos/spearskw/ddf","forks_url":"https://api.github.com/repos/spearskw/ddf/forks","keys_url":"https://api.github.com/repos/spearskw/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spearskw/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spearskw/ddf/teams","hooks_url":"https://api.github.com/repos/spearskw/ddf/hooks","issue_events_url":"https://api.github.com/repos/spearskw/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/spearskw/ddf/events","assignees_url":"https://api.github.com/repos/spearskw/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/spearskw/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/spearskw/ddf/tags","blobs_url":"https://api.github.com/repos/spearskw/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spearskw/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spearskw/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/spearskw/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spearskw/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/spearskw/ddf/languages","stargazers_url":"https://api.github.com/repos/spearskw/ddf/stargazers","contributors_url":"https://api.github.com/repos/spearskw/ddf/contributors","subscribers_url":"https://api.github.com/repos/spearskw/ddf/subscribers","subscription_url":"https://api.github.com/repos/spearskw/ddf/subscription","commits_url":"https://api.github.com/repos/spearskw/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/spearskw/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/spearskw/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/spearskw/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/spearskw/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/spearskw/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spearskw/ddf/merges","archive_url":"https://api.github.com/repos/spearskw/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spearskw/ddf/downloads","issues_url":"https://api.github.com/repos/spearskw/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/spearskw/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/spearskw/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/spearskw/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spearskw/ddf/labels{/name}","releases_url":"https://api.github.com/repos/spearskw/ddf/releases{/id}","created_at":"2015-10-16T17:05:29Z","updated_at":"2015-10-16T17:05:44Z","pushed_at":"2015-11-10T22:01:09Z","git_url":"git://github.com/spearskw/ddf.git","ssh_url":"git@github.com:spearskw/ddf.git","clone_url":"https://github.com/spearskw/ddf.git","svn_url":"https://github.com/spearskw/ddf","homepage":"","size":122150,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"codice:master","ref":"master","sha":"46616d6a93bd1c4a226fd3a96601512585a119e5","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":15173563,"name":"ddf","full_name":"codice/ddf","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/ddf","description":"The Distributed Data Framework - Distribution, SDK, and Test","fork":false,"url":"https://api.github.com/repos/codice/ddf","forks_url":"https://api.github.com/repos/codice/ddf/forks","keys_url":"https://api.github.com/repos/codice/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/ddf/teams","hooks_url":"https://api.github.com/repos/codice/ddf/hooks","issue_events_url":"https://api.github.com/repos/codice/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/codice/ddf/events","assignees_url":"https://api.github.com/repos/codice/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/codice/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/codice/ddf/tags","blobs_url":"https://api.github.com/repos/codice/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/ddf/languages","stargazers_url":"https://api.github.com/repos/codice/ddf/stargazers","contributors_url":"https://api.github.com/repos/codice/ddf/contributors","subscribers_url":"https://api.github.com/repos/codice/ddf/subscribers","subscription_url":"https://api.github.com/repos/codice/ddf/subscription","commits_url":"https://api.github.com/repos/codice/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/codice/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/ddf/merges","archive_url":"https://api.github.com/repos/codice/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/ddf/downloads","issues_url":"https://api.github.com/repos/codice/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/codice/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/ddf/labels{/name}","releases_url":"https://api.github.com/repos/codice/ddf/releases{/id}","created_at":"2013-12-13T20:38:28Z","updated_at":"2015-11-11T00:19:30Z","pushed_at":"2015-11-10T23:42:51Z","git_url":"git://github.com/codice/ddf.git","ssh_url":"git@github.com:codice/ddf.git","clone_url":"https://github.com/codice/ddf.git","svn_url":"https://github.com/codice/ddf","homepage":"","size":140605,"stargazers_count":24,"watchers_count":24,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":61,"mirror_url":null,"open_issues_count":13,"forks":61,"open_issues":13,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/326"},"html":{"href":"https://github.com/codice/ddf/pull/326"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/326"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/326/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/326/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/326/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/8ee564046013232f4860432d91ac49715c047a2d"}}}}