diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-04-01 17:24:53 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-04-01 17:24:53 +0200 |
commit | c972a8106bbff5dea9fecc76864be9a99a868d78 (patch) | |
tree | 6c9cfca3a7cd002d5fe6e4bbaf884b877ecaf5bf /eaaf_core_api | |
parent | f4a941a0c4bbe6251a108612a4ee49607d6951fc (diff) | |
parent | 5945c62128c2cb9d552ad7b4c085c09d046d2d56 (diff) | |
download | EAAF-Components-c972a8106bbff5dea9fecc76864be9a99a868d78.tar.gz EAAF-Components-c972a8106bbff5dea9fecc76864be9a99a868d78.tar.bz2 EAAF-Components-c972a8106bbff5dea9fecc76864be9a99a868d78.zip |
Merge branch 'nightlyBuild'
Diffstat (limited to 'eaaf_core_api')
12 files changed, 79 insertions, 27 deletions
diff --git a/eaaf_core_api/pom.xml b/eaaf_core_api/pom.xml index fd23f1c8..5da7ad89 100644 --- a/eaaf_core_api/pom.xml +++ b/eaaf_core_api/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>at.gv.egiz</groupId> <artifactId>eaaf</artifactId> - <version>1.1.0</version> + <version>1.1.1</version> </parent> <groupId>at.gv.egiz.eaaf</groupId> <artifactId>eaaf_core_api</artifactId> diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequest.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequest.java index 99541cd6..384446b8 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequest.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/IRequest.java @@ -87,9 +87,10 @@ public interface IRequest extends Serializable { * * @param key The specific identifier of the request-data object * @param clazz The class type which is stored with this key + * @param <T> Response class type * @return The request-data object or null if no data is found with this key */ - <T> T getRawData(String key, final Class<T> clazz); + <T> T getRawData(String key, Class<T> clazz); /** * Store a generic data-object into pending request with a specific identifier. @@ -115,6 +116,7 @@ public interface IRequest extends Serializable { * Wrap the internal dataStorage map into a DAO. * * @param wrapper DOA to access SessionData + * @param <T> Response class type * @return */ @Nonnull @@ -241,9 +243,11 @@ public interface IRequest extends Serializable { /** * Get get Service-Provider configuration which is associated with this request. * + * @param decorator Interface of the Service-Provider information DAO + * @param <T> Response class type * @return Service-Provider configuration as object */ - <T> T getServiceProviderConfiguration(final Class<T> decorator); + <T> T getServiceProviderConfiguration(Class<T> decorator); /** * Indicates, if this pending-request is aborted by the user. diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/EaafConstants.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/EaafConstants.java index 4bd5bc39..57375e01 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/EaafConstants.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/EaafConstants.java @@ -19,6 +19,10 @@ package at.gv.egiz.eaaf.core.api.data; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + public class EaafConstants { public static final String CONTENTTYPE_HTML_UTF8 = "text/html; charset=UTF-8"; @@ -51,6 +55,34 @@ public class EaafConstants { public static final String URN_PREFIX_EIDAS = URN_PREFIX_WITH_COLON + URN_PART_EIDAS; public static final String URN_PREFIX_OW_BPK = URN_PREFIX_CDID + "OW"; + public static final String URN_PREFIX_WBPK_TARGET_WITH_X = EaafConstants.URN_PREFIX_WBPK + "X"; + private static final String WBPK_TARGET_FN = "FN"; + private static final String WBPK_TARGET_ZVR = "ZVR"; + private static final String WBPK_TARGET_ERSB = "ERSB"; + + private static final String URN_PREFIX_WBPK_TARGET_XFN_TARGET = + EaafConstants.URN_PREFIX_WBPK_TARGET_WITH_X + WBPK_TARGET_FN; + private static final String URN_PREFIX_WBPK_TARGET_XZVR_TARGET = + EaafConstants.URN_PREFIX_WBPK_TARGET_WITH_X + WBPK_TARGET_ZVR; + private static final String URN_PREFIX_WBPK_TARGET_XERSB_TARGET = + EaafConstants.URN_PREFIX_WBPK_TARGET_WITH_X + WBPK_TARGET_ERSB; + + private static final String URN_PREFIX_WBPK_TARGET_FN_TARGET = EaafConstants.URN_PREFIX_WBPK + WBPK_TARGET_FN; + private static final String URN_PREFIX_WBPK_TARGET_ZVR_TARGET = EaafConstants.URN_PREFIX_WBPK + WBPK_TARGET_ZVR; + private static final String URN_PREFIX_WBPK_TARGET_ERSB_TARGET = EaafConstants.URN_PREFIX_WBPK + WBPK_TARGET_ERSB; + + public static final Map<String, String> URN_WBPK_TARGET_X_TO_NONE_MAPPER; + + static { + final Map<String, String> intMap = new LinkedHashMap<>(); + intMap.put(URN_PREFIX_WBPK_TARGET_XFN_TARGET, URN_PREFIX_WBPK_TARGET_FN_TARGET); + intMap.put(URN_PREFIX_WBPK_TARGET_XZVR_TARGET, URN_PREFIX_WBPK_TARGET_ZVR_TARGET); + intMap.put(URN_PREFIX_WBPK_TARGET_XERSB_TARGET, URN_PREFIX_WBPK_TARGET_ERSB_TARGET); + URN_WBPK_TARGET_X_TO_NONE_MAPPER = Collections.unmodifiableMap(intMap); + + } + + // Authentication process data_constants public static final String UNIQUESESSIONIDENTIFIER = "eaaf_uniqueSessionIdentifier"; public static final String AUTH_DATA_CREATED = "eaaf_authdata_created"; diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java index b6f602d2..727c360c 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java @@ -49,4 +49,7 @@ public interface ExtendedPvpAttributeDefinitions extends PvpAttributeDefinitions String EID_MIS_MANDATE_NAME = "urn:eidgvat:attributes.mis.mandate"; String EID_MIS_MANDATE_FRIENDLY_NAME = "mandate"; + String EID_MIS_MANDATE_IDENTIFIER_NAME = "urn:eidgvat:attributes.mis.mandate.id"; + String EID_MIS_MANDATE_IDENTIFIER_FRIENDLY_NAME = "mandate-identifier"; + } diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PvpAttributeDefinitions.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PvpAttributeDefinitions.java index 2a9a8317..793715f1 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PvpAttributeDefinitions.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/PvpAttributeDefinitions.java @@ -137,7 +137,7 @@ public interface PvpAttributeDefinitions { IDENTITY("http://eid.gv.at/eID/status/identity"), TESTIDENTITY("http://eid.gv.at/eID/status/testidentity"), SYSTEM("http://eid.gv.at/eID/status/system"); - private String uri; + private final String uri; EidIdentityStatusLevelValues(final String uri) { this.uri = uri; @@ -311,11 +311,6 @@ public interface PvpAttributeDefinitions { String MANDATE_REFERENCE_VALUE_FRIENDLY_NAME = "MANDATE-REFERENCE-VALUE"; int MANDATE_REFERENCE_VALUE_MAX_LENGTH = 100; - String MANDATE_IDENTIFIER_OID = "1.2.40.0.10.2.1.1.261.91"; - String MANDATE_IDENTIFIER_FRIENDLY_NAME = "MANDATE-IDENTIFIER"; - String MANDATE_IDENTIFIER_NAME = URN_OID_PREFIX + MANDATE_IDENTIFIER_OID; - int MANDATE_IDENTIFIER_MAX_LENGTH = 256; - @Deprecated String MANDATE_FULL_MANDATE_OID = "1.2.40.0.10.2.1.1.261.92"; @Deprecated diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeBuilder.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeBuilder.java index 9c451282..c490bd9c 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeBuilder.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeBuilder.java @@ -24,8 +24,8 @@ import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException; public interface IAttributeBuilder { String getName(); - <ATT> ATT build(final ISpConfiguration oaParam, final IAuthData authData, final IAttributeGenerator<ATT> g) + <ATT> ATT build(ISpConfiguration oaParam, IAuthData authData, IAttributeGenerator<ATT> g) throws AttributeBuilderException; - <ATT> ATT buildEmpty(final IAttributeGenerator<ATT> g); + <ATT> ATT buildEmpty(IAttributeGenerator<ATT> g); } diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeGenerator.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeGenerator.java index 072f76e6..9f3e35cc 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeGenerator.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAttributeGenerator.java @@ -28,11 +28,11 @@ public interface IAttributeGenerator<ATT> { * @param value value * @return */ - ATT buildStringAttribute(final String friendlyName, final String name, final String value); + ATT buildStringAttribute(String friendlyName, String name, String value); - ATT buildIntegerAttribute(final String friendlyName, final String name, final int value); + ATT buildIntegerAttribute(String friendlyName, String name, int value); - ATT buildLongAttribute(final String friendlyName, final String name, final long value); + ATT buildLongAttribute(String friendlyName, String name, long value); - ATT buildEmptyAttribute(final String friendlyName, final String name); + ATT buildEmptyAttribute(String friendlyName, String name); } diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAuthData.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAuthData.java index ca946496..62aa8852 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAuthData.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IAuthData.java @@ -166,9 +166,10 @@ public interface IAuthData { * * @param key Identifier for the generic data * @param clazz Type of the generic data + * @param <T> Response class type * @return return the generic data of specific type, otherwise null */ - <T> T getGenericData(String key, final Class<T> clazz); + <T> T getGenericData(String key, Class<T> clazz); /** * Get bPK of the user. diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java index b9ba9869..a4914f16 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfiguration.java @@ -29,7 +29,7 @@ public interface IConfiguration { * @param key configuration key * @return configuration value or null if it is not found */ - String getBasicConfiguration(final String key); + String getBasicConfiguration(String key); /** * Get a configuration value from file based configuration. @@ -38,7 +38,7 @@ public interface IConfiguration { * @param defaultValue Default value if no value with this key is found * @return configuration value */ - String getBasicConfiguration(final String key, final String defaultValue); + String getBasicConfiguration(String key, String defaultValue); /** * Get a configuration value from file based configuration. @@ -47,7 +47,7 @@ public interface IConfiguration { * @return configuration value as {@link Boolean} or <code>false</code> if key * does not exist */ - boolean getBasicConfigurationBoolean(final String key); + boolean getBasicConfigurationBoolean(String key); /** * Get a configuration value from file based configuration. @@ -57,7 +57,7 @@ public interface IConfiguration { * @return configuration value as {@link Boolean} or <code>defaultValue</code> * if key does not exist */ - boolean getBasicConfigurationBoolean(final String key, final boolean defaultValue); + boolean getBasicConfigurationBoolean(String key, boolean defaultValue); /** * Get the root directory of the configuration folder. diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfigurationWithSP.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfigurationWithSP.java index 1ab27e7f..cf8867b3 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfigurationWithSP.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/IConfigurationWithSP.java @@ -22,7 +22,7 @@ public interface IConfigurationWithSP extends IConfiguration { * error */ @Nullable - ISpConfiguration getServiceProviderConfiguration(final String uniqueID) throws EaafConfigurationException; + ISpConfiguration getServiceProviderConfiguration(String uniqueID) throws EaafConfigurationException; /** * Get a configuration entry for a specific Service Provider that is decorated @@ -32,12 +32,13 @@ public interface IConfigurationWithSP extends IConfiguration { * @param decorator Decorator that should be used to decorate the result. * This decorator has to be implement or extend the * {@link ISpConfiguration} interface + * @param <T> Response class type * @return <code>T</code> or <code>null</code> if no SP configuration was found * @throws EaafConfigurationException In case of a Service-Provider loading * error */ @Nullable - <T> T getServiceProviderConfiguration(String spIdentifier, final Class<T> decorator) + <T> T getServiceProviderConfiguration(String spIdentifier, Class<T> decorator) throws EaafConfigurationException; /** @@ -49,7 +50,7 @@ public interface IConfigurationWithSP extends IConfiguration { * @param prefix Prefix of the configuration key * @return Map String/String without prefix, but never null */ - Map<String, String> getBasicConfigurationWithPrefix(final String prefix); + Map<String, String> getBasicConfigurationWithPrefix(String prefix); /** * Validate a URL if it it is allowed by configuration. diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/auth/data/IAuthProcessDataContainer.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/auth/data/IAuthProcessDataContainer.java index 6c7292ac..274f3f7f 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/auth/data/IAuthProcessDataContainer.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/auth/data/IAuthProcessDataContainer.java @@ -31,12 +31,23 @@ public interface IAuthProcessDataContainer { * * @return The issuing time of the AUTH-Block SAML assertion. */ - String getIssueInstant(); + Date getIssueInstant(); + + /** + * Returns the issuing time of the AUTH-Block SAML assertion. + * + *<p>{@link String} representation uses pattern: + * <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code> </p> + * + * @return The issuing time of the AUTH-Block SAML assertion. + */ + String getIssueInstantString(); /** * Sets the issuing time of the AUTH-Block SAML assertion. * - * @param issueInstant The issueInstant to set. + * @param issueInstant The issueInstant with pattern: + * <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code> to set. */ void setIssueInstant(String issueInstant); @@ -129,6 +140,8 @@ public interface IAuthProcessDataContainer { /** * Mark that the auth. process was done by an official representatives + * + * @param isOW Mark this data as Organwalter * */ void setOW(boolean isOW); @@ -171,6 +184,7 @@ public interface IAuthProcessDataContainer { * * @param key The specific identifier of the session-data object * @param clazz The class type which is stored with this key + * @param <T> Response class type * @return The session-data object or null if no data is found with this key */ <T> T getGenericDataFromSession(String key, Class<T> clazz); diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/storage/ITransactionStorage.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/storage/ITransactionStorage.java index 754ff9ac..f80fc967 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/storage/ITransactionStorage.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/storage/ITransactionStorage.java @@ -70,10 +70,11 @@ public interface ITransactionStorage { * * @param key Id which identifiers the data object * @param clazz The class type which is stored with this key + * @param <T> Response class type * @return The transaction-data object from type class, or null * @throws EaafStorageException In case of load operation failed */ - <T> T get(String key, final Class<T> clazz) throws EaafException; + <T> T get(String key, Class<T> clazz) throws EaafException; /** * Get a data object from transaction storage. @@ -81,10 +82,11 @@ public interface ITransactionStorage { * @param key Id which identifiers the data object * @param clazz The class type which is stored with this key * @param dataTimeOut Data-object timeout in [ms] + * @param <T> Response class type * @return The transaction-data object from type class, or null * @throws EaafStorageException In case of load operation failed */ - <T> T get(String key, final Class<T> clazz, long dataTimeOut) throws EaafException; + <T> T get(String key, Class<T> clazz, long dataTimeOut) throws EaafException; /** * Change the key of a data object and store it under the new key. |