Class DefaultMetadataPolicyMergingStrategy

  • All Implemented Interfaces:
    BiFunction<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Pair<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Boolean>>

    public class DefaultMetadataPolicyMergingStrategy
    extends Object
    implements BiFunction<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Pair<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Boolean>>

    A function that merges two maps of metadata policies according to the rules specified in the OIDC federation spec (draft 17), section 5.1.3.1:

    • subset_of: The result of merging the values of two subset_of operators is the intersection of the operator values.
    • one_of: The result of merging the values of two one_of operators is the intersection of the operator values.
    • superset_of: The result of merging the values of two superset_of operators is the union of the operator values.
    • add: The result of merging the values of two add operators is the union of the values.
    • value: Merging two value operators is NOT allowed unless the two operator values are equal.
    • default: Merging two default operators is NOT allowed unless the two operator values are equal.
    • essential: If a superior has specified essential=true, then a subordinate cannot change that. If a superior has specified essential=false, then a subordinate is allowed to change that to essential=true. If a superior has not specified essential, then a subordinate can set essential to true or false.

    The function returns a pair of map of merged metadata policies and a boolean indicating if the merging operators in the policies were compliant.

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
    • Constructor Detail

      • DefaultMetadataPolicyMergingStrategy

        public DefaultMetadataPolicyMergingStrategy()
    • Method Detail

      • apply

        @Nonnull
        public Pair<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Boolean> apply​(@Nullable
                                                                                                              Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy> first,
                                                                                                              @Nullable
                                                                                                              Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy> second)
        Specified by:
        apply in interface BiFunction<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Pair<Map<String,​net.shibboleth.oidc.metadata.policy.MetadataPolicy>,​Boolean>>