{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/43761205","id":43761205,"diff_hunk":"@@ -0,0 +1,62 @@\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 org.codice.ddf.security.idp.binding.post;\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.InputStreamReader;\n+\n+import org.apache.commons.codec.binary.Base64;\n+import org.apache.commons.lang.StringUtils;\n+import org.apache.cxf.staxutils.StaxUtils;\n+import org.apache.wss4j.common.ext.WSSecurityException;\n+import org.apache.wss4j.common.saml.OpenSAMLUtil;\n+import org.codice.ddf.security.idp.binding.api.RequestDecoder;\n+import org.opensaml.saml2.core.AuthnRequest;\n+import org.opensaml.xml.XMLObject;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.w3c.dom.Document;\n+\n+public class PostRequestDecoder implements RequestDecoder {\n+\n+    private static final Logger LOGGER = LoggerFactory.getLogger(PostRequestDecoder.class);\n+\n+    @Override\n+    public AuthnRequest decodeRequest(String samlRequest) {\n+        LOGGER.debug(\"Creating AuthnRequest object from SAMLRequest string.\");\n+        if (StringUtils.isEmpty(samlRequest)) {\n+            throw new IllegalArgumentException(\"Missing SAMLRequest on IdP request.\");\n+        }\n+        String decodedRequest = new String(Base64.decodeBase64(samlRequest));","path":"platform/security/idp/security-idp-server/src/main/java/org/codice/ddf/security/idp/binding/post/PostRequestDecoder.java","position":41,"original_position":41,"commit_id":"3285c9be4a6bc42d6ae6d02df415d178d133e837","original_commit_id":"3285c9be4a6bc42d6ae6d02df415d178d133e837","user":{"login":"coyotesqrl","id":1469860,"avatar_url":"https://avatars.githubusercontent.com/u/1469860?v=3","gravatar_id":"","url":"https://api.github.com/users/coyotesqrl","html_url":"https://github.com/coyotesqrl","followers_url":"https://api.github.com/users/coyotesqrl/followers","following_url":"https://api.github.com/users/coyotesqrl/following{/other_user}","gists_url":"https://api.github.com/users/coyotesqrl/gists{/gist_id}","starred_url":"https://api.github.com/users/coyotesqrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coyotesqrl/subscriptions","organizations_url":"https://api.github.com/users/coyotesqrl/orgs","repos_url":"https://api.github.com/users/coyotesqrl/repos","events_url":"https://api.github.com/users/coyotesqrl/events{/privacy}","received_events_url":"https://api.github.com/users/coyotesqrl/received_events","type":"User","site_admin":false},"body":"Is there a reason you couldn't use `RestSecurity.inflateBase64(samlRequest)` as in the `RedirectRequestDecoder`? That's the same behavior, right?","created_at":"2015-11-03T15:29:10Z","updated_at":"2015-11-03T15:29:10Z","html_url":"https://github.com/codice/ddf/pull/307#discussion_r43761205","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/307","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/43761205"},"html":{"href":"https://github.com/codice/ddf/pull/307#discussion_r43761205"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/307"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/307","id":49465920,"html_url":"https://github.com/codice/ddf/pull/307","diff_url":"https://github.com/codice/ddf/pull/307.diff","patch_url":"https://github.com/codice/ddf/pull/307.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/307","number":307,"state":"open","locked":false,"title":"DDF-1584 refactored idp/sp code and aded unit tests","user":{"login":"stustison","id":4391679,"avatar_url":"https://avatars.githubusercontent.com/u/4391679?v=3","gravatar_id":"","url":"https://api.github.com/users/stustison","html_url":"https://github.com/stustison","followers_url":"https://api.github.com/users/stustison/followers","following_url":"https://api.github.com/users/stustison/following{/other_user}","gists_url":"https://api.github.com/users/stustison/gists{/gist_id}","starred_url":"https://api.github.com/users/stustison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stustison/subscriptions","organizations_url":"https://api.github.com/users/stustison/orgs","repos_url":"https://api.github.com/users/stustison/repos","events_url":"https://api.github.com/users/stustison/events{/privacy}","received_events_url":"https://api.github.com/users/stustison/received_events","type":"User","site_admin":false},"body":"- added idp unit tests\r\n- moved refactored simplesign and systemcrypto objects up to security api\r\n- refactored idp code\r\n- fixed bug in pki handler with resolving credentials when HTTP response is null\r\n\r\n@pklinef @clockard @djblue @coyotesqrl @lessarderic\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/307)\n<!-- Reviewable:end -->\n","created_at":"2015-11-02T18:16:23Z","updated_at":"2015-11-03T15:29:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3109d728e4037e0a38b7a82e7cbfcad875221d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/307/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/307/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/307/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/3285c9be4a6bc42d6ae6d02df415d178d133e837","head":{"label":"stustison:ddf1584","ref":"ddf1584","sha":"3285c9be4a6bc42d6ae6d02df415d178d133e837","user":{"login":"stustison","id":4391679,"avatar_url":"https://avatars.githubusercontent.com/u/4391679?v=3","gravatar_id":"","url":"https://api.github.com/users/stustison","html_url":"https://github.com/stustison","followers_url":"https://api.github.com/users/stustison/followers","following_url":"https://api.github.com/users/stustison/following{/other_user}","gists_url":"https://api.github.com/users/stustison/gists{/gist_id}","starred_url":"https://api.github.com/users/stustison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stustison/subscriptions","organizations_url":"https://api.github.com/users/stustison/orgs","repos_url":"https://api.github.com/users/stustison/repos","events_url":"https://api.github.com/users/stustison/events{/privacy}","received_events_url":"https://api.github.com/users/stustison/received_events","type":"User","site_admin":false},"repo":{"id":34327919,"name":"ddf","full_name":"stustison/ddf","owner":{"login":"stustison","id":4391679,"avatar_url":"https://avatars.githubusercontent.com/u/4391679?v=3","gravatar_id":"","url":"https://api.github.com/users/stustison","html_url":"https://github.com/stustison","followers_url":"https://api.github.com/users/stustison/followers","following_url":"https://api.github.com/users/stustison/following{/other_user}","gists_url":"https://api.github.com/users/stustison/gists{/gist_id}","starred_url":"https://api.github.com/users/stustison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stustison/subscriptions","organizations_url":"https://api.github.com/users/stustison/orgs","repos_url":"https://api.github.com/users/stustison/repos","events_url":"https://api.github.com/users/stustison/events{/privacy}","received_events_url":"https://api.github.com/users/stustison/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stustison/ddf","description":"The Distributed Data Framework - Distribution, SDK, and Test","fork":true,"url":"https://api.github.com/repos/stustison/ddf","forks_url":"https://api.github.com/repos/stustison/ddf/forks","keys_url":"https://api.github.com/repos/stustison/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stustison/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stustison/ddf/teams","hooks_url":"https://api.github.com/repos/stustison/ddf/hooks","issue_events_url":"https://api.github.com/repos/stustison/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/stustison/ddf/events","assignees_url":"https://api.github.com/repos/stustison/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/stustison/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/stustison/ddf/tags","blobs_url":"https://api.github.com/repos/stustison/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stustison/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stustison/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/stustison/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stustison/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/stustison/ddf/languages","stargazers_url":"https://api.github.com/repos/stustison/ddf/stargazers","contributors_url":"https://api.github.com/repos/stustison/ddf/contributors","subscribers_url":"https://api.github.com/repos/stustison/ddf/subscribers","subscription_url":"https://api.github.com/repos/stustison/ddf/subscription","commits_url":"https://api.github.com/repos/stustison/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/stustison/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/stustison/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/stustison/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/stustison/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/stustison/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stustison/ddf/merges","archive_url":"https://api.github.com/repos/stustison/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stustison/ddf/downloads","issues_url":"https://api.github.com/repos/stustison/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/stustison/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/stustison/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/stustison/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stustison/ddf/labels{/name}","releases_url":"https://api.github.com/repos/stustison/ddf/releases{/id}","created_at":"2015-04-21T13:14:31Z","updated_at":"2015-04-21T13:14:32Z","pushed_at":"2015-11-02T19:39:27Z","git_url":"git://github.com/stustison/ddf.git","ssh_url":"git@github.com:stustison/ddf.git","clone_url":"https://github.com/stustison/ddf.git","svn_url":"https://github.com/stustison/ddf","homepage":"","size":121508,"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":"1e704c8af71b62922eec448c93e7f0c24ea477ae","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-02T22:19:02Z","pushed_at":"2015-11-03T15:03:38Z","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":141916,"stargazers_count":25,"watchers_count":25,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":60,"mirror_url":null,"open_issues_count":11,"forks":60,"open_issues":11,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/307"},"html":{"href":"https://github.com/codice/ddf/pull/307"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/307"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/307/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/307/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/307/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/3285c9be4a6bc42d6ae6d02df415d178d133e837"}}}}