summaryrefslogtreecommitdiff
path: root/eaaf_core_api/src/main
diff options
context:
space:
mode:
authorThomas <>2021-05-23 10:45:37 +0200
committerThomas <>2021-05-23 10:45:37 +0200
commit8e4059c2b1f69b2361738548dab07194dc1f5dcf (patch)
tree79428da4a8ae9b0430850abbaf7bef586e7712f9 /eaaf_core_api/src/main
parent4a6af28e8ddbd3fdf4a0e678ce740d33b1f09652 (diff)
downloadEAAF-Components-8e4059c2b1f69b2361738548dab07194dc1f5dcf.tar.gz
EAAF-Components-8e4059c2b1f69b2361738548dab07194dc1f5dcf.tar.bz2
EAAF-Components-8e4059c2b1f69b2361738548dab07194dc1f5dcf.zip
update attribute builder for MandateProfiles and add attribute builder for mandate mode to support eIDAS Proxy-Service with mandates
Diffstat (limited to 'eaaf_core_api/src/main')
-rw-r--r--eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java52
1 files changed, 52 insertions, 0 deletions
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 04cf07bb..5d7fcc07 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
@@ -19,6 +19,9 @@
package at.gv.egiz.eaaf.core.api.data;
+import java.util.NoSuchElementException;
+import java.util.stream.Stream;
+
public interface ExtendedPvpAttributeDefinitions extends PvpAttributeDefinitions {
String EIDAS_CONNECTOR_UNIQUEID_NAME = "urn:eidgvat:attributes.eidas.uniqueId";
@@ -36,6 +39,55 @@ public interface ExtendedPvpAttributeDefinitions extends PvpAttributeDefinitions
String SP_USED_MANDATE_PROFILES_NAME = "urn:eidgvat:attributes.ServiceProviderMandateProfiles";
String SP_USED_MANDATE_PROFILES_FRIENDLY_NAME = "ServiceProvider-MandateProfiles";
+ String SP_USED_MANDATE_TYPE_NAME = "urn:eidgvat:attributes.ServiceProviderMandateType";
+ String SP_USED_MANDATE_TYPE_FRIENDLY_NAME = "ServiceProvider-MandateType";
+
+ enum SpMandateModes {
+ NONE("none"),
+ NATURAL("natural"),
+ NATURAL_FORCE("forceNatural"),
+ LEGAL("legal"),
+ LEGAL_FORCE("forceLegal"),
+ BOTH("all"),
+ BOTH_FORCE("forceAll");
+
+ private final String mandateMode;
+
+ SpMandateModes(final String mandateMode) {
+ this.mandateMode = mandateMode;
+ }
+
+ /**
+ * Get Service-Provider mandate-mode from String representation.
+ *
+ * @param s mandate-mode String parameter
+ * @return mandate mode, or {@link NoSuchElementException} if mode is unknown
+ */
+ public static SpMandateModes fromString(final String mode) {
+ return Stream.of(SpMandateModes.values())
+ .filter(el -> el.getMode().equals(mode))
+ .findFirst()
+ .get();
+
+ }
+
+ /**
+ * Get the URI based status identifier of an E-ID.
+ *
+ * @return Current mandate mode
+ */
+ public String getMode() {
+ return this.mandateMode;
+ }
+
+ @Override
+ public String toString() {
+ return getMode();
+
+ }
+
+ }
+
String EID_BINDING_PUBLIC_KEY_NAME = "urn:eidgvat:attributes.binding.pubkey";
String EID_BINDING_PUBLIC_KEY_FRIENDLY_NAME = "Binding-PublicKey";