Skip to content

Commit

Permalink
Rename security NONE to ALLOW_ALL
Browse files Browse the repository at this point in the history
This is safe change as it is default value. Using ALLOW_ALL makes atop
connector to be coherent with other connectors like hive.
  • Loading branch information
kokosing committed Nov 3, 2021
1 parent d7c932f commit 872ac9b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public class AtopConnectorConfig
{
public enum AtopSecurity
{
NONE,
ALLOW_ALL,
FILE,
}

private String executablePath = "atop";
private String timeZone = ZoneId.systemDefault().getId();
private AtopSecurity security = AtopSecurity.NONE;
private AtopSecurity security = AtopSecurity.ALLOW_ALL;
private Duration readTimeout = new Duration(5, MINUTES);
private int concurrentReadersPerNode = 1;
private int maxHistoryDays = 30;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Connector create(String catalogName, Map<String, String> requiredConfig,
new CatalogNameModule(catalogName),
conditionalModule(
AtopConnectorConfig.class,
config -> config.getSecurity() == AtopSecurity.NONE,
config -> config.getSecurity() == AtopSecurity.ALLOW_ALL,
new AllowAllAccessControlModule()),
conditionalModule(
AtopConnectorConfig.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testDefaults()
assertRecordedDefaults(recordDefaults(AtopConnectorConfig.class)
.setExecutablePath("atop")
.setConcurrentReadersPerNode(1)
.setSecurity(AtopSecurity.NONE)
.setSecurity(AtopSecurity.ALLOW_ALL)
.setReadTimeout(new Duration(5, MINUTES))
.setMaxHistoryDays(30)
.setTimeZone(TimeZone.getDefault().getID()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public enum RaptorSecurity
{
NONE,
ALLOW_ALL,
FILE,
READ_ONLY,
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class RaptorSecurityConfig
{
private RaptorSecurity securitySystem = RaptorSecurity.NONE;
private RaptorSecurity securitySystem = RaptorSecurity.ALLOW_ALL;

@NotNull
public RaptorSecurity getSecuritySystem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import io.trino.plugin.base.security.ReadOnlySecurityModule;

import static io.airlift.configuration.ConditionalModule.conditionalModule;
import static io.trino.plugin.raptor.legacy.security.RaptorSecurity.ALLOW_ALL;
import static io.trino.plugin.raptor.legacy.security.RaptorSecurity.FILE;
import static io.trino.plugin.raptor.legacy.security.RaptorSecurity.NONE;
import static io.trino.plugin.raptor.legacy.security.RaptorSecurity.READ_ONLY;

public class RaptorSecurityModule
Expand All @@ -31,7 +31,7 @@ public class RaptorSecurityModule
@Override
protected void setup(Binder binder)
{
bindSecurityModule(NONE, new AllowAllAccessControlModule());
bindSecurityModule(ALLOW_ALL, new AllowAllAccessControlModule());
bindSecurityModule(READ_ONLY, new ReadOnlySecurityModule());
bindSecurityModule(FILE, new FileBasedAccessControlModule());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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.raptor.legacy.security.RaptorSecurity.NONE;
import static io.trino.plugin.raptor.legacy.security.RaptorSecurity.ALLOW_ALL;
import static io.trino.plugin.raptor.legacy.security.RaptorSecurity.READ_ONLY;

public class TestRaptorSecurityConfig
Expand All @@ -30,7 +30,7 @@ public class TestRaptorSecurityConfig
public void testDefaults()
{
assertRecordedDefaults(recordDefaults(RaptorSecurityConfig.class)
.setSecuritySystem(NONE));
.setSecuritySystem(ALLOW_ALL));
}

@Test
Expand Down

0 comments on commit 872ac9b

Please sign in to comment.