Skip to content

Commit

Permalink
gitignore secrets at top level (airbytehq#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-tricot authored Oct 18, 2020
1 parent 4baf326 commit b955a5a
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ build
.DS_Store
data

secrets

# Python
*.egg-info
__pycache__
1 change: 0 additions & 1 deletion airbyte-integrations/bigquery-destination/.gitignore

This file was deleted.

21 changes: 21 additions & 0 deletions airbyte-integrations/bigquery-destination/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# BigQuery Test Configuration

In order to test the BigQuery destination, you need a service account key file.

## Community Contributor

As a community contributor, you will need access to a GCP project and BigQuery to run tests.

1. Go to the `Service Accounts` page on the GCP console
1. Click on `+ Create Service Account" button
1. Fill out a descriptive name/id/description
1. Click the edit icon next to the service account you created on the `IAM` page
1. Add the `BigQuery User` role
1. Go back to the `Service Accounts` page and use the actions modal to `Create Key`
1. Download this key as a JSON file
1. Move and rename this file to `secrets/credentials.json`

## Airbyte Employee

1. Access the `BigQuery Integration Test User` secret on Rippling under the `Engineering` folder
1. Create a file with the contents at `secrets/credentials.json`
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class BigQueryIntegrationTest extends TestDestination {

private static final Logger LOGGER = LoggerFactory.getLogger(BigQueryIntegrationTest.class);

private static final Path CREDENTIALS_PATH = Path.of("config/credentials.json");
private static final Path CREDENTIALS_PATH = Path.of("secrets/credentials.json");

private static final String CONFIG_DATASET_ID = "dataset_id";
private static final String CONFIG_PROJECT_ID = "project_id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

class BigQueryDestinationTest {

private static final Path CREDENTIALS_PATH = Path.of("config/credentials.json");
private static final Path CREDENTIALS_PATH = Path.of("secrets/credentials.json");

private static final Logger LOGGER = LoggerFactory.getLogger(BigQueryDestinationTest.class);

Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions airbyte-integrations/singer/bigquery/destination/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ As a community contributor, you will need access to a GCP project and BigQuery t
1. Add the `BigQuery User` role
1. Go back to the `Service Accounts` page and use the actions modal to `Create Key`
1. Download this key as a JSON file
1. Move and rename this file to `config/credentials.json`
1. Move and rename this file to `secrets/credentials.json`

## Airbyte Employee

1. Access the `BigQuery Integration Test User` secret on Rippling under the `Engineering` folder
1. Create a file with the contents at `config/credentials.json`
1. Create a file with the contents at `secrets/credentials.json`
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

class TestBigQueryDestination {

private static final String CONFIG_PATH = "config/credentials.json";
private static final String CONFIG_PATH = "secrets/credentials.json";

private static final Logger LOGGER = LoggerFactory.getLogger(TestBigQueryDestination.class);

Expand Down Expand Up @@ -191,7 +191,7 @@ private Process startTarget() throws IOException, WorkerException {
}

private void writeConfigFileToJobRoot() throws IOException {
String credentialsJsonString = new String(Files.readAllBytes(Paths.get("config/credentials.json")));
String credentialsJsonString = new String(Files.readAllBytes(Paths.get("secrets/credentials.json")));
JsonNode credentials = Jsons.deserialize(credentialsJsonString);

Map<String, Object> fullConfig = new HashMap<>();
Expand Down
1 change: 0 additions & 1 deletion airbyte-integrations/singer/stripe/source/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions airbyte-integrations/singer/stripe/source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ In order to test the Stripe source, you will need API credentials and the abilit
## Community Contributor

1. Create an empty account on Stripe.
1. Create a file at `config/config.json` with the following format using your client secret and account id:
1. Create a file at `secrets/config.json` with the following format using your client secret and account id:
```
{
"client_secret": "sk_XXXXXXXXXXX",
Expand All @@ -17,4 +17,4 @@ In order to test the Stripe source, you will need API credentials and the abilit
## Airbyte Employee

1. Access the `Stripe Integration Test Config` secret on Rippling under the `Engineering` folder
1. Create a file with the contents at `config/config.json`
1. Create a file with the contents at `secrets/config.json`
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class SingerStripeSourceTest {

private static final String CATALOG = "catalog.json";
private static final String CONFIG = "config.json";
private static final String CONFIG_PATH = "config/config.json";
private static final String CONFIG_PATH = "secrets/config.json";
private static final String INVALID_CONFIG = "invalid_config.json";

protected Path jobRoot;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ In order to test the Stripe source, you will need API credentials and the abilit
## Community Contributor

1. Create an empty account on Stripe.
1. Create a file at `config/config.json` with the following format using your client secret and account id:
1. Create a file at `secrets/config.json` with the following format using your client secret and account id:
```
{
"client_secret": "sk_XXXXXXXXXXX",
Expand All @@ -17,5 +17,5 @@ In order to test the Stripe source, you will need API credentials and the abilit
## Airbyte Employee

1. Access the `Stripe Integration Test Config` secret on Rippling under the `Engineering` folder
1. Create a file with the contents at `config/config.json`
1. Create a file with the contents at `secrets/config.json`

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class SingerStripeSourceTest {

private static final String CATALOG = "catalog.json";
private static final String CONFIG = "config.json";
private static final String CONFIG_PATH = "config/config.json";
private static final String CONFIG_PATH = "secrets/config.json";
private static final String INVALID_CONFIG = "invalid_config.json";

protected Path jobRoot;
Expand Down
16 changes: 9 additions & 7 deletions tools/bin/ci_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

set -e

mkdir airbyte-integrations/singer/bigquery/destination/config
echo "$BIGQUERY_INTEGRATION_TEST_CREDS" > airbyte-integrations/singer/bigquery/destination/config/credentials.json
echo "$BIGQUERY_INTEGRATION_TEST_CREDS" > airbyte-integrations/bigquery-destination/config/credentials.json
mkdir airbyte-integrations/singer/bigquery/destination/secrets
echo "$BIGQUERY_INTEGRATION_TEST_CREDS" > airbyte-integrations/singer/bigquery/destination/secrets/credentials.json

mkdir airbyte-integrations/singer/stripe/source/config
echo "$STRIPE_INTEGRATION_TEST_CREDS" > airbyte-integrations/singer/stripe/source/config/config.json
mkdir airbyte-integrations/bigquery-destination/secrets
echo "$BIGQUERY_INTEGRATION_TEST_CREDS" > airbyte-integrations/bigquery-destination/secrets/credentials.json

mkdir airbyte-integrations/singer/stripe_abprotocol/source/config
echo "$STRIPE_INTEGRATION_TEST_CREDS" > airbyte-integrations/singer/stripe_abprotocol/source/config/config.json
mkdir airbyte-integrations/singer/stripe/source/secrets
echo "$STRIPE_INTEGRATION_TEST_CREDS" > airbyte-integrations/singer/stripe/source/secrets/config.json

mkdir airbyte-integrations/singer/stripe_abprotocol/source/secrets
echo "$STRIPE_INTEGRATION_TEST_CREDS" > airbyte-integrations/singer/stripe_abprotocol/source/secrets/config.json

0 comments on commit b955a5a

Please sign in to comment.