More moves / cleanups
Tomas Doran [Mon, 16 Aug 2010 18:30:53 +0000 (18:30 +0000)]
t/lib/Test-Session-Broken/lib/Test/LDAP.pm [deleted file]
t/lib/Test/LDAP.pm [new file with mode: 0644]
t/lib/Test/LDAP/Controller/Auth.pm [moved from t/lib/Test-Session-Broken/lib/Test/LDAP/Controller/Auth.pm with 94% similarity]
t/lib/Test/LDAP/Controller/Root.pm [moved from t/lib/Test-Session-Broken/lib/Test/LDAP/Controller/Root.pm with 100% similarity]
t/lib/Test/LDAP/Controller/User.pm [moved from t/lib/Test-Session-Broken/lib/Test/LDAP/Controller/User.pm with 100% similarity]
t/lib/Test/LDAP/Model/LDAP.pm [moved from t/lib/Test-Session-Broken/lib/Test/LDAP/Model/LDAP.pm with 100% similarity]

diff --git a/t/lib/Test-Session-Broken/lib/Test/LDAP.pm b/t/lib/Test-Session-Broken/lib/Test/LDAP.pm
deleted file mode 100644 (file)
index 4eef8c8..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-package Test::LDAP;
-use Moose;
-use namespace::autoclean;
-
-use Catalyst::Runtime 5.80;
-
-use Catalyst qw/
-    -Debug
-    Authentication
-    Session
-    Session::State::Cookie
-    Session::Store::FastMmap
-/;
-
-extends 'Catalyst';
-
-our $VERSION = '0.01';
-
-# Configure the application.
-#
-# Note that settings in test_ldap_web.conf (or other external
-# configuration file that you set up manually) take precedence
-# over this when using ConfigLoader. Thus configuration
-# details given here can function as a default configuration,
-# with an external configuration file acting as an override for
-# local deployment.
-
-__PACKAGE__->config(
-    # Disable deprecated behavior needed by old applications
-    disable_component_resolution_regex_fallback => 1,
-
-    authentication => {
-        default_realm => "ldap",
-
-        realms => {
-            ldap => {
-                credential => {
-                    "class" => "Password",
-                    "password_field" => "password",
-                    "password_type" => "self_check",
-                    "password_hash_type" => "crypt",
-                },
-
-                "store" => {
-                    "binddn"                => "anonymous",
-                    "bindpw"                => "dontcare",
-                    "class"                 => "LDAP",
-                    "ldap_server"           => "ldap.test.no",
-                    "ldap_server_options"   => { 
-                        "timeout" => 30, 
-                        "port" => "636", 
-                        "scheme" => "ldaps" 
-                    },
-                    "role_basedn"           => "ou=stavanger,o=test,c=no",
-                    "role_field"            => "cn",
-                    "role_filter"           => "(&(objectClass=groupOfNames)(member=%s))",
-                    "user_scope"            => "one",
-                    "user_search_options"   => { 
-                        "deref" => "always" 
-                    }
-                }
-            }
-        }
-    }
-);
-
-__PACKAGE__->setup();
-
-1;
diff --git a/t/lib/Test/LDAP.pm b/t/lib/Test/LDAP.pm
new file mode 100644 (file)
index 0000000..ddb5174
--- /dev/null
@@ -0,0 +1,53 @@
+package Test::LDAP;
+use Moose;
+use namespace::autoclean;
+
+use Catalyst::Runtime 5.80;
+
+use Catalyst qw/
+    -Debug
+    Authentication
+    Session
+    Session::State::Cookie
+    Session::Store::FastMmap
+/;
+
+extends 'Catalyst';
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config(
+    # Disable deprecated behavior needed by old applications
+    disable_component_resolution_regex_fallback => 1,
+
+    authentication => {
+        default_realm => "ldap",
+
+        realms => {
+            ldap => {
+                credential => {
+                    "class" => "Password",
+                    "password_field" => "password",
+                    "password_type" => "self_check",
+                    "password_hash_type" => "crypt",
+                },
+
+                "store" => {
+                    "binddn"                => "anonymous",
+                    "bindpw"                => "dontcare",
+                    "class"                 => "LDAP",
+                    "ldap_server"           => "localhost",
+                    user_basedn => "ou=foobar",
+                    "ldap_server_options"   => {
+                        "port" => "10636",
+                    },
+                    "user_scope"            => "one",
+                }
+            }
+        }
+    }
+);
+
+__PACKAGE__->setup();
+
+1;
@@ -4,12 +4,6 @@ use namespace::autoclean;
 
 BEGIN {extends 'Catalyst::Controller'; }
 
-sub index :Path :Args(0) {
-    my ( $self, $c ) = @_;
-
-    $c->res->body("Login");
-}
-
 sub login :Path("login") :Args(0) {
     my ( $self, $c ) = @_;