http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/server/DigestAuthHttpServerTest.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/server/DigestAuthHttpServerTest.java b/avatica/server/src/test/java/org/apache/calcite/avatica/server/DigestAuthHttpServerTest.java deleted file mode 100644 index 7277444..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/server/DigestAuthHttpServerTest.java +++ /dev/null @@ -1,176 +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.calcite.avatica.server; - -import org.apache.calcite.avatica.ConnectionSpec; -import org.apache.calcite.avatica.jdbc.JdbcMeta; -import org.apache.calcite.avatica.remote.Driver; -import org.apache.calcite.avatica.remote.LocalService; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import java.util.Properties; - -import static org.hamcrest.core.StringContains.containsString; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; - -/** - * Test class for HTTP Digest authentication. - */ -public class DigestAuthHttpServerTest extends HttpAuthBase { - - private static final ConnectionSpec CONNECTION_SPEC = ConnectionSpec.HSQLDB; - private static HttpServer server; - private static String url; - - @BeforeClass public static void startServer() throws Exception { - final String userPropertiesFile = BasicAuthHttpServerTest.class - .getResource("/auth-users.properties").getFile(); - assertNotNull("Could not find properties file for digest auth users", userPropertiesFile); - - // Create a LocalService around HSQLDB - final JdbcMeta jdbcMeta = new JdbcMeta(CONNECTION_SPEC.url, - CONNECTION_SPEC.username, CONNECTION_SPEC.password); - LocalService service = new LocalService(jdbcMeta); - - server = new HttpServer.Builder() - .withDigestAuthentication(userPropertiesFile, new String[] { "users" }) - .withHandler(service, Driver.Serialization.PROTOBUF) - .withPort(0) - .build(); - server.start(); - - url = "jdbc:avatica:remote:url=http://localhost:" + server.getPort() - + ";authentication=DIGEST;serialization=PROTOBUF"; - - // Create and grant permissions to our users - createHsqldbUsers(); - } - - @AfterClass public static void stopServer() throws Exception { - if (null != server) { - server.stop(); - } - } - - @Test public void testValidUser() throws Exception { - // Valid both with avatica and hsqldb - final Properties props = new Properties(); - props.put("avatica_user", "USER2"); - props.put("avatica_password", "password2"); - props.put("user", "USER2"); - props.put("password", "password2"); - - readWriteData(url, "VALID_USER", props); - } - - @Test public void testInvalidAvaticaValidDb() throws Exception { - // Valid both with avatica and hsqldb - final Properties props = new Properties(); - props.put("avatica_user", "USER2"); - props.put("avatica_password", "foobar"); - props.put("user", "USER2"); - props.put("password", "password2"); - - try { - readWriteData(url, "INVALID_AVATICA_VALID_DB", props); - fail("Expected a failure"); - } catch (RuntimeException e) { - assertThat(e.getMessage(), containsString("HTTP/401")); - } - } - - @Test public void testValidAvaticaNoDb() throws Exception { - // Valid both with avatica and hsqldb - final Properties props = new Properties(); - props.put("avatica_user", "USER2"); - props.put("avatica_password", "password2"); - - readWriteData(url, "VALID_AVATICA_NO_DB", props); - } - - @Test public void testInvalidAvaticaNoDb() throws Exception { - // Valid both with avatica and hsqldb - final Properties props = new Properties(); - props.put("avatica_user", "USER2"); - props.put("avatica_password", "foobar"); - - try { - readWriteData(url, "INVALID_AVATICA_NO_DB", props); - fail("Expected a failure"); - } catch (RuntimeException e) { - assertThat(e.getMessage(), containsString("HTTP/401")); - } - } - - @Test public void testInvalidUser() throws Exception { - // Invalid avatica user - final Properties props = new Properties(); - props.put("avatica_user", "foo"); - props.put("avatica_password", "bar"); - - try { - readWriteData(url, "INVALID_USER", props); - fail("Expected a failure"); - } catch (RuntimeException e) { - assertThat(e.getMessage(), containsString("HTTP/401")); - } - } - - @Test public void testUserWithDisallowedRole() throws Exception { - // User 4 is disallowed in avatica due to its roles - final Properties props = new Properties(); - props.put("avatica_user", "USER4"); - props.put("avatica_password", "password4"); - - try { - readWriteData(url, "DISALLOWED_USER", props); - fail("Expected a failure"); - } catch (RuntimeException e) { - assertThat(e.getMessage(), containsString("HTTP/403")); - } - } - - @Test public void testAllowedAvaticaDisabledHsqldbUser() throws Exception { - // Valid Avatica user, but an invalid database user - final Properties props = new Properties(); - props.put("avatica_user", "USER1"); - props.put("avatica_password", "password1"); - props.put("user", "USER1"); - props.put("password", "password1"); - - try { - readWriteData(url, "DISALLOWED_HSQLDB_USER", props); - fail("Expected a failure"); - } catch (RuntimeException e) { - assertEquals("Remote driver error: RuntimeException: " - + "java.sql.SQLInvalidAuthorizationSpecException: invalid authorization specification" - + " - not found: USER1" - + " -> SQLInvalidAuthorizationSpecException: invalid authorization specification - " - + "not found: USER1" - + " -> HsqlException: invalid authorization specification - not found: USER1", - e.getMessage()); - } - } -} - -// End DigestAuthHttpServerTest.java
http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/server/HandlerFactoryTest.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HandlerFactoryTest.java b/avatica/server/src/test/java/org/apache/calcite/avatica/server/HandlerFactoryTest.java deleted file mode 100644 index 3504e02..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HandlerFactoryTest.java +++ /dev/null @@ -1,58 +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.calcite.avatica.server; - -import org.apache.calcite.avatica.remote.Driver.Serialization; -import org.apache.calcite.avatica.remote.Service; - -import org.eclipse.jetty.server.Handler; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import static org.junit.Assert.assertTrue; - -/** - * Tests the {@link HandlerFactory} implementation. - */ -public class HandlerFactoryTest { - - private HandlerFactory factory; - private Service service; - - @Before - public void setup() { - this.factory = new HandlerFactory(); - this.service = Mockito.mock(Service.class); - } - - @Test - public void testJson() { - Handler handler = factory.getHandler(service, Serialization.JSON); - assertTrue("Expected an implementation of the AvaticaHandler, " - + "but got " + handler.getClass(), handler instanceof AvaticaJsonHandler); - } - - @Test - public void testProtobuf() { - Handler handler = factory.getHandler(service, Serialization.PROTOBUF); - assertTrue("Expected an implementation of the AvaticaProtobufHandler, " - + "but got " + handler.getClass(), handler instanceof AvaticaProtobufHandler); - } -} - -// End HandlerFactoryTest.java http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpAuthBase.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpAuthBase.java b/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpAuthBase.java deleted file mode 100644 index cfaf302..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpAuthBase.java +++ /dev/null @@ -1,80 +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.calcite.avatica.server; - -import org.apache.calcite.avatica.ConnectionSpec; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Properties; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -/** - * Common test logic for HTTP basic and digest auth - */ -public class HttpAuthBase { - - static boolean userExists(Statement stmt, String user) throws SQLException { - ResultSet results = stmt.executeQuery( - "SELECT * FROM INFORMATION_SCHEMA.SYSTEM_USERS WHERE USER_NAME = '" + user + "'"); - return results.next(); - } - - static void createHsqldbUsers() throws SQLException { - try (Connection conn = DriverManager.getConnection(ConnectionSpec.HSQLDB.url, - ConnectionSpec.HSQLDB.username, ConnectionSpec.HSQLDB.password); - Statement stmt = conn.createStatement()) { - for (int i = 2; i <= 5; i++) { - // Users 2-5 exist (not user1) - final String username = "USER" + i; - final String password = "password" + i; - if (userExists(stmt, username)) { - stmt.execute("DROP USER " + username); - } - stmt.execute("CREATE USER " + username + " PASSWORD '" + password + "'"); - // Grant permission to the user we create (defined in the scottdb hsqldb impl) - stmt.execute("GRANT DBA TO " + username); - } - } - } - - void readWriteData(String url, String tableName, Properties props) throws Exception { - try (Connection conn = DriverManager.getConnection(url, props); - Statement stmt = conn.createStatement()) { - assertFalse(stmt.execute("DROP TABLE IF EXISTS " + tableName)); - assertFalse(stmt.execute("CREATE TABLE " + tableName + " (pk integer, msg varchar(10))")); - - assertEquals(1, stmt.executeUpdate("INSERT INTO " + tableName + " VALUES(1, 'abcd')")); - assertEquals(1, stmt.executeUpdate("INSERT INTO " + tableName + " VALUES(2, 'bcde')")); - assertEquals(1, stmt.executeUpdate("INSERT INTO " + tableName + " VALUES(3, 'cdef')")); - - ResultSet results = stmt.executeQuery("SELECT count(1) FROM " + tableName); - assertNotNull(results); - assertTrue(results.next()); - assertEquals(3, results.getInt(1)); - } - } -} - -// End HttpAuthBase.java http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerBuilderTest.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerBuilderTest.java b/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerBuilderTest.java deleted file mode 100644 index 41bb88b..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerBuilderTest.java +++ /dev/null @@ -1,146 +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.calcite.avatica.server; - -import org.apache.calcite.avatica.remote.Driver.Serialization; -import org.apache.calcite.avatica.remote.Service; - -import org.junit.Test; -import org.mockito.Mockito; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertNull; - -/** - * Test class for {@link HttpServer}. - */ -public class HttpServerBuilderTest { - - @Test public void extraAllowedRolesConfigured() { - final String[] extraRoles = new String[] {"BAR.COM"}; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertArrayEquals(extraRoles, server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM", "BAR.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void lotsOfExtraRoles() { - final String[] extraRoles = new String[] {"BAR.COM", "BAZ.COM", "FOO.COM"}; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertArrayEquals(extraRoles, server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM", "BAR.COM", "BAZ.COM", "FOO.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void nullExtraRoles() { - final String[] extraRoles = null; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertNull(server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void emptyExtraRoles() { - final String[] extraRoles = new String[0]; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertArrayEquals(extraRoles, server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void extraAllowedRolesConfiguredWithExplitRealm() { - final String[] extraRoles = new String[] {"BAR.COM"}; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", "EXAMPLE.COM", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertArrayEquals(extraRoles, server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM", "BAR.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void lotsOfExtraRolesWithExplitRealm() { - final String[] extraRoles = new String[] {"BAR.COM", "BAZ.COM", "FOO.COM"}; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", "EXAMPLE.COM", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertArrayEquals(extraRoles, server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM", "BAR.COM", "BAZ.COM", "FOO.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void nullExtraRolesWithExplitRealm() { - final String[] extraRoles = null; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", "EXAMPLE.COM", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertNull(server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } - - @Test public void emptyExtraRolesWithExplitRealm() { - final String[] extraRoles = new String[0]; - final Service mockService = Mockito.mock(Service.class); - HttpServer server = new HttpServer.Builder() - .withSpnego("HTTP/[email protected]", "EXAMPLE.COM", extraRoles) - .withHandler(mockService, Serialization.JSON) - .build(); - - assertArrayEquals(extraRoles, server.getConfig().getAllowedRoles()); - - assertArrayEquals(new String[] {"EXAMPLE.COM"}, - server.getAllowedRealms("EXAMPLE.COM", server.getConfig())); - } -} - -// End HttpServerBuilderTest.java http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithJaasTest.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithJaasTest.java b/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithJaasTest.java deleted file mode 100644 index 8f6fede..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithJaasTest.java +++ /dev/null @@ -1,229 +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.calcite.avatica.server; - -import org.apache.calcite.avatica.SpnegoTestUtil; -import org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientSpnegoImpl; - -import org.apache.kerby.kerberos.kerb.KrbException; -import org.apache.kerby.kerberos.kerb.client.JaasKrbUtil; -import org.apache.kerby.kerberos.kerb.client.KrbConfig; -import org.apache.kerby.kerberos.kerb.client.KrbConfigKey; -import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; - -import org.ietf.jgss.GSSCredential; -import org.ietf.jgss.GSSManager; -import org.ietf.jgss.GSSName; -import org.ietf.jgss.Oid; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.security.Principal; -import java.security.PrivilegedExceptionAction; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosTicket; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -/** - * Test class for SPNEGO with Kerberos. Purely testing SPNEGO, not the Avatica "protocol" on top - * of that HTTP. This variant of the test requires that the user use JAAS configuration to - * perform server-side login. - */ -public class HttpServerSpnegoWithJaasTest { - private static final Logger LOG = LoggerFactory.getLogger(HttpServerSpnegoWithJaasTest.class); - - private static SimpleKdcServer kdc; - private static HttpServer httpServer; - - private static KrbConfig clientConfig; - - private static int kdcPort; - - private static File clientKeytab; - private static File serverKeytab; - - private static File serverSpnegoConfigFile; - - private static boolean isKdcStarted = false; - private static boolean isHttpServerStarted = false; - - private static URL httpServerUrl; - - @BeforeClass public static void setupKdc() throws Exception { - kdc = new SimpleKdcServer(); - File target = new File(System.getProperty("user.dir"), "target"); - assertTrue(target.exists()); - - File kdcDir = new File(target, HttpServerSpnegoWithJaasTest.class.getSimpleName()); - if (kdcDir.exists()) { - SpnegoTestUtil.deleteRecursively(kdcDir); - } - kdcDir.mkdirs(); - kdc.setWorkDir(kdcDir); - - kdc.setKdcHost(SpnegoTestUtil.KDC_HOST); - kdcPort = SpnegoTestUtil.getFreePort(); - kdc.setAllowTcp(true); - kdc.setAllowUdp(false); - kdc.setKdcTcpPort(kdcPort); - - LOG.info("Starting KDC server at {}:{}", SpnegoTestUtil.KDC_HOST, kdcPort); - - kdc.init(); - kdc.start(); - isKdcStarted = true; - - File keytabDir = new File(target, HttpServerSpnegoWithJaasTest.class.getSimpleName() - + "_keytabs"); - if (keytabDir.exists()) { - SpnegoTestUtil.deleteRecursively(keytabDir); - } - keytabDir.mkdirs(); - setupUsers(keytabDir); - - clientConfig = new KrbConfig(); - clientConfig.setString(KrbConfigKey.KDC_HOST, SpnegoTestUtil.KDC_HOST); - clientConfig.setInt(KrbConfigKey.KDC_TCP_PORT, kdcPort); - clientConfig.setString(KrbConfigKey.DEFAULT_REALM, SpnegoTestUtil.REALM); - - serverSpnegoConfigFile = new File(kdcDir, "server-spnego.conf"); - SpnegoTestUtil.writeSpnegoConf(serverSpnegoConfigFile, serverKeytab); - - // Kerby sets "java.security.krb5.conf" for us! - System.setProperty("java.security.auth.login.config", serverSpnegoConfigFile.toString()); - // http://docs.oracle.com/javase/7/docs/technotes/guides/security/jgss/... - // tutorials/BasicClientServer.html#useSub - System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); - //System.setProperty("sun.security.spnego.debug", "true"); - //System.setProperty("sun.security.krb5.debug", "true"); - - // Create and start an HTTP server configured only to allow SPNEGO requests - // We're not using `withAutomaticLogin(File)` which means we're relying on JAAS to log the - // server in. - httpServer = new HttpServer.Builder() - .withPort(0) - .withSpnego(SpnegoTestUtil.SERVER_PRINCIPAL, SpnegoTestUtil.REALM) - .withHandler(new SpnegoTestUtil.AuthenticationRequiredAvaticaHandler()) - .build(); - httpServer.start(); - isHttpServerStarted = true; - - httpServerUrl = new URL("http://" + SpnegoTestUtil.KDC_HOST + ":" + httpServer.getPort()); - LOG.info("HTTP server running at {}", httpServerUrl); - - SpnegoTestUtil.refreshJaasConfiguration(); - } - - @AfterClass public static void stopKdc() throws Exception { - if (isHttpServerStarted) { - LOG.info("Stopping HTTP server at {}", httpServerUrl); - httpServer.stop(); - } - - if (isKdcStarted) { - LOG.info("Stopping KDC on {}", kdcPort); - kdc.stop(); - } - } - - private static void setupUsers(File keytabDir) throws KrbException { - String clientPrincipal = SpnegoTestUtil.CLIENT_PRINCIPAL.substring(0, - SpnegoTestUtil.CLIENT_PRINCIPAL.indexOf('@')); - clientKeytab = new File(keytabDir, clientPrincipal.replace('/', '_') + ".keytab"); - if (clientKeytab.exists()) { - SpnegoTestUtil.deleteRecursively(clientKeytab); - } - LOG.info("Creating {} with keytab {}", clientPrincipal, clientKeytab); - SpnegoTestUtil.setupUser(kdc, clientKeytab, clientPrincipal); - - String serverPrincipal = SpnegoTestUtil.SERVER_PRINCIPAL.substring(0, - SpnegoTestUtil.SERVER_PRINCIPAL.indexOf('@')); - serverKeytab = new File(keytabDir, serverPrincipal.replace('/', '_') + ".keytab"); - if (serverKeytab.exists()) { - SpnegoTestUtil.deleteRecursively(serverKeytab); - } - LOG.info("Creating {} with keytab {}", SpnegoTestUtil.SERVER_PRINCIPAL, serverKeytab); - SpnegoTestUtil.setupUser(kdc, serverKeytab, SpnegoTestUtil.SERVER_PRINCIPAL); - } - - @Test public void testNormalClientsDisallowed() throws Exception { - LOG.info("Connecting to {}", httpServerUrl.toString()); - HttpURLConnection conn = (HttpURLConnection) httpServerUrl.openConnection(); - conn.setRequestMethod("GET"); - // Authentication should fail because we didn't provide anything - assertEquals(401, conn.getResponseCode()); - } - - @Test public void testAuthenticatedClientsAllowed() throws Exception { - // Create the subject for the client - final Subject clientSubject = JaasKrbUtil.loginUsingKeytab(SpnegoTestUtil.CLIENT_PRINCIPAL, - clientKeytab); - final Set<Principal> clientPrincipals = clientSubject.getPrincipals(); - // Make sure the subject has a principal - assertFalse(clientPrincipals.isEmpty()); - - // Get a TGT for the subject (might have many, different encryption types). The first should - // be the default encryption type. - Set<KerberosTicket> privateCredentials = - clientSubject.getPrivateCredentials(KerberosTicket.class); - assertFalse(privateCredentials.isEmpty()); - KerberosTicket tgt = privateCredentials.iterator().next(); - assertNotNull(tgt); - LOG.info("Using TGT with etype: {}", tgt.getSessionKey().getAlgorithm()); - - // The name of the principal - final String principalName = clientPrincipals.iterator().next().getName(); - - // Run this code, logged in as the subject (the client) - byte[] response = Subject.doAs(clientSubject, new PrivilegedExceptionAction<byte[]>() { - @Override public byte[] run() throws Exception { - // Logs in with Kerberos via GSS - GSSManager gssManager = GSSManager.getInstance(); - Oid oid = new Oid(SpnegoTestUtil.JGSS_KERBEROS_TICKET_OID); - GSSName gssClient = gssManager.createName(principalName, GSSName.NT_USER_NAME); - GSSCredential credential = gssManager.createCredential(gssClient, - GSSCredential.DEFAULT_LIFETIME, oid, GSSCredential.INITIATE_ONLY); - - // Passes the GSSCredential into the HTTP client implementation - final AvaticaCommonsHttpClientSpnegoImpl httpClient = - new AvaticaCommonsHttpClientSpnegoImpl(httpServerUrl, credential); - - return httpClient.send(new byte[0]); - } - }); - - // We should get a response which is "OK" with our client's name - assertNotNull(response); - assertEquals("OK " + SpnegoTestUtil.CLIENT_PRINCIPAL, - new String(response, StandardCharsets.UTF_8)); - } -} - -// End HttpServerSpnegoWithJaasTest.java http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithoutJaasTest.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithoutJaasTest.java b/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithoutJaasTest.java deleted file mode 100644 index d30b760..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/server/HttpServerSpnegoWithoutJaasTest.java +++ /dev/null @@ -1,220 +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.calcite.avatica.server; - -import org.apache.calcite.avatica.SpnegoTestUtil; -import org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientSpnegoImpl; - -import org.apache.kerby.kerberos.kerb.KrbException; -import org.apache.kerby.kerberos.kerb.client.JaasKrbUtil; -import org.apache.kerby.kerberos.kerb.client.KrbConfig; -import org.apache.kerby.kerberos.kerb.client.KrbConfigKey; -import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; - -import org.ietf.jgss.GSSCredential; -import org.ietf.jgss.GSSManager; -import org.ietf.jgss.GSSName; -import org.ietf.jgss.Oid; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.security.Principal; -import java.security.PrivilegedExceptionAction; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosTicket; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -/** - * Test class for SPNEGO with Kerberos. Purely testing SPNEGO, not the Avatica "protocol" on top - * of that HTTP. This variant of the test relies on the "feature" Avatica provides to not require - * JAAS configuration by the user. - */ -public class HttpServerSpnegoWithoutJaasTest { - private static final Logger LOG = LoggerFactory.getLogger(HttpServerSpnegoWithoutJaasTest.class); - - private static SimpleKdcServer kdc; - private static HttpServer httpServer; - - private static KrbConfig clientConfig; - - private static int kdcPort; - - private static File clientKeytab; - private static File serverKeytab; - - private static boolean isKdcStarted = false; - private static boolean isHttpServerStarted = false; - - private static URL httpServerUrl; - - @BeforeClass public static void setupKdc() throws Exception { - kdc = new SimpleKdcServer(); - File target = new File(System.getProperty("user.dir"), "target"); - assertTrue(target.exists()); - - File kdcDir = new File(target, HttpServerSpnegoWithoutJaasTest.class.getSimpleName()); - if (kdcDir.exists()) { - SpnegoTestUtil.deleteRecursively(kdcDir); - } - kdcDir.mkdirs(); - kdc.setWorkDir(kdcDir); - - kdc.setKdcHost(SpnegoTestUtil.KDC_HOST); - kdcPort = SpnegoTestUtil.getFreePort(); - kdc.setAllowTcp(true); - kdc.setAllowUdp(false); - kdc.setKdcTcpPort(kdcPort); - - LOG.info("Starting KDC server at {}:{}", SpnegoTestUtil.KDC_HOST, kdcPort); - - kdc.init(); - kdc.start(); - isKdcStarted = true; - - File keytabDir = new File(target, HttpServerSpnegoWithoutJaasTest.class.getSimpleName() - + "_keytabs"); - if (keytabDir.exists()) { - SpnegoTestUtil.deleteRecursively(keytabDir); - } - keytabDir.mkdirs(); - setupUsers(keytabDir); - - clientConfig = new KrbConfig(); - clientConfig.setString(KrbConfigKey.KDC_HOST, SpnegoTestUtil.KDC_HOST); - clientConfig.setInt(KrbConfigKey.KDC_TCP_PORT, kdcPort); - clientConfig.setString(KrbConfigKey.DEFAULT_REALM, SpnegoTestUtil.REALM); - - // Kerby sets "java.security.krb5.conf" for us! - System.clearProperty("java.security.auth.login.config"); - System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); - //System.setProperty("sun.security.spnego.debug", "true"); - //System.setProperty("sun.security.krb5.debug", "true"); - - // Create and start an HTTP server configured only to allow SPNEGO requests - // We use `withAutomaticLogin(File)` here which should invalidate the need to do JAAS config - httpServer = new HttpServer.Builder() - .withPort(0) - .withAutomaticLogin(serverKeytab) - .withSpnego(SpnegoTestUtil.SERVER_PRINCIPAL, SpnegoTestUtil.REALM) - .withHandler(new SpnegoTestUtil.AuthenticationRequiredAvaticaHandler()) - .build(); - httpServer.start(); - isHttpServerStarted = true; - - httpServerUrl = new URL("http://" + SpnegoTestUtil.KDC_HOST + ":" + httpServer.getPort()); - LOG.info("HTTP server running at {}", httpServerUrl); - } - - @AfterClass public static void stopKdc() throws Exception { - if (isHttpServerStarted) { - LOG.info("Stopping HTTP server at {}", httpServerUrl); - httpServer.stop(); - } - - if (isKdcStarted) { - LOG.info("Stopping KDC on {}", kdcPort); - kdc.stop(); - } - } - - private static void setupUsers(File keytabDir) throws KrbException { - String clientPrincipal = SpnegoTestUtil.CLIENT_PRINCIPAL.substring(0, - SpnegoTestUtil.CLIENT_PRINCIPAL.indexOf('@')); - clientKeytab = new File(keytabDir, clientPrincipal.replace('/', '_') + ".keytab"); - if (clientKeytab.exists()) { - SpnegoTestUtil.deleteRecursively(clientKeytab); - } - LOG.info("Creating {} with keytab {}", clientPrincipal, clientKeytab); - SpnegoTestUtil.setupUser(kdc, clientKeytab, clientPrincipal); - - String serverPrincipal = SpnegoTestUtil.SERVER_PRINCIPAL.substring(0, - SpnegoTestUtil.SERVER_PRINCIPAL.indexOf('@')); - serverKeytab = new File(keytabDir, serverPrincipal.replace('/', '_') + ".keytab"); - if (serverKeytab.exists()) { - SpnegoTestUtil.deleteRecursively(serverKeytab); - } - LOG.info("Creating {} with keytab {}", SpnegoTestUtil.SERVER_PRINCIPAL, serverKeytab); - SpnegoTestUtil.setupUser(kdc, serverKeytab, SpnegoTestUtil.SERVER_PRINCIPAL); - } - - @Test public void testNormalClientsDisallowed() throws Exception { - LOG.info("Connecting to {}", httpServerUrl.toString()); - HttpURLConnection conn = (HttpURLConnection) httpServerUrl.openConnection(); - conn.setRequestMethod("GET"); - // Authentication should fail because we didn't provide anything - assertEquals(401, conn.getResponseCode()); - } - - @Test public void testAuthenticatedClientsAllowed() throws Exception { - // Create the subject for the client - final Subject clientSubject = JaasKrbUtil.loginUsingKeytab(SpnegoTestUtil.CLIENT_PRINCIPAL, - clientKeytab); - final Set<Principal> clientPrincipals = clientSubject.getPrincipals(); - // Make sure the subject has a principal - assertFalse(clientPrincipals.isEmpty()); - - // Get a TGT for the subject (might have many, different encryption types). The first should - // be the default encryption type. - Set<KerberosTicket> privateCredentials = - clientSubject.getPrivateCredentials(KerberosTicket.class); - assertFalse(privateCredentials.isEmpty()); - KerberosTicket tgt = privateCredentials.iterator().next(); - assertNotNull(tgt); - LOG.info("Using TGT with etype: {}", tgt.getSessionKey().getAlgorithm()); - - // The name of the principal - final String principalName = clientPrincipals.iterator().next().getName(); - - // Run this code, logged in as the subject (the client) - byte[] response = Subject.doAs(clientSubject, new PrivilegedExceptionAction<byte[]>() { - @Override public byte[] run() throws Exception { - // Logs in with Kerberos via GSS - GSSManager gssManager = GSSManager.getInstance(); - Oid oid = new Oid(SpnegoTestUtil.JGSS_KERBEROS_TICKET_OID); - GSSName gssClient = gssManager.createName(principalName, GSSName.NT_USER_NAME); - GSSCredential credential = gssManager.createCredential(gssClient, - GSSCredential.DEFAULT_LIFETIME, oid, GSSCredential.INITIATE_ONLY); - - // Passes the GSSCredential into the HTTP client implementation - final AvaticaCommonsHttpClientSpnegoImpl httpClient = - new AvaticaCommonsHttpClientSpnegoImpl(httpServerUrl, credential); - - return httpClient.send(new byte[0]); - } - }); - - // We should get a response which is "OK" with our client's name - assertNotNull(response); - assertEquals("OK " + SpnegoTestUtil.CLIENT_PRINCIPAL, - new String(response, StandardCharsets.UTF_8)); - } -} - -// End HttpServerSpnegoWithoutJaasTest.java http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/java/org/apache/calcite/avatica/test/AvaticaSuite.java ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/java/org/apache/calcite/avatica/test/AvaticaSuite.java b/avatica/server/src/test/java/org/apache/calcite/avatica/test/AvaticaSuite.java deleted file mode 100644 index 4a0c26c..0000000 --- a/avatica/server/src/test/java/org/apache/calcite/avatica/test/AvaticaSuite.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.calcite.avatica.test; - -import org.apache.calcite.avatica.RemoteDriverTest; - -import org.junit.runner.RunWith; - -import org.junit.runners.Suite; - -/** - * Avatica test suite. - */ -@RunWith(Suite.class) [email protected]({ - AvaticaUtilsTest.class, - ConnectStringParserTest.class, - RemoteDriverTest.class -}) -public class AvaticaSuite { -} - -// End AvaticaSuite.java http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/resources/auth-users.properties ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/resources/auth-users.properties b/avatica/server/src/test/resources/auth-users.properties deleted file mode 100644 index be19e02..0000000 --- a/avatica/server/src/test/resources/auth-users.properties +++ /dev/null @@ -1,20 +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. - -USER1: password1,role1,users -USER2: password2,role2,users -USER3: password3,role3,users -USER4: password4,role4,admins -USER5: password5,role5,admins http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/server/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/avatica/server/src/test/resources/log4j.properties b/avatica/server/src/test/resources/log4j.properties deleted file mode 100644 index 662858e..0000000 --- a/avatica/server/src/test/resources/log4j.properties +++ /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. - -# Root logger is configured at INFO and is sent to A1 -log4j.rootLogger=INFO, A1 - -# A1 goes to the console -log4j.appender.A1=org.apache.log4j.ConsoleAppender - -# Set the pattern for each log message -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p - %m%n - -# Debug for JGSS and Jetty's security (Kerberos/SPNEGO debugging) -#log4j.logger.sun.security.jgss=DEBUG -#log4j.logger.org.eclipse.jetty.security=DEBUG \ No newline at end of file http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/shaded/core/pom.xml ---------------------------------------------------------------------- diff --git a/avatica/shaded/core/pom.xml b/avatica/shaded/core/pom.xml deleted file mode 100644 index e5a963d..0000000 --- a/avatica/shaded/core/pom.xml +++ /dev/null @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.calcite.avatica</groupId> - <artifactId>avatica-parent</artifactId> - <version>1.10.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>avatica</artifactId> - <packaging>jar</packaging> - <name>Apache Calcite Avatica (Shaded)</name> - <description>JDBC driver framework.</description> - - <properties> - <top.dir>${project.basedir}/../..</top.dir> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.calcite.avatica</groupId> - <artifactId>avatica-core</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <artifactId>maven-dependency-plugin</artifactId> - <version>${maven-dependency-plugin.version}</version> - <executions> - <execution> - <id>analyze</id> - <goals> - <goal>analyze-only</goal> - </goals> - <configuration> - <!-- ignore "unused but declared" warnings --> - <ignoredUnusedDeclaredDependencies> - <ignoredUnusedDeclaredDependency>org.apache.calcite.avatica:avatica-core</ignoredUnusedDeclaredDependency> - </ignoredUnusedDeclaredDependencies> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <relocations> - <relocation> - <pattern>com.fasterxml.jackson</pattern> - <shadedPattern>org.apache.calcite.avatica.com.fasterxml.jackson</shadedPattern> - </relocation> - <relocation> - <pattern>com.google.protobuf</pattern> - <shadedPattern>org.apache.calcite.avatica.com.google.protobuf</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.http</pattern> - <shadedPattern>org.apache.calcite.avatica.org.apache.http</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.commons</pattern> - <shadedPattern>org.apache.calcite.avatica.org.apache.commons</shadedPattern> - </relocation> - </relocations> - <createDependencyReducedPom>false</createDependencyReducedPom> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> - <addHeader>false</addHeader> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer"> - <resources> - <resource>LICENSE.txt</resource> - </resources> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/shaded/core/src/main/resources/META-INF/LICENSE ---------------------------------------------------------------------- diff --git a/avatica/shaded/core/src/main/resources/META-INF/LICENSE b/avatica/shaded/core/src/main/resources/META-INF/LICENSE deleted file mode 100644 index e7e81b8..0000000 --- a/avatica/shaded/core/src/main/resources/META-INF/LICENSE +++ /dev/null @@ -1,257 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. - - - - - ------------------------------------------------------------------------ - -APACHE CALCITE AVATICA SUBCOMPONENTS: - -The Apache Calcite Avatica project contains subcomponents with separate copyright -notices and license terms. Your use of the source code for the these -subcomponents is subject to the terms and conditions of the following -licenses. - ------------------------------------------------------------------------ - 3-clause BSD license ------------------------------------------------------------------------ - -The Apache Calcite Avatica project bundles Protocol Buffers, which is available -under the following "3-clause BSD" license: - - Copyright 2014, Google Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, are permitted provided that the following - conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Code generated by the Protocol Buffer compiler is owned by the owner - of the input file used when generating it. This code is not - standalone and requires a support library to be linked with it. This - support library is itself covered by the above license. http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/.gitignore ---------------------------------------------------------------------- diff --git a/avatica/site/.gitignore b/avatica/site/.gitignore deleted file mode 100644 index 09c86a2..0000000 --- a/avatica/site/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.sass-cache -Gemfile.lock http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/Gemfile ---------------------------------------------------------------------- diff --git a/avatica/site/Gemfile b/avatica/site/Gemfile deleted file mode 100644 index 5425d95..0000000 --- a/avatica/site/Gemfile +++ /dev/null @@ -1,20 +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. -# -source 'https://rubygems.org' -gem 'github-pages', '67' -gem 'rouge' -gem 'jekyll-oembed', :require => 'jekyll_oembed' -# End Gemfile http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/README.md ---------------------------------------------------------------------- diff --git a/avatica/site/README.md b/avatica/site/README.md deleted file mode 100644 index bd80bf1..0000000 --- a/avatica/site/README.md +++ /dev/null @@ -1,51 +0,0 @@ -<!-- -{% comment %} -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. -{% endcomment %} ---> - -# Apache Calcite Avatica site - -This directory contains the code for the -[Avatica web site](https://calcite.apache.org/avatica), -a sub-directory of the -[Apache Calcite web site](https://calcite.apache.org). - -## Setup - -1. Set up Calcite web site as described in its - [README](../site/README.md). - -## Add javadoc - -1. `cd avatica` -2. `mvn -DskipTests site` -3. `rm -rf ../site/target/avatica/apidocs ../site/target/avatica/testapidocs` -4. `mv target/site/apidocs target/site/testapidocs ../site/target/avatica` - -## Running locally - -Before opening a pull request, you can preview your contributions by -running from within the directory: - -1. `bundle exec jekyll serve` -2. Open [http://localhost:4000/avatica](http://localhost:4000/avatica) - -## Pushing to site - -Push the Calcite site, which includes `avatica` as a sub-directory, -as described in its -[README](../site/README.md). http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/_config.yml ---------------------------------------------------------------------- diff --git a/avatica/site/_config.yml b/avatica/site/_config.yml deleted file mode 100644 index 4d58d3e..0000000 --- a/avatica/site/_config.yml +++ /dev/null @@ -1,46 +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. -# -markdown: kramdown -permalink: /news/:year/:month/:day/:title/ -excerpt_separator: "" - -repository: https://github.com/apache/calcite -destination: ../../site/target/avatica -exclude: [README.md,Gemfile*] -keep_files: [".git", ".svn", "apidocs", "testapidocs"] - -collections: - docs: - output: true - -# The URL where the code can be found -sourceRoot: https://github.com/apache/calcite/tree/master/avatica - -# The URL where Avatica Javadocs are located -apiRoot: /avatica/apidocs -# apiRoot: http://calcite.apache.org/avatica/apidocs - -# The URL where Test Javadocs are located -testApiRoot: /avatica/testapidocs -# testApiRoot: http://calcite.apache.org/avatica/testapidocs - -# The URL where the JDK's Javadocs are located -jdkApiRoot: https://docs.oracle.com/javase/8/docs/api/ - -# The base path where the website is deployed -baseurl: /avatica - -# End _config.yml http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/_data/contributors.yml ---------------------------------------------------------------------- diff --git a/avatica/site/_data/contributors.yml b/avatica/site/_data/contributors.yml deleted file mode 100644 index fb3e09b..0000000 --- a/avatica/site/_data/contributors.yml +++ /dev/null @@ -1,121 +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. -# -# Database of contributors to Apache Calcite. -# Pages such as developer.md use this data. -# -- name: Alan Gates - apacheId: gates - githubId: alanfgates - org: Hortonworks - role: PMC -- name: Aman Sinha - apacheId: amansinha - githubId: amansinha100 - org: MapR - role: PMC -- name: Ashutosh Chauhan - apacheId: hashutosh - githubId: ashutoshc - org: Hortonworks - role: PMC -- name: Francis Chuang - apacheId: francischuang - githubId: F21 - org: Boostport - role: Committer -- name: James R. Taylor - apacheId: jamestaylor - githubId: JamesRTaylor - org: Salesforce - role: PMC -- name: Jacques Nadeau - apacheId: jacques - githubId: jacques-n - org: Dremio - role: PMC -- name: Jesús Camacho RodrÃguez - apacheId: jcamacho - githubId: jcamachor - org: Hortonworks - role: PMC Chair -- name: Jinfeng Ni - apacheId: jni - githubId: jinfengni - org: MapR - role: PMC -- name: John Pullokkaran - apacheId: jpullokk - githubId: jpullokkaran - org: Hortonworks - role: PMC -- name: Josh Elser - apacheId: elserj - githubId: joshelser - org: Hortonworks - role: PMC -- name: Julian Hyde - apacheId: jhyde - githubId: julianhyde - org: Hortonworks - role: PMC - homepage: http://people.apache.org/~jhyde -- name: Maryann Xue - apacheId: maryannxue - githubId: maryannxue - org: Intel - role: Committer -- name: Michael Mior - apacheId: mmior - githubId: michaelmior - org: University of Waterloo - role: Committer - homepage: http://michael.mior.ca/ -- name: Milinda Pathirage - apacheId: milinda - githubId: milinda - org: Indiana University - role: Committer - homepage: http://milinda.pathirage.org/ -- name: MinJi Kim - apacheId: minji - githubId: minji-kim - org: Dremio - role: Committer - avatar: http://web.mit.edu/minjikim/www/minji.png - homepage: http://web.mit.edu/minjikim/www/ -- name: Nick Dimiduk - apacheId: ndimiduk - githubId: ndimiduk - org: Hortonworks - role: PMC - homepage: http://www.n10k.com -- name: Steven Noels - apacheId: stevenn - githubId: stevenn - org: NGData - role: PMC -- name: Ted Dunning - apacheId: tdunning - githubId: tdunning - org: MapR - role: PMC - avatar: https://www.mapr.com/sites/default/files/otherpageimages/ted-circle-80.png -- name: Vladimir Sitnikov - apacheId: vladimirsitnikov - githubId: vlsi - org: NetCracker - role: PMC -# End contributors.yml http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/_data/docs.yml ---------------------------------------------------------------------- diff --git a/avatica/site/_data/docs.yml b/avatica/site/_data/docs.yml deleted file mode 100644 index 276edad..0000000 --- a/avatica/site/_data/docs.yml +++ /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. -# -# Data that defines menu structure -# -- title: Overview - docs: - - index - - roadmap - -- title: Reference - docs: - - client_reference - - json_reference - - protobuf_reference - - howto - - security - - compatibility - - custom_client_artifacts - -- title: Meta - docs: - - history - - api - - testapi -# End docs.yml http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/_docs/api.md ---------------------------------------------------------------------- diff --git a/avatica/site/_docs/api.md b/avatica/site/_docs/api.md deleted file mode 100644 index 54b23c3..0000000 --- a/avatica/site/_docs/api.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: API -layout: external -external_url: http://calcite.apache.org/avatica/apidocs ---- -{% comment %} -Ideally, we want to use {{ site.apiRoot }} instead of hardcoding -the above external_url value, but I don't believe there's a way to do that -{% endcomment %} - -<!-- -{% comment %} -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. -{% endcomment %} ---> http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/_docs/client_reference.md ---------------------------------------------------------------------- diff --git a/avatica/site/_docs/client_reference.md b/avatica/site/_docs/client_reference.md deleted file mode 100644 index f49372a..0000000 --- a/avatica/site/_docs/client_reference.md +++ /dev/null @@ -1,174 +0,0 @@ ---- -layout: docs -title: Client Reference -sidebar_title: Client Reference -permalink: /docs/client_reference.html ---- - -<!-- -{% comment %} -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. -{% endcomment %} ---> - -Avatica provides a reference-implementation client in the form of a Java -JDBC client that interacts with the Avatica server over HTTP. This client -can be used just as any other JDBC driver. There are a number of options -that are available for clients to specify via the JDBC connection URL. - -As a reminder, the JDBC connection URL for Avatica is: - - `jdbc:avatica:remote:[option=value[;option=value]]` - -The following are a list of supported options: - -{% comment %} -It's a shame that we have to embed HTML to get the anchors but the normal -header tags from kramdown screw up the definition list. We lose the pretty -on-hover images for the permalink, but oh well. -{% endcomment %} - -<strong><a name="url" href="#url">url</a></strong> - -: _Description_: This property is a URL which refers to the location of the - Avatica Server which the driver will communicate with. - -: _Default_: This property's default value is `null`. It is required that the - user provides a value for this property. - -: _Required_: Yes. - - -<strong><a name="serialization" href="#serialization">serialization</a></strong> - -: _Description_: Avatica supports multiple types of serialization mechanisms - to format data between the client and server. This property is used to ensure - that the client and server both use the same serialization mechanism. Valid - values presently include `json` and `protobuf`. - -: _Default_: `json` is the default value. - -: _Required_: No. - - -<strong><a name="authentication" href="#authentication">authentication</a></strong> - -: _Description_: Avatica clients can specify the means in which it authenticates - with the Avatica server. Clients who want to use a specific form - of authentication should specify the appropriate value in this property. Valid - values for this property are presently: `NONE`, `BASIC`, `DIGEST`, and `SPNEGO`. - -: _Default_: `null` (implying "no authentication", equivalent to `NONE`). - -: _Required_: No. - - -<strong><a name="timeZone" href="#timeZone">timeZone</a></strong> - -: _Description_: The timezone that will be used for dates and times. Valid values for this - property are defined by [RFC 822](https://www.ietf.org/rfc/rfc0822.txt), for - example: `GMT`, `GMT-3`, `EST` or `PDT`. - -: _Default_: This property's default value is `null` which will cause the Avatica Driver to - use the default timezone as specified by the JVM, commonly overriden by the - `user.timezone` system property. - -: _Required_: No. - - -<strong><a name="httpclient-factory" href="#httpclient-factory">httpclient_factory</a></strong> - -: _Description_: The Avatica client is a "fancy" HTTP client. As such, there are - many libraries and APIs available for making HTTP calls. To determine which implementation - should be used, there is an interface `AvaticaHttpClientFactory` which can be provided - to control how the `AvaticaHttpClient` implementation is chosen. - -: _Default_: `AvaticaHttpClientFactoryImpl`. - -: _Required_: No. - - -<strong><a name="httpclient-impl" href="#httpclient-impl">httpclient_impl</a></strong> - -: _Description_: When using the default `AvaticaHttpClientFactoryImpl` HTTP client factory - implementation, this factory should choose the correct client implementation for the - given client configuration. This property can be used to override the specific HTTP - client implementation. If it is not provided, the `AvaticaHttpClientFactoryImpl` will - automatically choose the HTTP client implementation. - -: _Default_: `null`. - -: _Required_: No. - -<strong><a name="avatica-user" href="#avatica-user">avatica_user</a></strong> - -: _Description_: This is the username used by an Avatica client to identify itself - to the Avatica server. It is unique to the traditional "user" JDBC property. It - is only necessary if Avatica is configured for HTTP Basic or Digest authentication. - -: _Default_: `null`. - -: _Required_: No. - -<strong><a name="avatica-password" href="#avatica-password">avatica_password</a></strong> - -: _Description_: This is the password used by an Avatica client to identify itself - to the Avatica server. It is unique to the traditional "password" JDBC property. It - is only necessary if Avatica is configured for HTTP Basic or Digest authentication. - -: _Default_: `null`. - -: _Required_: No. - -<strong><a name="principal" href="#principal">principal</a></strong> - -: _Description_: The Kerberos principal which can be used by the Avatica JDBC Driver - to automatically perform a Kerberos login before attempting to contact the Avatica - server. If this property is provided, it is also expected that `keytab` is provided - and that the Avatica server is configured for SPNEGO authentication. Users can perform - their own Kerberos login; this option is provided only as a convenience. - -: _Default_: `null`. - -: _Required_: No. - -<strong><a name="keytab" href="#keytab">keytab</a></strong> - -: _Description_: The Kerberos keytab which contains the secret material to perform - a Kerberos login with the `principal`. The value should be a path on the local - filesystem to a regular file. - -: _Default_: `null`. - -: _Required_: No. - -<strong><a name="truststore" href="#truststore">truststore</a></strong> - -: _Description_: A path to a Java KeyStore (JKS) file on the local filesystem - which contains the certificate authority to trust in a TLS handshake. Only - necessary when using HTTPS. - -: _Default_: `null`. - -: _Required_: No. - -<strong><a name="truststore_password" href="#truststore_password">truststore_password</a></strong> - -: _Description_: The password for the Java KeyStore file specified by <a href="#truststore">truststore</a>. - -: _Default_: `null`. - -: _Required_: Only if `truststore` was provided. http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/fc7b26c8/avatica/site/_docs/compatibility.md ---------------------------------------------------------------------- diff --git a/avatica/site/_docs/compatibility.md b/avatica/site/_docs/compatibility.md deleted file mode 100644 index 18ae3a6..0000000 --- a/avatica/site/_docs/compatibility.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -layout: docs -title: Compatibility -sidebar_title: Compatibility -permalink: /docs/compatibility.html ---- - -<!-- -{% comment %} -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. -{% endcomment %} ---> - -Given Avatica's client-server model, it is no surprise that compatibility is -important to the users and developers of Apache Calcite Avatica. This document -defines what guarantees are made by Avatica with respect to compatibility -between Avatica client and server across versions. This document is still a work -in progress with many areas still requiring definition. Contributions are always -welcome. - -## Avatica Technology Compatibility Kit (TCK) - -The [Avatica TCK project][github-tck] is a framework designed to automatically -test an Avatica client against an Avatica server. A collection of JUnit tests, -a YAML configuration file, and a Ruby script defines the TCK. -The JUnit tests invoke specific portions of both the client and -server components of Avatica to verify that they work as expected. The Ruby -script uses the YAML configuration file to define the set of -client and server version pairs to run the JUnit tests against. - -In the YAML configuration file, a name (e.g. `1.6.0`) and the following three -items define an Avatica version: - -1. A filesystem path to an Avatica client jar (e.g. groupId=org.apache.calcite.avatica, artifactId=avatica) -2. A URL to a running instance of an Avatica server -3. A JDBC URL template to the Avatica server for the Avatica client JDBC driver. - -Users of the TCK define the collection of versions (defined by the above -information) and the location of the [avatica-tck][github-tck] jar by a YAML -configuration file. An [example YAML configuration file][github-tck-yml-file] is -bundled with the project. - -Traditionally, Avatica does not provide any implementation of the Avatica server -as the value in Avatica is recognized in the integrating project (e.g. Apache -Drill or Apache Phoenix). However, for the purposes of compatibility testing, it -makes sense that Avatica provides a standalone server instance. A new artifact -is introduced to Avatica with the original TCK codebase called -[avatica-standalone-server][github-standalone-server]. This artifact is a -runnable jar (e.g. `java -jar`) which starts an instance of the Avatica server -on a random port using the in-memory [HSQLDB database](http://hsqldb.org/). This -artifacts makes it extremely simple to start a version of the Avatica server for -the specific version of Avatica to be tested. - -As mentioned, the Ruby script is the entry point for the TCK. Invoking the Ruby -script which prints a summary of testing each specified version against itself and -all other versions in the YAML configuration. An example summary is presented -below which is the result of testing versions 1.6.0, 1.7.1 and 1.8.0-SNAPSHOT: - -``` -Summary: - -Identity test scenarios (ran 3) - -Testing identity for version v1.6.0: Passed -Testing identity for version v1.7.1: Passed -Testing identity for version v1.8.0-SNAPSHOT: Failed - -All test scenarios (ran 6) - -Testing client v1.6.0 against server v1.7.1: Passed -Testing client v1.6.0 against server v1.8.0-SNAPSHOT: Failed -Testing client v1.7.1 against server v1.6.0: Passed -Testing client v1.7.1 against server v1.8.0-SNAPSHOT: Failed -Testing client v1.8.0-SNAPSHOT against server v1.6.0: Failed -Testing client v1.8.0-SNAPSHOT against server v1.7.1: Failed -``` - -It is not always expected that all tested version-pairs will pass unless the -test is written with specific knowledge about past bugs in Avatica itself. While -Avatica tries to handle all of these edge cases implicitly, it is not always -feasible or desirable to do so. Adding new test cases is as easy as writing a -JUnit test case in the [TCK module][github-tck-tests], but there is presently no -automation around verifying the test cases as a part of the Maven build. - -For more information on running this TCK, including specific instructions for -running the TCK, reference the provided [README][github-tck-readme] file. - -[github-tck]: https://github.com/apache/calcite/tree/master/avatica/tck -[github-tck-tests]: https://github.com/apache/calcite/tree/master/avatica/tck/src/main/java/org/apache/calcite/avatica/tck/tests -[github-standalone-server]: https://github.com/apache/calcite/tree/master/avatica/standalone-server -[github-tck-readme]: https://github.com/apache/calcite/tree/master/avatica/tck/README.md -[github-tck-yml-file]: https://github.com/apache/calcite/tree/master/avatica/tck/src/main/resources/example_config.yml
