Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package io.trino.connector;

import com.google.common.collect.ImmutableList;
import io.trino.plugin.base.security.AllowAllAccessControl;
import io.trino.spi.connector.ConnectorSecurityContext;
import io.trino.spi.connector.SchemaTableName;
import io.trino.spi.security.ConnectorIdentity;
Expand All @@ -38,7 +37,7 @@
import static java.util.Objects.requireNonNull;

class MockConnectorAccessControl
extends AllowAllAccessControl
extends TestingAllowAllAccessControl
{
private static final String INFORMATION_SCHEMA = "information_schema";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.base.security;
package io.trino.connector;

import com.google.common.collect.ImmutableList;
import io.trino.spi.connector.ConnectorAccessControl;
Expand All @@ -29,7 +29,7 @@
import java.util.Optional;
import java.util.Set;

public class AllowAllAccessControl
public class TestingAllowAllAccessControl
implements ConnectorAccessControl
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import io.trino.connector.MockConnectorFactory;
import io.trino.eventlistener.EventListenerManager;
import io.trino.metadata.QualifiedObjectName;
import io.trino.plugin.base.security.AllowAllAccessControl;
import io.trino.plugin.base.security.AllowAllSystemAccessControl;
import io.trino.plugin.base.security.DefaultSystemAccessControl;
import io.trino.plugin.base.security.ReadOnlySystemAccessControl;
Expand Down Expand Up @@ -318,7 +317,7 @@ public void testAllowExecuteProcedure()
accessControlManager.loadSystemAccessControl("allow-all", ImmutableMap.of());

queryRunner.createCatalog(TEST_CATALOG_NAME, MockConnectorFactory.create(), ImmutableMap.of());
accessControlManager.setConnectorAccessControlProvider(CatalogServiceProvider.singleton(TEST_CATALOG_HANDLE, Optional.of(new AllowAllAccessControl())));
accessControlManager.setConnectorAccessControlProvider(CatalogServiceProvider.singleton(TEST_CATALOG_HANDLE, Optional.empty()));

transaction(transactionManager, accessControlManager)
.execute(transactionId -> {
Expand Down
3 changes: 2 additions & 1 deletion docs/src/main/sphinx/connector/hive-security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Property value Description
:doc:`/sql/revoke` commands.
See :ref:`hive-sql-standard-based-authorization` for details.

``allow-all`` No authorization checks are enforced.
``system`` No authorization checks are enforced. Roles are controlled by
system access control.
================================================== ============================================================

.. _hive-sql-standard-based-authorization:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public void testAllowAllAccessControl()
"test",
ImmutableMap.<String, String>builder()
.put("hive.metastore.uri", "thrift://foo:1234")
.put("hive.security", "allow-all")
.put("hive.security", "system")
.buildOrThrow(),
new TestingConnectorContext())
.shutdown();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class HiveSecurityModule
public static final String FILE = "file";
public static final String READ_ONLY = "read-only";
public static final String SQL_STANDARD = "sql-standard";
public static final String ALLOW_ALL = "allow-all";
public static final String SYSTEM = "system";

@Override
Expand All @@ -53,7 +52,6 @@ protected void setup(Binder binder)
new ReadOnlySecurityModule(),
new StaticAccessControlMetadataModule()));
bindSecurityModule(SQL_STANDARD, new SqlStandardSecurityModule());
bindSecurityModule(ALLOW_ALL, new AllowAllSecurityModule());
bindSecurityModule(SYSTEM, new SystemSecurityModule());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import static io.airlift.log.Level.WARN;
import static io.airlift.units.Duration.nanosSince;
import static io.trino.plugin.hive.HiveTestUtils.HDFS_ENVIRONMENT;
import static io.trino.plugin.hive.security.HiveSecurityModule.ALLOW_ALL;
import static io.trino.plugin.hive.security.HiveSecurityModule.SQL_STANDARD;
import static io.trino.plugin.tpch.ColumnNaming.SIMPLIFIED;
import static io.trino.plugin.tpch.DecimalTypeMapping.DOUBLE;
Expand Down Expand Up @@ -398,7 +397,6 @@ public static void main(String[] args)
.setInitialTables(TpchTable.getTables())
.setBaseDataDir(baseDataDir)
.setTpcdsCatalogEnabled(true)
.setSecurity(ALLOW_ALL)
// Uncomment to enable standard column naming (column names to be prefixed with the first letter of the table name, e.g.: o_orderkey vs orderkey)
// and standard column types (decimals vs double for some columns). This will allow running unmodified tpch queries on the cluster.
//.setTpchColumnNaming(ColumnNaming.STANDARD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import static com.google.common.base.Preconditions.checkArgument;
import static io.trino.plugin.hive.TestingThriftHiveMetastoreBuilder.testingThriftHiveMetastoreBuilder;
import static io.trino.plugin.hive.security.HiveSecurityModule.ALLOW_ALL;
import static java.util.Objects.requireNonNull;

public final class S3HiveQueryRunner
Expand Down Expand Up @@ -152,7 +151,6 @@ public static void main(String[] args)
.setExtraProperties(ImmutableMap.of("http-server.http.port", "8080"))
.setSkipTimezoneSetup(true)
.setInitialTables(TpchTable.getTables())
.setSecurity(ALLOW_ALL)
.build();
Logger log = Logger.get(S3HiveQueryRunner.class);
log.info("======== SERVER STARTED ========");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ public class IcebergSecurityConfig
{
public enum IcebergSecurity
{
ALLOW_ALL,
READ_ONLY,
SYSTEM,
FILE,
}

private IcebergSecurity securitySystem = IcebergSecurity.ALLOW_ALL;
private IcebergSecurity securitySystem = IcebergSecurity.SYSTEM;

@NotNull
public IcebergSecurity getSecuritySystem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity;

import static io.airlift.configuration.ConditionalModule.conditionalModule;
import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.ALLOW_ALL;
import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.FILE;
import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.READ_ONLY;

Expand All @@ -33,7 +32,6 @@ public class IcebergSecurityModule
protected void setup(Binder binder)
{
install(new ConnectorAccessControlModule());
bindSecurityModule(ALLOW_ALL, new AllowAllSecurityModule());
bindSecurityModule(READ_ONLY, new ReadOnlySecurityModule());
bindSecurityModule(FILE, new FileBasedAccessControlModule());
// SYSTEM: do not bind an ConnectorAccessControl so the engine will use system security with system roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,6 @@ public void testRecordingMetastore()
.hasMessageContaining("Configuration property 'hive.metastore-recording-path' was not used");
}

@Test
public void testAllowAllAccessControl()
{
ConnectorFactory connectorFactory = getConnectorFactory();

connectorFactory.create(
"test",
ImmutableMap.<String, String>builder()
.put("iceberg.catalog.type", "HIVE_METASTORE")
.put("hive.metastore.uri", "thrift://foo:1234")
.put("iceberg.security", "allow-all")
.buildOrThrow(),
new TestingConnectorContext())
.shutdown();
}

@Test
public void testReadOnlyAllAccessControl()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping;
import static io.airlift.configuration.testing.ConfigAssertions.assertRecordedDefaults;
import static io.airlift.configuration.testing.ConfigAssertions.recordDefaults;
import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.ALLOW_ALL;
import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.READ_ONLY;
import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.SYSTEM;

public class TestIcebergSecurityConfig
{
@Test
public void testDefaults()
{
assertRecordedDefaults(recordDefaults(IcebergSecurityConfig.class)
.setSecuritySystem(ALLOW_ALL));
.setSecuritySystem(SYSTEM));
}

@Test
Expand Down