Spring Security
  1. Spring Security
  2. SEC-1732

Embedded LDAP Server (ApacheDSContainer) Doesn't Import Multiple LDIF Files As Advertised

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.1.0.RC3
    • Component/s: LDAP
    • Labels:
      None
    • Environment:
      Spring Security 3.0.5

      Description

      When including multiple comma separated LDIF file resources, the ApacheDSContainer class is not looping over the LDIF file array and importing each one. Rather, it is only importing the first file in the array.

        Activity

        Hide
        Luke Taylor added a comment -

        I've implemented looping over resources. However, the syntax supported is a Spring resource string, not comma-separated values.

        If you are using multiple LDIF files then they need to be loaded in the correct order, and that isn't guaranteed if you are using classpath resources. So I'd recommend you stick to a single file. The current documentation only refers to a single resource unless you don't specify a value, in which case it scans the classpath.

        Show
        Luke Taylor added a comment - I've implemented looping over resources. However, the syntax supported is a Spring resource string, not comma-separated values. If you are using multiple LDIF files then they need to be loaded in the correct order, and that isn't guaranteed if you are using classpath resources. So I'd recommend you stick to a single file. The current documentation only refers to a single resource unless you don't specify a value, in which case it scans the classpath.
        Hide
        Luke Taylor added a comment -

        I think this is actually a bad idea as the behaviour may be different on different VMs or Spring versions. I'd prefer a fail-fast option if more than one resource is located using the supplied pattern.

        Show
        Luke Taylor added a comment - I think this is actually a bad idea as the behaviour may be different on different VMs or Spring versions. I'd prefer a fail-fast option if more than one resource is located using the supplied pattern.
        Hide
        Luke Taylor added a comment -

        Reverted the original commit and the code now raises an IllegalArgumentException if multiple resources are found.

        Show
        Luke Taylor added a comment - Reverted the original commit and the code now raises an IllegalArgumentException if multiple resources are found.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Mark Rohan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: