-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[source-mysql-v2] cdk and spec change for ssl #45351
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ 1 Skipped Deployment
|
@@ -0,0 +1,282 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but since this was auto-generate code, it's worth doing a pass to bring this code up to a better standard of quality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Furthermore, please update source-firetruck to use this code.
"To always require encryption and verify that the source has a valid SSL certificate." | ||
) | ||
@SuppressFBWarnings(value = ["NP_NONNULL_RETURN_VIOLATION"], justification = "Micronaut DI") | ||
class SslVerifyIdentity : Encryption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@postamar I'm actually not sure what's the best practice there. SslVerifyIdentity shares the same members as SslVerifyCertificate, but they just match to different JsonSchemaTitle and description.
Here I simply copied them. Should I have class SslVerifyIdentity extending from SslVerifyCertificate instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying is OK here. This code is not going to change much, ever. If it's really unreadable, then using sealed class
to abstract shared components is OK. I don't know how well that works with the annotations, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is, should these objects also be in the CDK, like SSH tunneling? Are they common patterns? Let's look into this once we've migrated all the existing certified sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They may share some fields but most connectors have pretty different settings regarding to SSL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Good to know π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is copied from cdk 1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the other, this file needs to be rewritten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My biggest blocker is that the copied-over code needs to be improved as part of this PR. Everything else is minor.
@@ -1,6 +1,7 @@ | |||
dependencies { | |||
implementation project(':airbyte-cdk:bulk:core:bulk-cdk-core-base') | |||
implementation project(':airbyte-cdk:bulk:core:bulk-cdk-core-extract') | |||
implementation 'org.apache.httpcomponents:httpcore:4.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this dependency? I don't see any imports from it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for SSLContext: org.apache.http.ssl.SSLContexts.custom().loadTrustMaterial(trustStore, null)
"LUNeYd9wXefwMrEWwDn0DZSsShZmgJoppA15qOnq+FVW/bhZwRv5L4l3AJv0SGoA\n" + | ||
"o7DXxD0VGHDA6aC4tJssZbrnoDCBPzYmt9s9GwVupuEroJHZ0Wks4pt4Wx50DUgA\n" + | ||
"KC3v0Mo/gg==\n" + | ||
"-----END CERTIFICATE-----\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be """ ... """ blocks
@@ -0,0 +1,282 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but since this was auto-generate code, it's worth doing a pass to bring this code up to a better standard of quality.
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is close.
...te-cdk/bulk/toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/jdbc/SSLCertificateUtils.kt
Outdated
Show resolved
Hide resolved
...te-cdk/bulk/toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/jdbc/SSLCertificateUtils.kt
Outdated
Show resolved
Hide resolved
...te-cdk/bulk/toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/jdbc/SSLCertificateUtils.kt
Outdated
Show resolved
Hide resolved
...te-cdk/bulk/toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/jdbc/SSLCertificateUtils.kt
Outdated
Show resolved
Hide resolved
...te-cdk/bulk/toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/jdbc/SSLCertificateUtils.kt
Outdated
Show resolved
Hide resolved
} catch (ex2: InvalidKeySpecException) { | ||
KeyFactory.getInstance("EC").generatePrivate(spec) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
.../source-mysql-v2/src/main/kotlin/io/airbyte/integrations/source/mysql/MysqlJdbcEncryption.kt
Outdated
Show resolved
Hide resolved
"To always require encryption and verify that the source has a valid SSL certificate." | ||
) | ||
@SuppressFBWarnings(value = ["NP_NONNULL_RETURN_VIOLATION"], justification = "Micronaut DI") | ||
class SslVerifyIdentity : Encryption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Good to know π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Very nice.
Sorry for the slow response. I should have approved this yesterday. |
What
https://github.com/airbytehq/airbyte-internal-issues/issues/9669
mysql-v2 supports SSL
How
Review guide
User Impact
Can this PR be safely reverted and rolled back?