JAMES-1959 Disable JWT authentication on JPA

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/8c9805d4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/8c9805d4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/8c9805d4

Branch: refs/heads/master
Commit: 8c9805d4b844280c8462d954ceefb3256337a197
Parents: 3d327f7
Author: benwa <btell...@linagora.com>
Authored: Thu Mar 9 14:53:49 2017 +0700
Committer: benwa <btell...@linagora.com>
Committed: Wed Mar 15 09:01:53 2017 +0700

----------------------------------------------------------------------
 .../org/apache/james/JPAJamesServerMain.java    |  4 ++-
 .../james/modules/server/NoJwtModule.java       | 36 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8c9805d4/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
 
b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
index 4235822..4514fba 100644
--- 
a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ 
b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -32,6 +32,7 @@ import 
org.apache.james.modules.protocols.ProtocolHandlerModule;
 import org.apache.james.modules.protocols.SMTPServerModule;
 import org.apache.james.modules.server.ActiveMQQueueModule;
 import org.apache.james.modules.server.JMXServerModule;
+import org.apache.james.modules.server.NoJwtModule;
 import org.apache.james.modules.server.QuotaModule;
 import org.apache.james.modules.server.RawPostDequeueDecoratorModule;
 import org.apache.james.modules.server.WebAdminServerModule;
@@ -57,7 +58,8 @@ public class JPAJamesServerMain {
         new QuotaModule(),
         new ActiveMQQueueModule(),
         new RawPostDequeueDecoratorModule(),
-        new MailboxModule());
+        new MailboxModule(),
+        new NoJwtModule());
 
     public static void main(String[] args) throws Exception {
         GuiceJamesServer server = new GuiceJamesServer()

http://git-wip-us.apache.org/repos/asf/james-project/blob/8c9805d4/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/server/NoJwtModule.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/server/NoJwtModule.java
 
b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/server/NoJwtModule.java
new file mode 100644
index 0000000..10d3754
--- /dev/null
+++ 
b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/server/NoJwtModule.java
@@ -0,0 +1,36 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.modules.server;
+
+import java.util.Optional;
+
+import org.apache.james.jwt.JwtConfiguration;
+import org.apache.james.webadmin.authentication.AuthenticationFilter;
+import org.apache.james.webadmin.authentication.NoAuthenticationFilter;
+
+import com.google.inject.AbstractModule;
+
+public class NoJwtModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(JwtConfiguration.class).toInstance(new 
JwtConfiguration(Optional.empty()));
+    }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to