diff options
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
19 files changed, 57 insertions, 73 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/Authenticate.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/Authenticate.java index 8b775f692..8684b8cc1 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/Authenticate.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/Authenticate.java @@ -1,13 +1,8 @@ package at.gv.egovernment.moa.id.configuration.auth.pvp2; -import java.io.FileInputStream; import java.io.IOException; import java.security.KeyStore; -import java.security.PrivateKey; -import java.security.cert.Certificate; -import java.util.HashMap; import java.util.Map; -import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -41,14 +36,10 @@ import org.opensaml.saml2.metadata.EntityDescriptor; import org.opensaml.saml2.metadata.SingleSignOnService; import org.opensaml.saml2.metadata.impl.SingleSignOnServiceBuilder; import org.opensaml.saml2.metadata.provider.HTTPMetadataProvider; -import org.opensaml.security.MetadataCredentialResolver; -import org.opensaml.security.MetadataCredentialResolverFactory; import org.opensaml.ws.transport.http.HttpServletResponseAdapter; import org.opensaml.xml.XMLObject; import org.opensaml.xml.io.Marshaller; import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.security.credential.BasicCredential; -import org.opensaml.xml.security.credential.UsageType; import org.opensaml.xml.security.x509.KeyStoreX509CredentialAdapter; import org.opensaml.xml.security.x509.X509Credential; import org.opensaml.xml.signature.Signature; @@ -62,7 +53,6 @@ import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider; import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException; import at.gv.egovernment.moa.id.configuration.utils.SAML2Utils; import at.gv.egovernment.moa.util.MiscUtil; -import at.iaik.commons.util.ConfigException; /** diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java index 39d276701..13e13bcc7 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java @@ -7,7 +7,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.net.MalformedURLException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java index 59954df7f..6c2821e02 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java @@ -15,8 +15,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; -import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; -import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSignersX509SubjectNameItem; import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java index fdce518a7..7ee501aa5 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java @@ -2,7 +2,6 @@ package at.gv.egovernment.moa.id.configuration.data.oa; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.security.cert.CertificateException; import java.util.ArrayList; @@ -15,7 +14,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; -import at.gv.egovernment.moa.id.configuration.struts.action.EditOAAction; import at.gv.egovernment.moa.util.MiscUtil; public class OAPVP2Config { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java index 0c78f996c..12f53b210 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java @@ -1,7 +1,5 @@ package at.gv.egovernment.moa.id.configuration.exception; -import javax.mail.MessagingException; - import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; public class ConfigurationException extends Exception { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java index 3081f3929..86172777c 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java @@ -25,7 +25,6 @@ import org.apache.log4j.Logger; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.configuration.data.UserDatabaseFrom; import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException; import at.gv.egovernment.moa.util.MiscUtil; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java index bad522a4b..61ab3cecd 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java @@ -28,9 +28,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; -import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSignersX509SubjectNameItem; import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; -import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowedProtocolNameItem; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; @@ -45,7 +43,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; import at.gv.egovernment.moa.id.commons.db.dao.config.TrustAnchor; import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; -import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlockVerifyTransformsInfoProfileIDItem; import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.configuration.Constants; @@ -53,7 +50,6 @@ import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; import at.gv.egovernment.moa.id.configuration.data.GeneralMOAIDConfig; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.validation.moaconfig.MOAConfigValidator; -import at.gv.egovernment.moa.id.configuration.validation.moaconfig.PVP2ContactValidator; import at.gv.egovernment.moa.id.util.Random; import at.gv.egovernment.moa.util.MiscUtil; @@ -66,7 +62,6 @@ public class EditGeneralConfigAction extends ActionSupport private static final long serialVersionUID = 1L; private HttpServletRequest request; - private HttpServletResponse response; private AuthenticatedUser authUser; private GeneralMOAIDConfig moaconfig; @@ -508,8 +503,7 @@ public class EditGeneralConfigAction extends ActionSupport } public void setServletResponse(HttpServletResponse response) { - this.response = response; - +// this.response = response; } public void setServletRequest(HttpServletRequest request) { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java index 1676b014d..4a05f9dbd 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java @@ -11,7 +11,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java index d3d00186f..428cbbe6f 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java @@ -43,7 +43,7 @@ implements ServletRequestAware, ServletResponseAware { private static final long serialVersionUID = 1L; private HttpServletRequest request; - private HttpServletResponse response; +// private HttpServletResponse response; private AuthenticatedUser authUser; private String formID; @@ -433,7 +433,7 @@ implements ServletRequestAware, ServletResponseAware { } public void setServletResponse(HttpServletResponse response) { - this.response = response; +// this.response = response; } public void setServletRequest(HttpServletRequest request) { this.request = request; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java index f07022394..3bf213290 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java @@ -2,7 +2,10 @@ package at.gv.egovernment.moa.id.configuration.struts.action; import java.util.ArrayList; import java.util.Date; +import java.util.Enumeration; +import java.util.HashMap; import java.util.List; +import java.util.Map.Entry; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -75,7 +78,7 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, private static final Logger log = Logger.getLogger(IndexAction.class); private HttpServletRequest request; - private HttpServletResponse response; +// private HttpServletResponse response; private String password; private String username; @@ -177,7 +180,10 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, finally { ConfigurationDBUtils.closeSession(); } - request.getSession().setAttribute(Constants.SESSION_AUTH, authuser); + + HttpSession session = generateNewJSession(request); + session.setAttribute(Constants.SESSION_AUTH, authuser); + return Constants.STRUTS_SUCCESS; } } @@ -412,7 +418,9 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, finally { ConfigurationDBUtils.closeSession(); } - session.setAttribute(Constants.SESSION_AUTH, authUser); + + HttpSession newsession = generateNewJSession(request); + newsession.setAttribute(Constants.SESSION_AUTH, authUser); return Constants.STRUTS_SUCCESS; } @@ -700,8 +708,33 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, return Constants.STRUTS_SUCCESS; } + private HttpSession generateNewJSession(HttpServletRequest request) { + HttpSession session = request.getSession(false); + + if (session != null) { + + HashMap<String, Object> attributes = new HashMap<String,Object>(); + + Enumeration<String> enames = session.getAttributeNames(); + while (enames.hasMoreElements()) { + String name = enames.nextElement(); + if (!name.equals("JSESSIONID")) + attributes.put(name, session.getAttribute( name)); + } + session.invalidate(); + + session = request.getSession(true); + for (Entry<String,Object> et : attributes.entrySet()) + session.setAttribute( et.getKey(), et.getValue()); + + } else + session = request.getSession(true); + + return session; + } + public void setServletResponse(HttpServletResponse arg0) { - this.response = arg0; +// this.response = arg0; } public void setServletRequest(HttpServletRequest arg0) { this.request = arg0; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java index da3c99714..44711116e 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java @@ -16,11 +16,9 @@ import com.opensymphony.xwork2.ActionSupport; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplicationType; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; -import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider; import at.gv.egovernment.moa.id.configuration.data.OAListElement; import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException; import at.gv.egovernment.moa.id.configuration.helper.FormDataHelper; @@ -36,16 +34,16 @@ public class ListOAsAction extends ActionSupport implements ServletRequestAware, private static final long serialVersionUID = 1L; private HttpServletRequest request; - private HttpServletResponse response; - private ConfigurationProvider configuration; +// private HttpServletResponse response; +// private ConfigurationProvider configuration; private List<OAListElement> formOAs; private AuthenticatedUser authUser; private String friendlyname; public ListOAsAction() throws ConfigurationException { - configuration = ConfigurationProvider.getInstance(); +// configuration = ConfigurationProvider.getInstance(); } @@ -163,7 +161,7 @@ public class ListOAsAction extends ActionSupport implements ServletRequestAware, } public void setServletResponse(HttpServletResponse arg0) { - this.response = arg0; +// this.response = arg0; } public void setServletRequest(HttpServletRequest arg0) { this.request = arg0; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/MainAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/MainAction.java index c80d5484d..c4c9422ff 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/MainAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/MainAction.java @@ -10,7 +10,6 @@ import org.apache.struts2.interceptor.ServletResponseAware; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; -import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider; import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException; public class MainAction implements ServletRequestAware, @@ -19,16 +18,16 @@ public class MainAction implements ServletRequestAware, private static final Logger log = Logger.getLogger(MainAction.class); private HttpServletRequest request; - private HttpServletResponse response; - private ConfigurationProvider configuration; +// private HttpServletResponse response; +// private ConfigurationProvider configuration; private AuthenticatedUser authUser; public MainAction() throws ConfigurationException { - configuration = ConfigurationProvider.getInstance(); +// configuration = ConfigurationProvider.getInstance(); } @@ -50,7 +49,7 @@ public class MainAction implements ServletRequestAware, public void setServletResponse(HttpServletResponse arg0) { - this.response = arg0; +// this.response = arg0; } public void setServletRequest(HttpServletRequest arg0) { this.request = arg0; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/OpenAdminRequestsAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/OpenAdminRequestsAction.java index aa36d768a..64395bb49 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/OpenAdminRequestsAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/OpenAdminRequestsAction.java @@ -28,7 +28,7 @@ public class OpenAdminRequestsAction extends ActionSupport private static final long serialVersionUID = 1L; private HttpServletRequest request; - private HttpServletResponse response; +// private HttpServletResponse response; private AuthenticatedUser authUser = null; private List<OAListElement> formOAs = null; @@ -72,7 +72,7 @@ public class OpenAdminRequestsAction extends ActionSupport public void setServletResponse(HttpServletResponse response) { - this.response = response; +// this.response = response; } public void setServletRequest(HttpServletRequest request) { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java index 0e75b5b80..4ed3728e3 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java @@ -39,7 +39,7 @@ public class UserManagementAction extends ActionSupport private static final long serialVersionUID = 1L; private HttpServletRequest request; - private HttpServletResponse response; +// private HttpServletResponse response; private AuthenticatedUser authUser = null; @@ -526,7 +526,7 @@ public class UserManagementAction extends ActionSupport } public void setServletResponse(HttpServletResponse response) { - this.response = response; +// this.response = response; } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/utils/SAML2Utils.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/utils/SAML2Utils.java index ede8c09a8..5e5d47872 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/utils/SAML2Utils.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/utils/SAML2Utils.java @@ -11,16 +11,11 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import org.opensaml.Configuration; -import org.opensaml.DefaultBootstrap; -import org.opensaml.xml.ConfigurationException; import org.opensaml.xml.XMLObject; import org.opensaml.xml.XMLObjectBuilder; import org.opensaml.xml.XMLObjectBuilderFactory; import org.opensaml.xml.io.Marshaller; import org.opensaml.xml.io.MarshallingException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - public class SAML2Utils { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/TargetValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/TargetValidator.java index c30ee46b7..7769153ac 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/TargetValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/TargetValidator.java @@ -1,12 +1,10 @@ package at.gv.egovernment.moa.id.configuration.validation; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; import at.gv.egovernment.moa.util.MiscUtil; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java index 17da83286..40048cbf1 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java @@ -7,7 +7,6 @@ import iaik.x509.X509ExtensionInitException; import java.io.IOException; import java.net.MalformedURLException; -import java.net.Socket; import java.net.URL; import java.net.UnknownHostException; import java.security.cert.Certificate; @@ -15,22 +14,16 @@ import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import org.apache.log4j.Logger; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.util.Constants; - public class ValidationHelper { private static final Logger log = Logger.getLogger(ValidationHelper.class); @@ -141,7 +134,7 @@ public class ValidationHelper { log.debug("Validate Number " + value); try { - float num = Float.valueOf(value); + Float.valueOf(value); return true; @@ -159,7 +152,7 @@ public class ValidationHelper { if (urlString.startsWith("http") || urlString.startsWith("https")) { try { - URL url =new URL(urlString); + new URL(urlString); return true; } catch (MalformedURLException e) { @@ -311,7 +304,7 @@ public class ValidationHelper { try { if (param.startsWith("#") && param.length() <= 7) { - Long test = Long.decode(param); + Long.decode(param); return true; } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/PVP2ContactValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/PVP2ContactValidator.java index 6ab4f5292..725b9f295 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/PVP2ContactValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/PVP2ContactValidator.java @@ -6,7 +6,6 @@ import java.util.List; import org.apache.log4j.Logger; -import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java index e6ff0a166..bf84678cd 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java @@ -1,21 +1,15 @@ package at.gv.egovernment.moa.id.configuration.validation.oa; import java.io.IOException; -import java.net.URL; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; -import org.opensaml.saml2.metadata.provider.HTTPMetadataProvider; -import org.opensaml.saml2.metadata.provider.MetadataFilter; -import org.opensaml.saml2.metadata.provider.MetadataProviderException; -import org.opensaml.xml.parse.BasicParserPool; import at.gv.egovernment.moa.id.configuration.data.oa.OAPVP2Config; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper; -import at.gv.egovernment.moa.id.protocols.pvp2x.verification.MetadataSignatureFilter; import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.MiscUtil; @@ -28,7 +22,7 @@ public class OAPVP2ConfigValidation { List<String> errors = new ArrayList<String>(); try { byte[] metadata = null; - byte[] cert = null; +// byte[] cert = null; String check = form.getMetaDataURL(); if (MiscUtil.isNotEmpty(check)) { @@ -46,7 +40,7 @@ public class OAPVP2ConfigValidation { } if (form.getFileUpload() != null) - cert = form.getCertificate(); + form.getCertificate(); // else { // if (metadata != null) { |