aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-02-24 11:40:49 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-02-24 11:40:49 +0100
commitf1d374bb66f3b48f2a14a8d550c4125c04dde7a8 (patch)
tree77a553d94913500e7cd3344e3b478f5181ae17dd /id/ConfigWebTool/src/main/java/at
parent7ed61d2e509e73b2a91884f046bf98ba1993674c (diff)
downloadmoa-id-spss-f1d374bb66f3b48f2a14a8d550c4125c04dde7a8.tar.gz
moa-id-spss-f1d374bb66f3b48f2a14a8d550c4125c04dde7a8.tar.bz2
moa-id-spss-f1d374bb66f3b48f2a14a8d550c4125c04dde7a8.zip
* add default configuration values
* add MOA-ID-Auth publicURLPreFix as mandatory configuration value * remove ReloadConfiguration serlet * change moa-id-lib to use publicURLPreFix * update repository
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java2
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java61
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java2
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java23
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java20
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java39
6 files changed, 89 insertions, 58 deletions
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 692990fa9..0c4823f43 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
@@ -128,6 +128,8 @@ public class ConfigurationProvider {
UserRequestCleaner.start();
+ log.info("MOA-ID-Configuration initialization completed");
+
} catch (FileNotFoundException e) {
throw new ConfigurationException("config.01", e);
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 d81d03780..e16020782 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
@@ -70,7 +70,7 @@ public class GeneralMOAIDConfig {
private String szrgwURL = null;
private String alternativeSourceID = null;
private String certStoreDirectory = null;
- private boolean trustmanagerrevocationcheck = false;
+ private boolean trustmanagerrevocationcheck = true;
private String timeoutAssertion = String.valueOf(DEFAULTTIMEOUTASSERTION);
private String timeoutMOASessionCreated = String.valueOf(DEFAULTTIMEOUTMOASESSIONCREATED);
@@ -93,7 +93,6 @@ public class GeneralMOAIDConfig {
private String saml1SourceID = null;
- private String pvp2PublicUrlPrefix = null;
private String pvp2IssuerName = null;
private String pvp2OrgName = null;
private String pvp2OrgDisplayName = null;
@@ -107,7 +106,6 @@ public class GeneralMOAIDConfig {
private String ssoTarget = null;
private String ssoFriendlyName = null;
- private String ssoPublicUrl = null;
private String ssoSpecialText = null;
private String ssoIdentificationNumber = null;
@@ -124,6 +122,8 @@ public class GeneralMOAIDConfig {
private String SLRequestTemplateLocal = "";
private String SLRequestTemplateHandy = "";
+ private String publicURLPrefix = null;
+
public GeneralMOAIDConfig() {
chainigmodelist = new HashMap<String, String>();
ChainingModeType[] values = ChainingModeType.values();
@@ -159,6 +159,8 @@ public class GeneralMOAIDConfig {
certStoreDirectory = authgen.getCertStoreDirectory();
trustmanagerrevocationcheck = authgen.isTrustManagerRevocationChecking();
+ publicURLPrefix = authgen.getPublicURLPreFix();
+
TimeOuts timeouts = authgen.getTimeOuts();
if (timeouts != null) {
@@ -236,7 +238,10 @@ public class GeneralMOAIDConfig {
protocolActivePVP21 = pvp2.isIsActive();
- pvp2PublicUrlPrefix = pvp2.getPublicURLPrefix();
+ //INFO: only for backup
+ if (MiscUtil.isEmpty(publicURLPrefix))
+ publicURLPrefix = pvp2.getPublicURLPrefix();
+
pvp2IssuerName = pvp2.getIssuerName();
List<Contact> con = pvp2.getContact();
@@ -275,7 +280,10 @@ public class GeneralMOAIDConfig {
// if (idl != null)
// ssoIdentificationNumber = idl.getValue();
- ssoPublicUrl = sso.getPublicURL();
+ //INFO: only for backup
+ if (MiscUtil.isEmpty(publicURLPrefix))
+ publicURLPrefix = sso.getPublicURL();
+
ssoSpecialText = sso.getSpecialText();
if (MiscUtil.isNotEmpty(sso.getTarget()) &&
@@ -490,20 +498,6 @@ public class GeneralMOAIDConfig {
}
/**
- * @return the pvp2PublicUrlPrefix
- */
- public String getPvp2PublicUrlPrefix() {
- return pvp2PublicUrlPrefix;
- }
-
- /**
- * @param pvp2PublicUrlPrefix the pvp2PublicUrlPrefix to set
- */
- public void setPvp2PublicUrlPrefix(String pvp2PublicUrlPrefix) {
- this.pvp2PublicUrlPrefix = pvp2PublicUrlPrefix;
- }
-
- /**
* @return the pvp2IssuerName
*/
public String getPvp2IssuerName() {
@@ -644,20 +638,6 @@ public class GeneralMOAIDConfig {
}
/**
- * @return the ssoPublicUrl
- */
- public String getSsoPublicUrl() {
- return ssoPublicUrl;
- }
-
- /**
- * @param ssoPublicUrl the ssoPublicUrl to set
- */
- public void setSsoPublicUrl(String ssoPublicUrl) {
- this.ssoPublicUrl = ssoPublicUrl;
- }
-
- /**
* @return the ssoSpecialText
*/
public String getSsoSpecialText() {
@@ -929,6 +909,21 @@ public class GeneralMOAIDConfig {
public void setSaml1SourceID(String saml1SourceID) {
this.saml1SourceID = saml1SourceID;
}
+
+ /**
+ * @return the publicURLPrefix
+ */
+ public String getPublicURLPrefix() {
+ return publicURLPrefix;
+ }
+
+ /**
+ * @param publicURLPrefix the publicURLPrefix to set
+ */
+ public void setPublicURLPrefix(String publicURLPrefix) {
+ this.publicURLPrefix = publicURLPrefix;
+ }
+
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
index 079e6807e..ba58701fc 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
@@ -107,6 +107,8 @@ public class OAGeneralConfig {
keyBoxIdentifierList.put(values[i].value(), values[i].value());
}
+ keyBoxIdentifier = MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR.value();
+
bkuLocalURL = Constants.DEFAULT_LOCALBKU_URL;
bkuHandyURL = Constants.DEFAULT_HANDYBKU_URL;
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 67750e765..c9e834662 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
@@ -48,7 +48,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.Contact;
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.LegacyAllowed;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
@@ -226,9 +225,17 @@ public class EditGeneralConfigAction extends ActionSupport
dbauth.setGeneralConfiguration(dbauthgeneral);
}
- GeneralConfiguration oldauthgeneral = null;
- if (oldauth != null)
- oldauthgeneral = oldauth.getGeneralConfiguration();
+// GeneralConfiguration oldauthgeneral = null;
+// if (oldauth != null)
+// oldauthgeneral = oldauth.getGeneralConfiguration();
+
+ //set Public URL Prefix
+ String pubURLPrefix = moaconfig.getPublicURLPrefix();
+ if(pubURLPrefix.endsWith("/")) {
+ int length = pubURLPrefix.length();
+ pubURLPrefix = pubURLPrefix.substring(0, length-1);
+ }
+ dbauthgeneral.setPublicURLPreFix(pubURLPrefix);
// if (MiscUtil.isNotEmpty(moaconfig.getAlternativeSourceID()))
// dbauthgeneral.setAlternativeSourceID(moaconfig.getAlternativeSourceID());
@@ -314,8 +321,8 @@ public class EditGeneralConfigAction extends ActionSupport
if (MiscUtil.isNotEmpty(moaconfig.getPvp2IssuerName()))
pvp2.setIssuerName(moaconfig.getPvp2IssuerName());
- if (MiscUtil.isNotEmpty(moaconfig.getPvp2PublicUrlPrefix()))
- pvp2.setPublicURLPrefix(moaconfig.getPvp2PublicUrlPrefix());
+// if (MiscUtil.isNotEmpty(moaconfig.getPvp2PublicUrlPrefix()))
+// pvp2.setPublicURLPrefix(moaconfig.getPvp2PublicUrlPrefix());
Organization pvp2org = pvp2.getOrganization();
if (pvp2org == null) {
@@ -363,8 +370,8 @@ public class EditGeneralConfigAction extends ActionSupport
dbsso.setFriendlyName(moaconfig.getSsoFriendlyName());
if (MiscUtil.isNotEmpty(moaconfig.getSsoSpecialText()))
dbsso.setSpecialText(moaconfig.getSsoSpecialText());
- if (MiscUtil.isNotEmpty(moaconfig.getSsoPublicUrl()))
- dbsso.setPublicURL(moaconfig.getSsoPublicUrl());
+// if (MiscUtil.isNotEmpty(moaconfig.getSsoPublicUrl()))
+// dbsso.setPublicURL(moaconfig.getSsoPublicUrl());
if (MiscUtil.isNotEmpty(moaconfig.getSsoTarget())) {
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 b0e4804a8..a95d967bb 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
@@ -167,23 +167,37 @@ public class ValidationHelper {
}
-
public static boolean validateURL(String urlString) {
log.debug("Validate URL " + urlString);
- //if (urlString.startsWith("http") || urlString.startsWith("https")) {
+ if (urlString.startsWith("http") || urlString.startsWith("https")) {
try {
new URL(urlString);
return true;
} catch (MalformedURLException e) {
}
- //}
+ }
return false;
}
+// public static boolean validateGeneralURL(String urlString) {
+//
+// log.debug("Validate URL " + urlString);
+//
+// try {
+// new URL(urlString);
+// return true;
+//
+// } catch (MalformedURLException e) {
+//
+// }
+//
+// return false;
+// }
+
public static boolean isValidAdminTarget(String target) {
log.debug("Ueberpruefe Parameter Target");
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java
index 1c7da7079..fcf74a534 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java
@@ -62,6 +62,17 @@ public class MOAConfigValidator {
}
}
+ check = form.getPublicURLPrefix();
+ if (MiscUtil.isNotEmpty(check)) {
+ if (!ValidationHelper.validateURL(check)) {
+ log.info("Public URL Prefix is not valid");
+ errors.add(LanguageHelper.getErrorString("validation.general.publicURLprefix.valid"));
+ }
+ } else {
+ log.info("PublicURL Prefix is empty.");
+ errors.add(LanguageHelper.getErrorString("validation.general.publicURLprefix.empty"));
+ }
+
check = form.getTimeoutAssertion();
if (MiscUtil.isNotEmpty(check)) {
if (!ValidationHelper.validateNumber(check)) {
@@ -234,13 +245,13 @@ public class MOAConfigValidator {
}
}
- check = form.getPvp2PublicUrlPrefix();
- if (MiscUtil.isNotEmpty(check)) {
- if (!ValidationHelper.validateURL(check)) {
- log.info("PVP2 Service URL is not valid");
- errors.add(LanguageHelper.getErrorString("validation.general.protocol.pvp2.serviceurl.valid"));
- }
- }
+// check = form.getPvp2PublicUrlPrefix();
+// if (MiscUtil.isNotEmpty(check)) {
+// if (!ValidationHelper.validateURL(check)) {
+// log.info("PVP2 Service URL is not valid");
+// errors.add(LanguageHelper.getErrorString("validation.general.protocol.pvp2.serviceurl.valid"));
+// }
+// }
check = form.getSLRequestTemplateHandy();
if (MiscUtil.isEmpty(check)) {
@@ -293,13 +304,13 @@ public class MOAConfigValidator {
// }
// }
- check = form.getSsoPublicUrl();
- if (MiscUtil.isNotEmpty(check)) {
- if (!ValidationHelper.validateURL(check)) {
- log.info("SSO Public URL is not valid");
- errors.add(LanguageHelper.getErrorString("validation.general.sso.publicurl.valid"));
- }
- }
+// check = form.getSsoPublicUrl();
+// if (MiscUtil.isNotEmpty(check)) {
+// if (!ValidationHelper.validateURL(check)) {
+// log.info("SSO Public URL is not valid");
+// errors.add(LanguageHelper.getErrorString("validation.general.sso.publicurl.valid"));
+// }
+// }
check = form.getSsoSpecialText();
if (MiscUtil.isNotEmpty(check)) {