Conversation
976da29
to
dd7037d
Compare
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.
I think some of the comments can be addressed in future PRs. Nothing that's really blocking this from getting merged.
One thing that we might want to do is to have a connector per database and use this one as a base for those. Not sure that citizen user will be interested in specifying driver class names. So having [oracle|postgresql|derby]-stored-procedure-connector that just extends from this might be better. That could open up bundling of Oracle driver as an option (as we would not be distributing it).
@@ -18,10 +18,10 @@ | |||
}, | |||
"componentProperties": { | |||
"loginUrl": { "kind": "property", "displayName": "Login Url", "group": "security", "label": "common,security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "https://login.salesforce.com", "description": "URL of the Salesforce instance by default set to https://login.salesforce.com" }, | |||
"clientId": { "kind": "property", "displayName": "Client Id", "group": "security", "label": "common,security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "OAuth Consumer Key of the connected app configured in the Salesforce instance setup. Typically a connected app needs to be configured but one can be provided by installing a package." }, | |||
"clientId": { "kind": "property", "displayName": "Client Id", "group": "security", "label": "common,security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "OAuth Consumer Key of the connected app configured in the Salesforce instance setup. Typically a connected app needs to be configured but one can be provided by installing a package." }, |
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.
I think we wanted clientId
to be non-secret see #55
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.
hmm the only reason that would change is bc I ran the build. I'm working in the sql-stored-connector
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.
Yeah, I saw this too with newer version of Camel, I guess the camel-maven-package/connector plugins might generate code differently between versions; and quite possibly that I've changed that from true
to false
by hand. I would keep it out of this PR if possible and regenerate in the next PR (I'll create one for upgrading Camel version).
"clientSecret": { "kind": "property", "displayName": "Client Secret", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "OAuth Consumer Secret of the connected app configured in the Salesforce instance setup." }, | ||
"refreshToken": { "kind": "property", "displayName": "Refresh Token", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Refresh token already obtained in the refresh token OAuth flow. One needs to setup a web application and configure a callback URL to receive the refresh token or configure using the builtin callback at https://login.salesforce.com/services/oauth2/success or https://test.salesforce.com/services/oauth2/success and then retrive the refresh_token from the URL at the end of the flow. Note that in development organizations Salesforce allows hosting the callback web application at localhost." }, | ||
"userName": { "kind": "property", "displayName": "User Name", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Username used in OAuth flow to gain access to access token. It's easy to get started with password OAuth flow but in general one should avoid it as it is deemed less secure than other flows." }, | ||
"userName": { "kind": "property", "displayName": "User Name", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Username used in OAuth flow to gain access to access token. It's easy to get started with password OAuth flow but in general one should avoid it as it is deemed less secure than other flows." }, |
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.
Same for the userName
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.
hmm the only reason that would change is bc I ran the build. I'm working in the sql-stored-connector
<!-- camel and spring boot compiler plugins --> | ||
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>apt</artifactId> |
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.
Not sure we want apt
to be in compile
scope (perhaps provided
or optional
) or have them explicitly configured in the maven-compiler-plugin
configuration see https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
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.
@zregvart We seem to be doing this on all connectors, so we should probably address that across all connectors. Shall I open a Jira just for this?
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.
Yeah, I think it would benefit to have this in the parent POM also
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> |
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.
Same about annotation processing as above
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.0.1</version> | ||
<configuration> | ||
<encoding>UTF-8</encoding> |
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.
I wonder if we should also use https://github.com/basepom/basepom for connectors, or perhaps have a connectors-parent POM (no need to change in this PR), so some of these encodings (and others that we forget) are set beforehand
|
||
Connection connection = null; | ||
ResultSet columnSet = null; | ||
try { |
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.
ditto for try-with-resources
Class.forName(parameters.get("driver").toString()); | ||
} catch (Exception e) { | ||
Enumeration<Driver> drivers = DriverManager.getDrivers(); | ||
StringBuffer supportedDrivers = new StringBuffer("["); |
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.
Perhaps use StringJoiner? Something like:
Collections.list(DriverManager.getDrivers())
.stream()
.map(Class::getName)
.collect(Collectors.joining(", ", "[", "]"));
parameters.get("user").toString(), | ||
parameters.get("password").toString()); | ||
|
||
if (connection == null) { |
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.
Not sure this can happen according to the docs it should not return null
.
|
||
private void verifyCredentials(ResultBuilder builder, Map<String, Object> parameters) { | ||
try { | ||
Class.forName(parameters.get("driver").toString()); |
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.
I wonder if we should support non JDBC 4.0 drivers. With JDBC 4.0 this is no longer necessary. DriverManager will try to locate an appropriate driver via ServiceLoader, see the docs.
examples/sql-stored-example/pom.xml
Outdated
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.5.0</version> | ||
<configuration> | ||
<mainClass>io.syndesis.example.TwitterPingCheckMain</mainClass> |
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.
typo, should be SqlStoredPingCheckMain?
dd7037d
to
1950f0a
Compare
1950f0a
to
5344293
Compare
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.
👍
Adding the connector which includes the VerifierExtension as well as the MetaDataExtension. The MetaDataExtension will need to go through another iteration to adhere to the latest conventions.