Update aaa-authn-odl-plugin to use updated aaa bindings 19/27119/3
authorTomas Cere <tcere@cisco.com>
Thu, 17 Sep 2015 13:48:06 +0000 (15:48 +0200)
committerTomas Cere <tcere@cisco.com>
Mon, 21 Sep 2015 08:08:49 +0000 (10:08 +0200)
Change-Id: I9db1888763dbf4d052367a248b07ea03e8039ea0
Signed-off-by: Tomas Cere <tcere@cisco.com>
features/netconf-connector/pom.xml
features/netconf/pom.xml
features/restconf/pom.xml
opendaylight/netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/aaa/odl/CredentialServiceAuthProvider.java
opendaylight/netconf/aaa-authn-odl-plugin/src/test/java/org/opendaylight/aaa/odl/CredentialServiceAuthProviderTest.java

index 66c248a95ddb642aab182a9c8d5802eb586f1739..5b1b04e5277104161af5ba96f794dda1df9c6fbf 100644 (file)
       <groupId>org.opendaylight.controller.model</groupId>
       <artifactId>model-inventory</artifactId>
     </dependency>
+   <dependency>
+       <groupId>${project.groupId}</groupId>
+       <artifactId>messagebus-netconf</artifactId>
+   </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>netconf-config-dispatcher</artifactId>
       <type>xml</type>
       <classifier>config</classifier>
     </dependency>
+   <dependency>
+       <groupId>${project.groupId}</groupId>
+       <artifactId>messagebus-netconf</artifactId>
+       <version>${netconf.version}</version>
+       <type>xml</type>
+       <classifier>config</classifier>
+   </dependency>
 
     <!--
       Optional TODO: Remove TODO comments.
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>opendaylight-karaf-empty</artifactId>
       <version>${commons.opendaylight.version}</version>
+      <scope>test</scope>
       <type>zip</type>
     </dependency>
     <!-- Uncomment this if you get an error : java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
index 836a703906a438411543b7e6b4f976ff529c2440..d4b70376abfcd9714ea55b289ad6731890340b17 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>opendaylight-karaf-empty</artifactId>
       <version>${commons.opendaylight.version}</version>
+      <scope>test</scope>
       <type>zip</type>
     </dependency>
   </dependencies>
index 5a05198b0d5f24b3d2fbb3ca0e00141601960a2f..4a0b555eb4b054e06835f81c1067c3bf5e818ac3 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>opendaylight-karaf-empty</artifactId>
       <version>${commons.opendaylight.version}</version>
+      <scope>test</scope>
       <type>zip</type>
     </dependency>
     <!-- Uncomment this if you get an error : java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
index 8d2350e457dc62ae3ef2a6bd4f4ea53db7c6eaa3..1bef743feeb97afbd849fe2d3c82f16756de3fe5 100644 (file)
@@ -32,9 +32,6 @@ public final class CredentialServiceAuthProvider implements AuthProvider, AutoCl
      */
     public static volatile Map.Entry<BundleContext, CredentialServiceAuthProvider> INSTANCE;
 
-    // TODO what domain should be used for this ? can we leave null ?
-    public static final String DOMAIN = null;
-
     // FIXME CredentialAuth is generic and it causes warnings during compilation
     // Maybe there should be a PasswordCredentialAuth implements CredentialAuth<PasswordCredentials>
     private volatile CredentialAuth<PasswordCredentials> nullableCredService;
@@ -81,7 +78,7 @@ public final class CredentialServiceAuthProvider implements AuthProvider, AutoCl
 
         Claim claim;
         try {
-            claim = nullableCredService.authenticate(new PasswordCredentialsWrapper(username, password), DOMAIN);
+            claim = nullableCredService.authenticate(new PasswordCredentialsWrapper(username, password));
         } catch (AuthenticationException e) {
             logger.debug("Authentication failed for user '{}' : {}", username, e);
             return false;
@@ -115,5 +112,11 @@ public final class CredentialServiceAuthProvider implements AuthProvider, AutoCl
         public String password() {
             return password;
         }
+
+        @Override
+        public String domain() {
+            // If this is left null, default "sdn" domain is assumed
+            return null;
+        }
     }
 }
index 5f9bbfe0df258560f811fbc6242da54a5d7c3f99..4962256717fb3bc0b7b59fb3a377a4051a465e5f 100644 (file)
@@ -62,7 +62,7 @@ public class CredentialServiceAuthProviderTest {
 
         Claim claim = mock(Claim.class);
         doReturn("domain").when(claim).domain();
-        doReturn(claim).when(credAuth).authenticate(any(PasswordCredentials.class), anyString());
+        doReturn(claim).when(credAuth).authenticate(any(PasswordCredentials.class));
 
         doReturn(credAuth).when(ctx).getService(serviceRef);
         CredentialServiceAuthProvider credentialServiceAuthProvider = new CredentialServiceAuthProvider(ctx);
@@ -80,7 +80,7 @@ public class CredentialServiceAuthProviderTest {
         ServiceListenerAnswer answer = new ServiceListenerAnswer();
         doAnswer(answer).when(ctx).addServiceListener(any(ServiceListener.class), anyString());
 
-        doThrow(AuthenticationException.class).when(credAuth).authenticate(any(PasswordCredentials.class), anyString());
+        doThrow(AuthenticationException.class).when(credAuth).authenticate(any(PasswordCredentials.class));
 
         doReturn(credAuth).when(ctx).getService(serviceRef);
         CredentialServiceAuthProvider credentialServiceAuthProvider = new CredentialServiceAuthProvider(ctx);