Skip to content

Commit

Permalink
remove import / export handler (#16403)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens authored Sep 29, 2022
1 parent 65a35b9 commit 1e2f701
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 1,765 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ WORKFLOW_FAILURE_RESTART_DELAY_SECONDS=

### FEATURE FLAGS ###
AUTO_DISABLE_FAILING_CONNECTIONS=false
EXPOSE_SECRETS_IN_EXPORT=false
FORCE_MIGRATE_SECRET_STORE=false

### MONITORING FLAGS ###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ private static Database getConfigDatabase(final DSLContext dslContext) throws IO

private static ConfigPersistence getConfigPersistence(final Database configDatabase) throws IOException {
final JsonSecretsProcessor jsonSecretsProcessor = JsonSecretsProcessor.builder()
.maskSecrets(true)
.copySecrets(true)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ void testBootloaderAppRunSecretMigration() throws Exception {

final JsonSecretsProcessor jsonSecretsProcessor = JsonSecretsProcessor.builder()
.copySecrets(true)
.maskSecrets(true)
.build();

try (val configsDslContext = DSLContextFactory.create(configsDataSource, SQLDialect.POSTGRES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public boolean autoDisablesFailingConnections() {
return Boolean.parseBoolean(System.getenv("AUTO_DISABLE_FAILING_CONNECTIONS"));
}

@Override
public boolean exposeSecretsInExport() {
return Boolean.parseBoolean(System.getenv("EXPOSE_SECRETS_IN_EXPORT"));
}

@Override
public boolean forceSecretMigration() {
return Boolean.parseBoolean(System.getenv("FORCE_MIGRATE_SECRET_STORE"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public interface FeatureFlags {

boolean autoDisablesFailingConnections();

boolean exposeSecretsInExport();

boolean forceSecretMigration();

boolean useStreamCapableState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
public class JsonSecretsProcessor {

@Builder.Default
final private boolean maskSecrets = true;

@Builder.Default
final private boolean copySecrets = true;
final private Boolean copySecrets = false;

protected static final JsonSchemaValidator VALIDATOR = new JsonSchemaValidator();

Expand All @@ -54,18 +51,14 @@ public class JsonSecretsProcessor {
* @param obj Object containing potentially secret fields
*/
public JsonNode prepareSecretsForOutput(final JsonNode obj, final JsonNode schema) {
if (maskSecrets) {
// todo (cgardens) this is not safe. should throw.
// if schema is an object and has a properties field
if (!isValidJsonSchema(schema)) {
log.error("The schema is not valid, the secret can't be hidden");
return obj;
}

return maskAllSecrets(obj, schema);
// todo (cgardens) this is not safe. should throw.
// if schema is an object and has a properties field
if (!isValidJsonSchema(schema)) {
log.error("The schema is not valid, the secret can't be hidden");
return obj;
}

return obj;
return maskAllSecrets(obj, schema);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class JsonSecretsProcessorTest {
public void setup() {
processor = JsonSecretsProcessor.builder()
.copySecrets(true)
.maskSecrets(true)
.build();
}

Expand Down Expand Up @@ -502,7 +501,6 @@ class NoOpTest {
public void setup() {
processor = JsonSecretsProcessor.builder()
.copySecrets(false)
.maskSecrets(false)
.build();
}

Expand Down Expand Up @@ -568,7 +566,7 @@ void testSecretScenario(final String folder, final boolean partial) throws IOExc
final InputStream inputIs = getClass().getClassLoader().getResourceAsStream(inputFilePath);
final JsonNode input = objectMapper.readTree(inputIs);

final String expectedFilePath = folder + (partial ? "/partial_config.json" : "/full_config.json");
final String expectedFilePath = folder + "/expected.json";
final InputStream expectedIs = getClass().getClassLoader().getResourceAsStream(expectedFilePath);
final JsonNode expected = objectMapper.readTree(expectedIs);

Expand Down
217 changes: 0 additions & 217 deletions airbyte-server/src/main/java/io/airbyte/server/ConfigDumpExporter.java

This file was deleted.

Loading

0 comments on commit 1e2f701

Please sign in to comment.