aboutsummaryrefslogtreecommitdiff
path: root/modules/eidas_proxy-sevice/src/main
diff options
context:
space:
mode:
authorThomas <>2022-08-16 10:56:54 +0200
committerThomas <>2022-08-16 10:56:54 +0200
commitca50cb8dda0a24b5a4589db126bfab8d0d885b00 (patch)
tree0947baf07a77f6f0b2fa2368fc92f87510340770 /modules/eidas_proxy-sevice/src/main
parent0ae0c83da2f970bb8987f116286857e07b0c02b1 (diff)
downloadNational_eIDAS_Gateway-ca50cb8dda0a24b5a4589db126bfab8d0d885b00.tar.gz
National_eIDAS_Gateway-ca50cb8dda0a24b5a4589db126bfab8d0d885b00.tar.bz2
National_eIDAS_Gateway-ca50cb8dda0a24b5a4589db126bfab8d0d885b00.zip
feat(proxy): add support for custom eIDAS attribute-handler into ProxyEidasAttributeRegistry
This allow more sopisticated attribute-processing than simple mapping to IDA attributes
Diffstat (limited to 'modules/eidas_proxy-sevice/src/main')
-rw-r--r--modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/AttrMappingElement.java6
-rw-r--r--modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/service/ProxyEidasAttributeRegistry.java18
2 files changed, 23 insertions, 1 deletions
diff --git a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/AttrMappingElement.java b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/AttrMappingElement.java
index cf106bad..2dffbc2d 100644
--- a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/AttrMappingElement.java
+++ b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/AttrMappingElement.java
@@ -13,6 +13,8 @@ import lombok.Data;
@JsonPropertyOrder({
"eidasAttribute",
"idaAttribute",
+ "addionalRequiredAttributes",
+ "specificAttributeHandlerClass",
"type"
})
@Data
@@ -34,6 +36,10 @@ public class AttrMappingElement {
@JsonProperty("addionalRequiredAttributes")
private List<String> addionalRequiredAttributes;
+
+ @JsonProperty("specificAttributeHandlerClass")
+ private String specificAttributeHandlerClass;
+
/**
* attribute characteristics.
*/
diff --git a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/service/ProxyEidasAttributeRegistry.java b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/service/ProxyEidasAttributeRegistry.java
index a6a50100..a0c99019 100644
--- a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/service/ProxyEidasAttributeRegistry.java
+++ b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/service/ProxyEidasAttributeRegistry.java
@@ -111,7 +111,7 @@ public class ProxyEidasAttributeRegistry {
}
/**
- * Get eIDAS related IDA attribute.
+ * Get eIDAS related IDA attribute for a specific mode-operation.
*
* @param eidasAttributeName Name of the eIDAS attribute.
* @param withMandates <code>true</code> if mandates are supported, otherwise <code>false</code>
@@ -127,6 +127,22 @@ public class ProxyEidasAttributeRegistry {
}
+ /**
+ * Get eIDAS related custom attribute-handler.
+ *
+ * @param eidasAttributeName Name of the eIDAS attribute.
+ * @return full classname of the handler implementation if available
+ */
+ public Optional<String> mapEidasAttributeToAttributeHandler(String eidasAttributeName) {
+ return attributeConfiguration.stream()
+ .filter(el -> el.getEidasAttributeName().equals(eidasAttributeName))
+ .filter(el -> StringUtils.isNotEmpty(el.getSpecificAttributeHandlerClass()))
+ .findFirst()
+ .map(el -> el.getSpecificAttributeHandlerClass());
+
+ }
+
+
@PostConstruct
private void initialize() throws EaafConfigurationException {
final String attrConfPath = basicConfig.getBasicConfiguration(