aboutsummaryrefslogtreecommitdiff
path: root/ms_specific_proxyservice/src/main/java
diff options
context:
space:
mode:
authorThomas <>2022-06-08 12:32:16 +0200
committerThomas <>2022-06-08 12:32:16 +0200
commit3d9d419a40b17de1f94d46cbc2f5b345a93bff00 (patch)
treeeccca95fa319ac13b2f6e98fd34b25e266dc489d /ms_specific_proxyservice/src/main/java
parentdb3af28b79296b6f5650a85c5a41ad5015c57222 (diff)
downloadNational_eIDAS_Gateway-3d9d419a40b17de1f94d46cbc2f5b345a93bff00.tar.gz
National_eIDAS_Gateway-3d9d419a40b17de1f94d46cbc2f5b345a93bff00.tar.bz2
National_eIDAS_Gateway-3d9d419a40b17de1f94d46cbc2f5b345a93bff00.zip
feat(eidas): perform mapping between IDA and eIDAS attributes based on external configuration
Diffstat (limited to 'ms_specific_proxyservice/src/main/java')
-rw-r--r--ms_specific_proxyservice/src/main/java/at/asitplus/eidas/specific/proxy/builder/ProxyAuthenticationDataBuilder.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/ms_specific_proxyservice/src/main/java/at/asitplus/eidas/specific/proxy/builder/ProxyAuthenticationDataBuilder.java b/ms_specific_proxyservice/src/main/java/at/asitplus/eidas/specific/proxy/builder/ProxyAuthenticationDataBuilder.java
new file mode 100644
index 00000000..bc7f88d4
--- /dev/null
+++ b/ms_specific_proxyservice/src/main/java/at/asitplus/eidas/specific/proxy/builder/ProxyAuthenticationDataBuilder.java
@@ -0,0 +1,38 @@
+package at.asitplus.eidas.specific.proxy.builder;
+
+import at.asitplus.eidas.specific.core.builder.AuthenticationDataBuilder;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * eIDAS Proxy-Service specific authentication-data builder.
+ *
+ * @author tlenz
+ *
+ */
+@Slf4j
+public class ProxyAuthenticationDataBuilder extends AuthenticationDataBuilder {
+
+ private static final String PLUS = "+";
+
+ @Override
+ protected String customizeLegalPersonSourcePin(String sourcePin, String sourcePinType) {
+ String sectorType = sourcePinType.substring((EaafConstants.URN_PREFIX_BASEID + PLUS).length());
+ return sectorType + PLUS + sourcePin;
+
+ }
+
+ @Override
+ protected String customizeBpkAttribute(String pvpBpkAttrValue) {
+ final String[] split = pvpBpkAttrValue.split(":", 2);
+ if (split.length == 2) {
+ log.debug("Remove prefix from bPK attribute to transform it into eIDAS-Node format");
+ return split[1];
+
+ } else {
+ log.warn("PVP bPK attribute: {} has wrong format. Use it as it is.", pvpBpkAttrValue);
+ return pvpBpkAttrValue;
+
+ }
+ }
+}