Skip to content
This repository was archived by the owner on Aug 3, 2021. It is now read-only.
Open

5.3.4 #121

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Stub file that one can replace with Velocity template (and thus HTML) content
## to be placed into the BODY section of the response
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Stub file that one can replace with Velocity template (and thus HTML) content
## to be placed into the HEAD section of the response
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
##
## Velocity Template for SAML 1 HTTP-POST binding
##
## Velocity context may contain the following properties
## action - String - the action URL for the form
## binding - String - the SAML binding type in use
## TARGET - String - the relay state for the message
## SAMLResponse - String - the Base64 encoded SAML Response
##
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
#parse ( "/templates/add-html-head-content.vm" )
</head>

<body onload="document.forms[0].submit()">
<noscript>
<p>
<strong>Note:</strong> Since your browser does not support JavaScript,
you must press the Continue button once to proceed.
</p>
</noscript>

<form action="${action}" method="post">
<div>
#if($SAMLResponse)<input type="hidden" name="SAMLResponse" value="${SAMLResponse}"/>#end

#if($TARGET)<input type="hidden" name="TARGET" value="${TARGET}"/>#end

</div>
<noscript>
<div>
<input type="submit" value="Continue"/>
</div>
</noscript>
</form>

#parse ( "/templates/add-html-body-content.vm" )

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##
## Velocity Template for SAML 2 HTTP-POST binding
##
## Velocity context may contain the following properties
## action - String - the action URL for the form
## binding - String - the SAML binding type in use
## RelayState - String - the relay state for the message
## SAMLArt - String - SAML 2 artifact
##
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
#parse ( "/templates/add-html-head-content.vm" )
</head>
<body onload="document.forms[0].submit()">
<noscript>
<p>
<strong>Note:</strong> Since your browser does not support JavaScript,
you must press the Continue button once to proceed.
</p>
</noscript>

<form action="${action}" method="post">
<div>
#if($RelayState)
<input type="hidden" name="RelayState" value="${RelayState}"/>
#end

<input type="hidden" name="SAMLart" value="${SAMLArt}"/>
</div>
<noscript>
<div>
<input type="submit" value="Continue"/>
</div>
</noscript>
</form>
#parse ( "/templates/add-html-body-content.vm" )
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##
## Velocity Template for SAML 2 HTTP-POST binding
##
## Velocity context may contain the following properties
## action - String - the action URL for the form
## binding - String - the SAML binding type in use
## RelayState - String - the relay state for the message
## SAMLRequest - String - the Base64 encoded SAML Request
## SAMLResponse - String - the Base64 encoded SAML Response
##
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
#parse ( "/templates/add-html-head-content.vm" )
</head>
<body onload="document.forms[0].submit()">
<noscript>
<p>
<strong>Note:</strong> Since your browser does not support JavaScript,
you must press the Continue button once to proceed.
</p>
</noscript>

<form action="${action}" method="post">
<div>
#if($RelayState)<input type="hidden" name="RelayState" value="${RelayState}"/>#end

#if($SAMLRequest)<input type="hidden" name="SAMLRequest" value="${SAMLRequest}"/>#end

#if($SAMLResponse)<input type="hidden" name="SAMLResponse" value="${SAMLResponse}"/>#end

</div>
<noscript>
<div>
<input type="submit" value="Continue"/>
</div>
</noscript>
</form>
#parse ( "/templates/add-html-body-content.vm" )
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
##
## Velocity Template for SAML 2 HTTP-POST-SimpleSign binding
##
## Velocity context may contain the following properties
## action - String - the action URL for the form
## binding - String - the SAML binding type in use
## RelayState - String - the relay state for the message
## SAMLRequest - String - the Base64 encoded SAML Request
## SAMLResponse - String - the Base64 encoded SAML Response
## Signature - String - the Base64 encoded simple signature
## SigAlg - String - the signature algorithm URI
## KeyInfo - String - the Base64 encoded ds:KeyInfo (optional)
##
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
#parse ( "/templates/add-html-head-content.vm" )
</head>
<body onload="document.forms[0].submit()">
<noscript>
<p>
<strong>Note:</strong> Since your browser does not support JavaScript,
you must press the Continue button once to proceed.
</p>
</noscript>

<form action="${action}" method="post">
<div>
#if($RelayState)<input type="hidden" name="RelayState" value="${RelayState}"/>#end

#if($SAMLRequest)<input type="hidden" name="SAMLRequest" value="${SAMLRequest}"/>#end

#if($SAMLResponse)<input type="hidden" name="SAMLResponse" value="${SAMLResponse}"/>#end

#if($Signature)<input type="hidden" name="Signature" value="${Signature}"/>#end

#if($SigAlg)<input type="hidden" name="SigAlg" value="${SigAlg}"/>#end

#if($KeyInfo)<input type="hidden" name="KeyInfo" value="${KeyInfo}"/>#end

</div>
<noscript>
<div>
<input type="submit" value="Continue"/>
</div>
</noscript>
</form>
#parse ( "/templates/add-html-body-content.vm" )

