Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Destination postgres: Add SSL certificates and update normalization #14743

Merged
merged 58 commits into from
Aug 15, 2022

Conversation

andriikorotkov
Copy link
Contributor

@andriikorotkov andriikorotkov commented Jul 15, 2022

What

Add SSL certificates to destination postgres and destination postgres strict encrypt.

How

2022-07-25_13-58_1
2022-07-25_13-58
2022-07-25_13-58_2

Recommended reading order

  1. PostgresDestination.java
  2. spec.json
  3. expected_spec.json
  4. PostgresDestinationStrictEncrypt.java
  5. PostgresDestinationSSLFullCertificateAcceptanceTest.java
  6. PostgresDestinationStrictEncryptAcceptanceTest.java
  7. PostgresDestinationTest.java
  8. transform.py

🚨 User Impact 🚨

Added a dropdown for choosing SSL mode. Added fields for SSL modes verify-full and verify-ca to add root key and client keys, and added a password for custom keystore.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

…s for SSL certificates for all postgres connectors
…4034_ssl_certificate_postgres

� Conflicts:
�	airbyte-integrations/connectors/source-postgres-strict-encrypt/Dockerfile
�	docs/integrations/sources/postgres.md
@github-actions github-actions bot removed area/worker Related to worker normalization area/platform issues related to the platform labels Aug 8, 2022
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 8, 2022

/test connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/2816461713
✅ connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/2816461713
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 13      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    13      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     157      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         186     49    74%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         61     38    38%
normalization/transform_catalog/stream_processor.py                 589    394    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1421    624    56%

Build Passed

Test summary info:

All Passed

@andriikorotkov andriikorotkov temporarily deployed to more-secrets August 8, 2022 08:24 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets August 9, 2022 12:15 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 9, 2022

/test connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/2825469672
✅ connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/2825469672
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 13      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    13      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     157      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         186     49    74%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         61     38    38%
normalization/transform_catalog/stream_processor.py                 589    394    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1421    624    56%

Build Passed

Test summary info:

All Passed

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 9, 2022

/publish connector=connectors/destination-postgres

🕑 Publishing the following connectors:
connectors/destination-postgres
https://github.com/airbytehq/airbyte/actions/runs/2825667775


Connector Did it publish? Were definitions generated?
connectors/destination-postgres

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@andriikorotkov andriikorotkov temporarily deployed to more-secrets August 10, 2022 13:37 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 10, 2022

/publish connector=connectors/destination-postgres

🕑 Publishing the following connectors:
connectors/destination-postgres
https://github.com/airbytehq/airbyte/actions/runs/2833768889


Connector Did it publish? Were definitions generated?
connectors/destination-postgres

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@andriikorotkov andriikorotkov temporarily deployed to more-secrets August 14, 2022 20:42 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets August 15, 2022 06:58 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 15, 2022

/test connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/2858997011
✅ connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/2858997011
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 13      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    13      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     157      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         186     49    74%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         61     38    38%
normalization/transform_catalog/stream_processor.py                 589    394    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1421    624    56%

Build Passed

Test summary info:

All Passed

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 15, 2022

/publish connector=connectors/destination-postgres

🕑 Publishing the following connectors:
connectors/destination-postgres
https://github.com/airbytehq/airbyte/actions/runs/2859466759


Connector Did it publish? Were definitions generated?
connectors/destination-postgres

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 15, 2022

/test connector=connectors/destination-postgres-strict-encrypt

🕑 connectors/destination-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/2860288048
✅ connectors/destination-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/2860288048
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 13      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    13      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     157      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         186     49    74%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         61     38    38%
normalization/transform_catalog/stream_processor.py                 589    394    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1421    624    56%

Build Passed

Test summary info:

All Passed

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 15, 2022

/publish connector=connectors/destination-postgres run-tests=false

🕑 Publishing the following connectors:
connectors/destination-postgres
https://github.com/airbytehq/airbyte/actions/runs/2860697617


Connector Did it publish? Were definitions generated?
connectors/destination-postgres

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Aug 15, 2022

/publish connector=connectors/destination-postgres-strict-encrypt run-tests=false auto-bump-version=false

🕑 Publishing the following connectors:
connectors/destination-postgres-strict-encrypt
https://github.com/airbytehq/airbyte/actions/runs/2860848045


Connector Did it publish? Were definitions generated?
connectors/destination-postgres-strict-encrypt

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@andriikorotkov andriikorotkov merged commit d63a24e into master Aug 15, 2022
@andriikorotkov andriikorotkov deleted the akorotkov/4034_ssl_postgres_destination_certs_1 branch August 15, 2022 13:32
rodireich pushed a commit that referenced this pull request Aug 20, 2022
…#14743)

* added ssl certificates for postgres source

* added command for remove client private key after transformation to encrypted key with .pk8 extension

* added connection with CA and client certificates for postgres destination

* updated code style

* moved common methods to the common class

* moved common methods to the common class

* fixed remarks

* updated postgres source tests

* added minor changes to spec and added fixes to password mechanism

* updated postgres source tests

* updated strict-encrypt postgres source and destination and added tests for SSL certificates for all postgres connectors

* fixed check style

* updated documentation and versions of connectors

* updated ordrs in test spec

* fixed minor remarks in specs and expected_specs

* fixed minor remarks in specs and expected_specs

* fixed Dockerfile

* fixed remarks

* fixed remarks

* fixed remarks

* fixed remarks

* fixed remarks

* fixed code style

* fixed connectors version in definition file

* updated postgres destination normalization

* updated postgres destination tests

* fixed code style for postgres source and destination

* pulled master changes

* removed allow mode for destination-postgres-strect-encrypt

* updated connectors version

* fixed custom DBT transformation and enabled test for it

* updated normalization version

* updated keystore password generation method

* auto-bump connector version [ci skip]

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Postgres SSL connection
7 participants