diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-06-13 11:32:31 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-06-13 11:32:31 +0200 |
commit | e7842b994f4dd5d4e8ad88a4db8ddf23707714cf (patch) | |
tree | 893d9a526d86d85607a47019930a10bc54256a81 /id/ConfigWebTool/src/main/java/at/gv | |
parent | c63432f4e29244a0550221dcb982e7696538a471 (diff) | |
download | moa-id-spss-e7842b994f4dd5d4e8ad88a4db8ddf23707714cf.tar.gz moa-id-spss-e7842b994f4dd5d4e8ad88a4db8ddf23707714cf.tar.bz2 moa-id-spss-e7842b994f4dd5d4e8ad88a4db8ddf23707714cf.zip |
add new test credential support to web config gui
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
2 files changed, 78 insertions, 2 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java index cb60a21a0..0e65b7dca 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java @@ -30,17 +30,16 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; 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.AuthComponentOA; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector; import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates; -import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; +import at.gv.egovernment.moa.id.commons.db.dao.config.TestCredentials; import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; @@ -70,6 +69,9 @@ public class OAAuthenticationData implements IOnlineApplicationData { private Map<String, byte[]> transformations; + private boolean enableTestCredentials = false; + private List<String> testCredentialOIDs = null; + /** * */ @@ -204,6 +206,12 @@ public class OAAuthenticationData implements IOnlineApplicationData { } } + if (oaauth.getTestCredentials() != null) { + enableTestCredentials = oaauth.getTestCredentials().isEnableTestCredentials(); + testCredentialOIDs = oaauth.getTestCredentials().getCredentialOID(); + + } + return null; } @@ -305,6 +313,16 @@ public class OAAuthenticationData implements IOnlineApplicationData { } + if (enableTestCredentials) { + TestCredentials testing = authoa.getTestCredentials(); + if (testing == null) + testing = new TestCredentials(); + + testing.setEnableTestCredentials(enableTestCredentials); + testing.setCredentialOID(testCredentialOIDs); + + } + return null; } @@ -538,5 +556,51 @@ public class OAAuthenticationData implements IOnlineApplicationData { SLTemplates = new ArrayList<String>(); SLTemplates.add(sLTemplateURL3); } + + /** + * @return the enableTestCredentials + */ + public boolean isEnableTestCredentials() { + return enableTestCredentials; + } + + /** + * @param enableTestCredentials the enableTestCredentials to set + */ + public void setEnableTestCredentials(boolean enableTestCredentials) { + this.enableTestCredentials = enableTestCredentials; + } + + /** + * @return the testCredentialOIDs + */ + public String getTestCredentialOIDs() { + String value = null; + for (String el : testCredentialOIDs) { + if (value == null) + value = el; + else + value += "," + el; + + } + + return value; + } + + public List<String> getTestCredialOIDList() { + return this.testCredentialOIDs; + } + + /** + * @param testCredentialOIDs the testCredentialOIDs to set + */ + public void setTestCredentialOIDs(String testCredentialOIDs) { + String[] oidList = testCredentialOIDs.split(","); + + this.testCredentialOIDs = new ArrayList<String>(); + for (int i=0; i<oidList.length; i++) + this.testCredentialOIDs.add(oidList[i].trim()); + } + } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java index 0bbf2116d..fd40bd447 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java @@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.commons.validation.ValidationHelper; import at.gv.egovernment.moa.id.configuration.data.oa.OAAuthenticationData; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; @@ -145,6 +146,17 @@ public class OAAuthenticationDataValidation { new Object[] {ValidationHelper.getPotentialCSSCharacter(true)}, request )); } } + + if (form.isEnableTestCredentials()) { + for (String el : form.getTestCredialOIDList()) { + if (!el.startsWith(MOAIDAuthConstants.TESTCREDENTIALROOTOID)) + log.warn("Test credential OID does not start with test credential root OID"); + errors.add(LanguageHelper.getErrorString("validation.general.testcredentials.oid.valid", + new Object[] {el}, request )); + } + + + } return errors; } |