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

[PLUGIN-1732] - Successfactors Proxy Implementation #33

Merged

Conversation

Shubhangi-cs
Copy link
Contributor

Proxy Configuration :

Proxy URL: Users can enter the URL of the proxy server. This URL should contain the protocol (e.g., http or https), the proxy server's address, and the port number (e.g., http://proxy.example.com:8080).

Username (Optional): If the proxy server requires authentication, users can provide the username.

Password (Optional): If the proxy server requires authentication, users can supply the password.

This enhancement will enable users to set up and use Proxy settings in the Successfactors plugin, allowing them to route their requests through a proxy server when communicating with external endpoints.

https://cdap.atlassian.net/browse/PLUGIN-1732

@Shubhangi-cs Shubhangi-cs force-pushed the feature/proxyAddition branch 3 times, most recently from 58b3ee5 to e2d61b6 Compare January 9, 2024 09:00
@sau42shri sau42shri requested a review from sahusanket January 9, 2024 10:39

private final String username;
private final String password;
private SuccessFactorsConnectorConfig config;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT : add empty line after private static final variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -136,7 +136,16 @@ private Schema getOutputSchema(FailureCollector failureCollector) {
} catch (TransportException te) {
String errorMsg = ExceptionParser.buildTransportError(te);
errorMsg = ResourceConstants.ERR_ODATA_SERVICE_CALL.getMsgForKeyWithCode(errorMsg);
failureCollector.addFailure(errorMsg, null).withConfigProperty(SuccessFactorsPluginConfig.BASE_URL);
if ((errorMsg.contains("proxy") || errorMsg.contains("Connection reset"))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a documentation that maps these KEY words to the given properties ?

Connection reset , Failed to connect can be very generic error messages and may not be related to the configs...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As tested the errors thrown in these scenarios are always same and to highlight the errors on the particular fields these keywords needs to be used.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be true,
but these key words may occur for other failures NOT related to proxy.
Like network failure or something.

In such cases, these suggestion might mislead a user in debugging in wrong direction.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no pre-defined error message for proxy related stuff, then Please surface the whole error.
It's not correct to assume error message, as these can change in future unless it's mentioned by their official doc.

throws MalformedURLException, TransportException {
OkHttpClient.Builder builder = getConfiguredClient();

if (proxyUrl != null && !proxyUrl.isEmpty()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant here sorry
use
!Strings.isNullOrEmpty(proxyUrl)
from
import com.google.common.base.Strings;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Shubhangi-cs Shubhangi-cs force-pushed the feature/proxyAddition branch from e8d837d to 483ccc1 Compare February 6, 2024 05:45
@Shubhangi-cs Shubhangi-cs force-pushed the feature/proxyAddition branch from fe407a3 to cda12dc Compare February 6, 2024 05:47
@Shubhangi-cs Shubhangi-cs merged commit 3bc7a6e into data-integrations:develop Feb 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants