-
Notifications
You must be signed in to change notification settings - Fork 745
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
[GOBBLIN-813] Make SFDC connector support encrypted Salesforce client id and client secret #2677
[GOBBLIN-813] Make SFDC connector support encrypted Salesforce client id and client secret #2677
Conversation
@@ -64,8 +64,10 @@ public SalesforceConnector(State state) { | |||
@Override | |||
public HttpEntity getAuthentication() throws RestApiConnectionException { | |||
log.debug("Authenticating salesforce"); | |||
String clientId = this.state.getProp(ConfigurationKeys.SOURCE_CONN_CLIENT_ID); | |||
String clientSecret = this.state.getProp(ConfigurationKeys.SOURCE_CONN_CLIENT_SECRET); | |||
String clientId = PasswordManager.getInstance(this.state) |
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.
Can we have this decryption logic configurable? So that not all the case we need this decyption. Today BDE team is also relying on this code base.
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.
Considering to reuse the same returned variable from PasswordManager.getInstance(this.state)
@@ -64,8 +64,10 @@ public SalesforceConnector(State state) { | |||
@Override | |||
public HttpEntity getAuthentication() throws RestApiConnectionException { | |||
log.debug("Authenticating salesforce"); | |||
String clientId = this.state.getProp(ConfigurationKeys.SOURCE_CONN_CLIENT_ID); | |||
String clientSecret = this.state.getProp(ConfigurationKeys.SOURCE_CONN_CLIENT_SECRET); | |||
String clientId = PasswordManager.getInstance(this.state) |
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.
Considering to reuse the same returned variable from PasswordManager.getInstance(this.state)
b911005
to
22fc2c3
Compare
… id and client secret When reading client id and client secret from state properties, SalesforceConnector will use PasswordManager.readPassword() to decrypt it. This feature is controlled by source.conn.decrypt.client.id.secret and default is disabled
22fc2c3
to
5e4c27b
Compare
+1 LGTM |
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.
+1
When reading client id and client secret from state properties,
SalesforceConnector will use PasswordManager.readPassword() to decrypt
it.
readPassword() will check value to see if it is in encrypted pattern.
If not, the original value will be returned.
Therefore this changes can be backward compatible.
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
Tests
Commits