From 6b48e5af89679e27972beb4a2610738b3a95cf79 Mon Sep 17 00:00:00 2001 From: arunk-kumar Date: Sat, 13 Jun 2026 04:17:13 +0530 Subject: [PATCH] KNOX-1608: Remove gateway-adapter module --- gateway-adapter/pom.xml | 117 ------------------ .../audit/log4j/layout/AuditLayout.java | 36 ------ .../gateway/dispatch/DefaultDispatch.java | 94 -------------- .../hadoop/gateway/dispatch/NiFiDispatch.java | 49 -------- .../gateway/dispatch/NiFiHaDispatch.java | 53 -------- .../dispatch/PassAllHeadersDispatch.java | 28 ----- .../PassAllHeadersNoEncodingDispatch.java | 29 ----- .../hadoopauth/filter/HadoopAuthFilter.java | 37 ------ .../hadoop/gateway/hbase/HBaseDispatch.java | 28 ----- .../hdfs/dispatch/HdfsHttpClientDispatch.java | 51 -------- .../hdfs/dispatch/WebHdfsHaDispatch.java | 54 -------- .../hadoop/gateway/hive/HiveDispatch.java | 34 ----- .../hadoop/gateway/hive/HiveHaDispatch.java | 38 ------ .../jwt/filter/JWTFederationFilter.java | 39 ------ .../jwt/filter/SSOCookieFederationFilter.java | 52 -------- .../gateway/rm/dispatch/RMHaDispatch.java | 31 ----- .../gateway/rm/dispatch/RMUIHaDispatch.java | 33 ----- .../shirorealm/KnoxLdapContextFactory.java | 41 ------ .../gateway/shirorealm/KnoxLdapRealm.java | 99 --------------- .../gateway/shirorealm/KnoxPamRealm.java | 49 -------- .../hadoop/gateway/storm/StormDispatch.java | 28 ----- .../hadoop/gateway/topology/Service.java | 28 ----- .../hadoop/gateway/topology/Topology.java | 31 ----- .../hadoop/gateway/util/RegExUtils.java | 28 ----- .../src/main/resources/META-INF/launcher.cfg | 17 --- .../gateway/shirorealm/KnoxLdapRealmTest.java | 105 ---------------- .../gateway/shirorealm/KnoxPamRealmTest.java | 72 ----------- gateway-release/pom.xml | 4 - pom.xml | 6 - 29 files changed, 1311 deletions(-) delete mode 100644 gateway-adapter/pom.xml delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/audit/log4j/layout/AuditLayout.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiHaDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersNoEncodingDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/hadoopauth/filter/HadoopAuthFilter.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsHttpClientDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveHaDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/JWTFederationFilter.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMHaDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMUIHaDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapContextFactory.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealm.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/storm/StormDispatch.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Service.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Topology.java delete mode 100644 gateway-adapter/src/main/java/org/apache/hadoop/gateway/util/RegExUtils.java delete mode 100644 gateway-adapter/src/main/resources/META-INF/launcher.cfg delete mode 100644 gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealmTest.java delete mode 100644 gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealmTest.java diff --git a/gateway-adapter/pom.xml b/gateway-adapter/pom.xml deleted file mode 100644 index ce50cccd1a..0000000000 --- a/gateway-adapter/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - 4.0.0 - - gateway - org.apache.knox - 3.0.0-SNAPSHOT - - - gateway-adapter - gateway-adapter - Adapter for old package structure to ensure compatibility. - - - - org.apache.knox - gateway-util-common - - - org.apache.knox - gateway-util-launcher - - - org.apache.knox - gateway-provider-ha - - - org.apache.knox - gateway-spi - - - - org.apache.shiro - shiro-core - - - - org.apache.httpcomponents - httpcore - - - org.apache.httpcomponents - httpclient - - - - javax.servlet - javax.servlet-api - - - - org.apache.knox - gateway-test-utils - test - - - - org.apache.knox - gateway-provider-security-shiro - - - org.apache.knox - gateway-service-webhdfs - - - org.apache.knox - gateway-provider-security-jwt - - - org.apache.knox - gateway-provider-security-hadoopauth - - - org.apache.knox - gateway-service-hbase - - - org.apache.knox - gateway-service-hive - - - org.apache.knox - gateway-service-nifi - - - org.apache.knox - gateway-service-rm - - - org.apache.knox - gateway-service-storm - - - - commons-cli - commons-cli - - - diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/audit/log4j/layout/AuditLayout.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/audit/log4j/layout/AuditLayout.java deleted file mode 100644 index d88386cfca..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/audit/log4j/layout/AuditLayout.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.hadoop.gateway.audit.log4j.layout; - -import java.nio.charset.StandardCharsets; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.audit.log4j.layout.AuditLayout} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.audit.log4j.layout.AuditLayout} - */ -@Deprecated -public class AuditLayout extends org.apache.knox.gateway.audit.log4j.layout.AuditLayout { - /** - * Create an instance - */ - public AuditLayout() { - super(StandardCharsets.UTF_8); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java deleted file mode 100644 index f9afa23cc9..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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.hadoop.gateway.dispatch; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpUriRequest; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.dispatch.DefaultDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.dispatch.DefaultDispatch} - */ -@Deprecated -public class DefaultDispatch extends org.apache.knox.gateway.dispatch.DefaultDispatch { - @Override - protected int getReplayBufferSize() { - return super.getReplayBufferSize(); - } - - @Override - protected void setReplayBufferSize(int size) { - super.setReplayBufferSize(size); - } - - @Override - protected int getReplayBufferSizeInBytes() { - return super.getReplayBufferSizeInBytes(); - } - - @Override - protected void setReplayBufferSizeInBytes(int size) { - super.setReplayBufferSizeInBytes(size); - } - - @Override - protected void executeRequest(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse) - throws IOException { - super.executeRequest(outboundRequest, inboundRequest, outboundResponse); - } - - @Override - protected HttpResponse executeOutboundRequest(HttpUriRequest outboundRequest) - throws IOException { - return super.executeOutboundRequest(outboundRequest); - } - - @Override - protected void writeOutboundResponse(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse, - HttpResponse inboundResponse) throws IOException { - super.writeOutboundResponse(outboundRequest, inboundRequest, - outboundResponse, inboundResponse); - } - - @Override - protected void closeInboundResponse(HttpResponse response, InputStream stream) - throws IOException { - super.closeInboundResponse(response, stream); - } - - @Override - protected void addCredentialsToRequest(HttpUriRequest outboundRequest) { - super.addCredentialsToRequest(outboundRequest); - } - - @Override - protected HttpEntity createRequestEntity(HttpServletRequest request) - throws IOException { - return super.createRequestEntity(request); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiDispatch.java deleted file mode 100644 index 2e11ea5af4..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiDispatch.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.hadoop.gateway.dispatch; - -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpUriRequest; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.dispatch.NiFiDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.dispatch.NiFiDispatch} - */ -@Deprecated -public class NiFiDispatch extends org.apache.knox.gateway.dispatch.NiFiDispatch { - @Override - protected void executeRequest(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse) - throws IOException { - super.executeRequest(outboundRequest, inboundRequest, outboundResponse); - } - - @Override - protected void writeOutboundResponse(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse, - HttpResponse inboundResponse) throws IOException { - super.writeOutboundResponse(outboundRequest, inboundRequest, - outboundResponse, inboundResponse); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiHaDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiHaDispatch.java deleted file mode 100644 index 996636d49e..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/NiFiHaDispatch.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.hadoop.gateway.dispatch; - -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpUriRequest; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.dispatch.NiFiHaDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.dispatch.NiFiHaDispatch} - */ -@Deprecated -public class NiFiHaDispatch extends org.apache.knox.gateway.dispatch.NiFiHaDispatch { - public NiFiHaDispatch() { - super(); - } - - @Override - protected void executeRequest(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse) - throws IOException { - super.executeRequest(outboundRequest, inboundRequest, outboundResponse); - } - - @Override - protected void writeOutboundResponse(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse, - HttpResponse inboundResponse) throws IOException { - super.writeOutboundResponse(outboundRequest, inboundRequest, - outboundResponse, inboundResponse); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersDispatch.java deleted file mode 100644 index 56016ed862..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersDispatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.hadoop.gateway.dispatch; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.dispatch.PassAllHeadersDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.dispatch.PassAllHeadersDispatch} - */ -@Deprecated -public class PassAllHeadersDispatch extends org.apache.knox.gateway.dispatch.PassAllHeadersDispatch { -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersNoEncodingDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersNoEncodingDispatch.java deleted file mode 100644 index f429e984d9..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/dispatch/PassAllHeadersNoEncodingDispatch.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.hadoop.gateway.dispatch; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.dispatch.PassAllHeadersNoEncodingDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.dispatch.PassAllHeadersNoEncodingDispatch} - */ -@Deprecated -public class PassAllHeadersNoEncodingDispatch - extends org.apache.knox.gateway.dispatch.PassAllHeadersNoEncodingDispatch { -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hadoopauth/filter/HadoopAuthFilter.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hadoopauth/filter/HadoopAuthFilter.java deleted file mode 100644 index 17d07552d6..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hadoopauth/filter/HadoopAuthFilter.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.hadoop.gateway.hadoopauth.filter; - -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import java.util.Properties; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.hadoopauth.filter.HadoopAuthFilter} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.hadoopauth.filter.HadoopAuthFilter} - */ -@Deprecated -public class HadoopAuthFilter extends org.apache.knox.gateway.hadoopauth.filter.HadoopAuthFilter { - @Override - protected Properties getConfiguration(String configPrefix, - FilterConfig filterConfig) throws ServletException { - return super.getConfiguration(configPrefix, filterConfig); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatch.java deleted file mode 100644 index 605b31d651..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.hadoop.gateway.hbase; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.hbase.HBaseDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.hbase.HBaseDispatch} - */ -@Deprecated -public class HBaseDispatch extends org.apache.knox.gateway.hbase.HBaseDispatch { -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsHttpClientDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsHttpClientDispatch.java deleted file mode 100644 index 49a164512d..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsHttpClientDispatch.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.hadoop.gateway.hdfs.dispatch; - -import org.apache.http.HttpEntity; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.hdfs.dispatch.HdfsHttpClientDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.hdfs.dispatch.HdfsHttpClientDispatch} - */ -@Deprecated -public class HdfsHttpClientDispatch extends org.apache.knox.gateway.hdfs.dispatch.HdfsHttpClientDispatch { - public HdfsHttpClientDispatch() throws ServletException { - super(); - } - - /** - * This method ensures that the request InputStream is not acquired - * prior to a dispatch to a component such as a namenode that doesn't - * the request body. The side effect of this is that the client does - * not get a 100 continue from Knox which will trigger the client to - * send the entire payload before redirect to the target component - * like a datanode and have to send it again. - */ - @Override - protected HttpEntity createRequestEntity(HttpServletRequest request) - throws IOException { - return super.createRequestEntity(request); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaDispatch.java deleted file mode 100644 index 43cb25116e..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaDispatch.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.hadoop.gateway.hdfs.dispatch; - -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpUriRequest; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.hdfs.dispatch.WebHdfsHaDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.hdfs.dispatch.WebHdfsHaDispatch} - */ -@Deprecated -public class WebHdfsHaDispatch extends org.apache.knox.gateway.hdfs.dispatch.WebHdfsHaDispatch { - public WebHdfsHaDispatch() throws ServletException { - super(); - } - - @Override - protected void executeRequest(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse) - throws IOException { - super.executeRequest(outboundRequest, inboundRequest, outboundResponse); - } - - @Override - protected void writeOutboundResponse(HttpUriRequest outboundRequest, - HttpServletRequest inboundRequest, HttpServletResponse outboundResponse, - HttpResponse inboundResponse) throws IOException { - super.writeOutboundResponse(outboundRequest, inboundRequest, - outboundResponse, inboundResponse); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java deleted file mode 100644 index f9a01352b3..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.hadoop.gateway.hive; - -import org.apache.http.client.methods.HttpUriRequest; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.hive.HiveDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.hive.HiveDispatch} - */ -@Deprecated -public class HiveDispatch extends org.apache.knox.gateway.hive.HiveDispatch { - @Override - protected void addCredentialsToRequest(HttpUriRequest request) { - super.addCredentialsToRequest(request); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveHaDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveHaDispatch.java deleted file mode 100644 index e7b2fbc75e..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/hive/HiveHaDispatch.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.hadoop.gateway.hive; - -import org.apache.http.client.methods.HttpUriRequest; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.hive.HiveHaDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.hive.HiveHaDispatch} - */ -@Deprecated -public class HiveHaDispatch extends org.apache.knox.gateway.hive.HiveHaDispatch { - public HiveHaDispatch() { - super(); - } - - @Override - protected void addCredentialsToRequest(HttpUriRequest request) { - super.addCredentialsToRequest(request); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/JWTFederationFilter.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/JWTFederationFilter.java deleted file mode 100644 index e01fb7fb4a..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/JWTFederationFilter.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.hadoop.gateway.provider.federation.jwt.filter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * An adapter class that delegate calls to - * {@link org.apache.knox.gateway.provider.federation.jwt.filter.JWTFederationFilter} for backwards - * compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.provider.federation.jwt.filter.JWTFederationFilter} - */ -@Deprecated -public class JWTFederationFilter extends org.apache.knox.gateway.provider.federation.jwt.filter.JWTFederationFilter { - @Override - protected void handleValidationError(HttpServletRequest request, - HttpServletResponse response, int status, String error) - throws IOException { - super.handleValidationError(request, response, status, error); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java deleted file mode 100644 index d4e4340721..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.hadoop.gateway.provider.federation.jwt.filter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * An adapter class that delegate calls to - * {@link org.apache.knox.gateway.provider.federation.jwt.filter.SSOCookieFederationFilter} for backwards - * compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.provider.federation.jwt.filter.SSOCookieFederationFilter} - */ -@Deprecated -public class SSOCookieFederationFilter - extends org.apache.knox.gateway.provider.federation.jwt.filter.SSOCookieFederationFilter { - @Override - protected void handleValidationError(HttpServletRequest request, - HttpServletResponse response, int status, String error) - throws IOException { - super.handleValidationError(request, response, status, error); - } - - /** - * Create the URL to be used for authentication of the user in the absence of - * a JWT token within the incoming request. - * - * @param request for getting the original request URL - * @return url to use as login url for redirect - */ - @Override - protected String constructLoginURL(HttpServletRequest request) { - return super.constructLoginURL(request); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMHaDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMHaDispatch.java deleted file mode 100644 index a6e090050e..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMHaDispatch.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.hadoop.gateway.rm.dispatch; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.rm.dispatch.RMHaDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.rm.dispatch.RMHaDispatch} - */ -@Deprecated -public class RMHaDispatch extends org.apache.knox.gateway.rm.dispatch.RMHaDispatch { - public RMHaDispatch() { - super(); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMUIHaDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMUIHaDispatch.java deleted file mode 100644 index 63fcf44ed4..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/rm/dispatch/RMUIHaDispatch.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.hadoop.gateway.rm.dispatch; - -import javax.servlet.ServletException; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.rm.dispatch.RMUIHaDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.rm.dispatch.RMUIHaDispatch} - */ -@Deprecated -public class RMUIHaDispatch extends org.apache.knox.gateway.rm.dispatch.RMUIHaDispatch { - public RMUIHaDispatch() throws ServletException { - super(); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapContextFactory.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapContextFactory.java deleted file mode 100644 index 2b432a43b8..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapContextFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.hadoop.gateway.shirorealm; - -import javax.naming.NamingException; -import javax.naming.ldap.LdapContext; -import java.util.Hashtable; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.shirorealm.KnoxLdapContextFactory} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.shirorealm.KnoxLdapContextFactory} - */ -@Deprecated -public class KnoxLdapContextFactory extends org.apache.knox.gateway.shirorealm.KnoxLdapContextFactory { - public KnoxLdapContextFactory() { - super(); - } - - @Override - protected LdapContext createLdapContext(Hashtable env) - throws NamingException { - return super.createLdapContext(env); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java deleted file mode 100644 index 6fef6b44f2..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealm.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.hadoop.gateway.shirorealm; - -import org.apache.shiro.authc.AuthenticationException; -import org.apache.shiro.authc.AuthenticationInfo; -import org.apache.shiro.authc.AuthenticationToken; -import org.apache.shiro.authz.AuthorizationInfo; -import org.apache.shiro.realm.ldap.LdapContextFactory; -import org.apache.shiro.subject.PrincipalCollection; - -import javax.naming.NamingException; -import javax.naming.ldap.LdapContext; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.shirorealm.KnoxLdapRealm} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.shirorealm.KnoxLdapRealm} - */ -@Deprecated -public class KnoxLdapRealm extends org.apache.knox.gateway.shirorealm.KnoxLdapRealm { - public KnoxLdapRealm() { - super(); - } - - @Override - protected AuthenticationInfo doGetAuthenticationInfo( - AuthenticationToken token) throws AuthenticationException { - return super.doGetAuthenticationInfo(token); - } - - /** - * Get groups from LDAP. - * - * @param principals the principals of the Subject whose - * AuthenticationInfo should be queried from the - * LDAP server. - * @param ldapContextFactory factory used to retrieve LDAP connections. - * @return an {@link AuthorizationInfo} instance containing information - * retrieved from the LDAP server. - * @throws NamingException if any LDAP errors occur during the search. - */ - @Override - protected AuthorizationInfo queryForAuthorizationInfo( - PrincipalCollection principals, LdapContextFactory ldapContextFactory) - throws NamingException { - return super.queryForAuthorizationInfo(principals, ldapContextFactory); - } - - /** - * Returns the LDAP User Distinguished Name (DN) to use when acquiring an - * {@link LdapContext LdapContext} from the {@link LdapContextFactory}. - * - * If the the {@link #getUserDnTemplate() userDnTemplate} property has been - * set, this implementation will construct the User DN by substituting the - * specified {@code principal} into the configured template. If the {@link - * #getUserDnTemplate() userDnTemplate} has not been set, the method argument - * will be returned directly (indicating that the submitted authentication - * token principal is the User DN). - * - * @param principal the principal to substitute into the configured {@link - * #getUserDnTemplate() userDnTemplate}. - * @return the constructed User DN to use at runtime when acquiring an {@link - * LdapContext}. - * @throws IllegalArgumentException if the method argument is null or empty - * @throws IllegalStateException if the {@link #getUserDnTemplate - * userDnTemplate} has not been set. - * @see LdapContextFactory#getLdapContext(Object, Object) - */ - @Override - protected String getUserDn(String principal) - throws IllegalArgumentException, IllegalStateException { - return super.getUserDn(principal); - } - - @Override - protected AuthenticationInfo createAuthenticationInfo( - AuthenticationToken token, Object ldapPrincipal, Object ldapCredentials, - LdapContext ldapContext) throws NamingException { - return super.createAuthenticationInfo(token, ldapPrincipal, ldapCredentials, - ldapContext); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealm.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealm.java deleted file mode 100644 index f96eb8b22e..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealm.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.hadoop.gateway.shirorealm; - -import org.apache.shiro.authc.AuthenticationException; -import org.apache.shiro.authc.AuthenticationInfo; -import org.apache.shiro.authc.AuthenticationToken; -import org.apache.shiro.authz.AuthorizationInfo; -import org.apache.shiro.subject.PrincipalCollection; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.shirorealm.KnoxPamRealm} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.shirorealm.KnoxPamRealm} - */ -@Deprecated -public class KnoxPamRealm extends org.apache.knox.gateway.shirorealm.KnoxPamRealm { - public KnoxPamRealm() { - super(); - } - - @Override - protected AuthenticationInfo doGetAuthenticationInfo( - AuthenticationToken token) throws AuthenticationException { - return super.doGetAuthenticationInfo(token); - } - - @Override - protected AuthorizationInfo doGetAuthorizationInfo( - PrincipalCollection principals) { - return super.doGetAuthorizationInfo(principals); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/storm/StormDispatch.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/storm/StormDispatch.java deleted file mode 100644 index 7e1f28ad9b..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/storm/StormDispatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.hadoop.gateway.storm; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.storm.StormDispatch} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.storm.StormDispatch} - */ -@Deprecated -public class StormDispatch extends org.apache.knox.gateway.storm.StormDispatch { -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Service.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Service.java deleted file mode 100644 index 0dfb3fbaa4..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Service.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.hadoop.gateway.topology; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.topology.Service} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.topology.Service} - */ -@Deprecated -public class Service extends org.apache.knox.gateway.topology.Service { -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Topology.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Topology.java deleted file mode 100644 index 7498401885..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/topology/Topology.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.hadoop.gateway.topology; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.topology.Topology} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.topology.Topology} - */ -@Deprecated -public class Topology extends org.apache.knox.gateway.topology.Topology { - public Topology() { - super(); - } -} diff --git a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/util/RegExUtils.java b/gateway-adapter/src/main/java/org/apache/hadoop/gateway/util/RegExUtils.java deleted file mode 100644 index 3f0296814a..0000000000 --- a/gateway-adapter/src/main/java/org/apache/hadoop/gateway/util/RegExUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.hadoop.gateway.util; - -/** - * An adapter class that delegate calls to {@link org.apache.knox.gateway.util.RegExUtils} - * for backwards compatibility with package structure. - * - * @since 0.14.0 - * @deprecated Use {@link org.apache.knox.gateway.util.RegExUtils} - */ -@Deprecated -public class RegExUtils extends org.apache.knox.gateway.util.RegExUtils { -} diff --git a/gateway-adapter/src/main/resources/META-INF/launcher.cfg b/gateway-adapter/src/main/resources/META-INF/launcher.cfg deleted file mode 100644 index a9ffee5022..0000000000 --- a/gateway-adapter/src/main/resources/META-INF/launcher.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# 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. -main.class = org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer -class.path = ../lib/*.jar;../dep/*.jar;../ext;../ext/*.jar -log4j.configurationFile=${launcher.dir}/../conf/${launcher.name}-log4j2.xml diff --git a/gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealmTest.java b/gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealmTest.java deleted file mode 100644 index 8be53aae46..0000000000 --- a/gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxLdapRealmTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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.hadoop.gateway.shirorealm; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -@SuppressWarnings("deprecation") -public class KnoxLdapRealmTest { - @Test - public void setGetSearchBase() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setSearchBase("dc=hadoop,dc=apache,dc=org"); - assertEquals("dc=hadoop,dc=apache,dc=org", realm.getSearchBase()); - } - - @Test - public void setGetGroupObjectClass() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setGroupObjectClass("groupOfMembers"); - assertEquals("groupOfMembers", realm.getGroupObjectClass()); - } - - @Test - public void setGetUniqueMemberAttribute() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setMemberAttribute("member"); - assertEquals("member", realm.getMemberAttribute()); - } - - @Test - public void setGetUserSearchAttributeName() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setUserSearchAttributeName("uid"); - assertEquals("uid", realm.getUserSearchAttributeName()); - } - - @Test - public void setGetUserObjectClass() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setUserObjectClass("inetuser"); - assertEquals("inetuser", realm.getUserObjectClass()); - } - - @Test - public void setGetUserSearchBase() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setSearchBase("dc=example,dc=com"); - realm.setUserSearchBase("dc=knox,dc=example,dc=com"); - assertEquals(realm.getUserSearchBase(), "dc=knox,dc=example,dc=com"); - } - - @Test - public void setGetGroupSearchBase() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setSearchBase("dc=example,dc=com"); - realm.setGroupSearchBase("dc=knox,dc=example,dc=com"); - assertEquals("dc=knox,dc=example,dc=com", realm.getGroupSearchBase()); - } - - @Test - public void verifyDefaultUserSearchAttributeName() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - assertNull(realm.getUserSearchAttributeName()); - } - - @Test - public void verifyDefaultGetUserObjectClass() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - assertEquals("person", realm.getUserObjectClass()); - } - - @Test - public void verifyDefaultUserSearchBase() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setSearchBase("dc=knox,dc=example,dc=com"); - assertEquals("dc=knox,dc=example,dc=com", realm.getUserSearchBase()); - } - - @Test - public void verifyDefaultGroupSearchBase() { - KnoxLdapRealm realm = new KnoxLdapRealm(); - realm.setSearchBase("dc=knox,dc=example,dc=com"); - assertEquals("dc=knox,dc=example,dc=com", realm.getGroupSearchBase()); - } -} diff --git a/gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealmTest.java b/gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealmTest.java deleted file mode 100644 index a099534044..0000000000 --- a/gateway-adapter/src/test/java/org/apache/hadoop/gateway/shirorealm/KnoxPamRealmTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.hadoop.gateway.shirorealm; - -import org.junit.Test; - -import org.apache.shiro.authc.AuthenticationInfo; -import org.apache.shiro.authc.UsernamePasswordToken; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assume.assumeTrue; - -@SuppressWarnings("deprecation") -public class KnoxPamRealmTest { - @Test - public void setService() { - KnoxPamRealm realm = new KnoxPamRealm(); - realm.setService("knox-pam-os-service"); - assertEquals("knox-pam-os-service", realm.getService()); - } - - @Test - public void testDoGetAuthenticationInfo() { - KnoxPamRealm realm = new KnoxPamRealm(); - realm.setService("sshd"); // pam settings being used: /etc/pam.d/sshd - - // use environment variables and skip the test if not set. - String pamuser = System.getenv("PAMUSER"); - String pampass = System.getenv("PAMPASS"); - assumeTrue(pamuser != null); - assumeTrue(pampass != null); - - // mock shiro auth token - UsernamePasswordToken authToken = createMock(UsernamePasswordToken.class); - expect(authToken.getUsername()).andReturn(pamuser); - expect(authToken.getPassword()).andReturn(pampass.toCharArray()); - expect(authToken.getCredentials()).andReturn(pampass); - replay(authToken); - - // login - AuthenticationInfo authInfo = realm.doGetAuthenticationInfo(authToken); - - // verify success - assertNotNull(authInfo.getCredentials()); - } - - public static void main(String[] args) throws Exception { - KnoxPamRealmTest pamTest = new KnoxPamRealmTest(); - pamTest.testDoGetAuthenticationInfo(); - } -} diff --git a/gateway-release/pom.xml b/gateway-release/pom.xml index c8b7c74d42..babf0389e6 100644 --- a/gateway-release/pom.xml +++ b/gateway-release/pom.xml @@ -476,10 +476,6 @@ org.apache.knox gateway-discovery-cm - - org.apache.knox - gateway-adapter - org.apache.knox gateway-service-hashicorp-vault diff --git a/pom.xml b/pom.xml index 2cd80589c2..9ebba96904 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,6 @@ gateway-shell gateway-shell-launcher knox-cli-launcher - gateway-adapter hadoop-examples gateway-release gateway-test @@ -1325,11 +1324,6 @@ gateway-shell-launcher ${project.version} - - org.apache.knox - gateway-adapter - ${project.version} - org.apache.knox hadoop-examples