</body>
</html>
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apply plugin: 'java'

repositories {
maven { url "http://repo.dotcms.com/artifactory/libs-release" }
}

dependencies {
compile('com.dotcms:dotcms:5.3.4.1') { transitive = true }
compile fileTree(dir: 'ROOT/dotserver/tomcat-8.5.32/webapps/ROOT/WEB-INF/lib', include: ['*.jar'])
}

sourceSets.main.java.srcDirs += ['src']

1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/beans/AttributesBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* @author jsanca
*/
// Migrated
public class AttributesBean implements Serializable
{
private static final long serialVersionUID = 1836313856887837731L;
Expand Down
1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/cache/SamlCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @version 4.3.2
* @since 03-27-2018
*/
// Not-need
public abstract class SamlCache implements Cachable
{
protected static final String DEFAULT = "default";
Expand Down
1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/cache/SamlCacheImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @version 4.3.2
* @since 03-27-2018
*/
// Not-need
public class SamlCacheImpl extends SamlCache
{
protected DotCacheAdministrator cache = null;
Expand Down
1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/config/CredentialHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.dotcms.plugin.saml.v3.parameters.DotsamlPropertyName;
import com.dotcms.plugin.saml.v3.util.InstanceUtil;

// Migrated
public class CredentialHelper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @author jsanca
*/
// Migrated
public interface CredentialProvider extends Serializable
{
/**
Expand All @@ -20,4 +21,3 @@ public interface CredentialProvider extends Serializable
*/
Credential createCredential();
}

1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/config/IdpConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Properties;
import java.util.stream.Collectors;

// TODO: partially migrated
public class IdpConfig
{
private String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Comparator;

// todo: not migrated yet
public class IdpConfigComparator implements Comparator<IdpConfig>
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;

// todo: not migrated
public class IdpConfigFileHelper implements Serializable
{
private static final long serialVersionUID = 2810853018482556705L;
Expand Down
6 changes: 3 additions & 3 deletions src/com/dotcms/plugin/saml/v3/config/IdpConfigHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import com.dotcms.plugin.saml.v3.cache.SamlCache;

import com.dotmarketing.business.CacheLocator;
import com.dotcms.plugin.saml.v3.cache.SamlCacheImpl;
import com.dotmarketing.exception.DotDataException;
import com.dotmarketing.util.Logger;
import com.dotmarketing.util.UUIDGenerator;
import com.dotmarketing.util.UtilMethods;
import com.dotmarketing.util.json.JSONException;
Expand All @@ -17,6 +16,7 @@
import java.util.List;
import java.util.Map;

// todo: partially migrated
public class IdpConfigHelper extends IdpConfigFileHelper implements Serializable
{
private static class SingletonHolder
Expand All @@ -31,7 +31,7 @@ public static IdpConfigHelper getInstance()
return IdpConfigHelper.SingletonHolder.INSTANCE;
}

private SamlCache samlCache = CacheLocator.getSamlCache();
private SamlCache samlCache = new SamlCacheImpl();

public IdpConfigHelper()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.List;
import java.util.Map;

// todo: not migrated
public class IdpConfigWriterReader
{
public static final String IDP_CONFIGS = "samlConfigs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Iterator;
import java.util.Properties;

// todo: not migrated
public class IdpJsonTransformer
{
private static String getCanonicalPathIfExists( File file ) throws IOException
Expand Down
1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/config/MetaDataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @version 4.3.2
* @since 03-31-2018
*/
// todo: not migrated yet
public class MetaDataHelper {
/**
* Gets the metadata, null if it can not be created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* @version 4.3.2
* @since 03-31-2018
*/
// todo; not migrated
public class OptionalPropertiesHelper
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @author jsanca
*/
// todo: not migrated yet
public class SamlSiteValidator
{
public static boolean checkBuildRoles( final String buildRolesProperty )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Iterator;
import java.util.Map;

// todo: not migrated
public class SiteJsonTransformer
{
public static JSONObject getJsonObjecFromtMap( Map<String, String> map ) throws JSONException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Runtime exception used to handle errors when attributes might not be
* extracted from the Assertion object Created by nollymar on 3/15/17.
*/
// migrated
public class AttributesNotFoundException extends RuntimeException
{
private static final long serialVersionUID = 4345557895408407837L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*
* @author jsanca
*/
// migrated
public class DotSamlException extends RuntimeException
{
private static final long serialVersionUID = -3569526825729783600L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.servlet.http.HttpServletResponse;

// migrated
public class NotNullEmailAllowedException extends AttributesNotFoundException
{
private static final long serialVersionUID = -3622432364873488814L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @author jsanca
*/
// migrated
public class SamlUnauthorizedException extends DotSamlException
{
private static final long serialVersionUID = 2827175662161844965L;
Expand Down
1 change: 1 addition & 0 deletions src/com/dotcms/plugin/saml/v3/filter/AutoLoginResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.servlet.http.HttpSession;

// todo: migrated
public class AutoLoginResult
{
private final HttpSession session;
Expand Down
Loading