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

setConnectTimeout, setReadTimeout, setDebugging for OAUTH interaction #73

Closed
gbuehler2063 opened this issue Apr 24, 2018 · 2 comments
Closed

Comments

@gbuehler2063
Copy link

Setters in ApiClient for setConnectTimeout, setReadTimeout (see PR #62), and setDebugging are very helpful for debugging and stability.

However these settings get only active after authentication, but not for OAUTH interaction.
I.e., if the system connects to the oAuthBasePath during authentication with authName "docusignAccessCode", these settings are not active yet in the httpClient, which is created in the default constructor (see ApiClient.java:81).

It would be great, if we could have an extension of the following constructor into a new one:

ApiClient.java:134: --->
public ApiClient(String oAuthBasePath, String authName, String clientId, String secret)

New constructor:

public ApiClient(String oAuthBasePath, String authName, String clientId, String secret, int connectTimeout, int readTimeout, boolean isDebugging)

The new constructor can apply the setters in this sequence: setDebugging (first), setConnectTimeout, setReadTimeout.
setDebugging will create the new httpClient before the timeouts will be set on this new httpClient.

Afterwards, the following lines will use the client with the new setting:
ApiClient.java:109 ---> auth = new OAuth(httpClient, OAuthFlow.accessCode, oAuthBasePath + "/oauth/auth", oAuthBasePath + "/oauth/token", "all");

@psytester
Copy link
Contributor

ping reminder @mmallis87
Would be nice if you could add this change or if you need a PR for that.

@mmallis87
Copy link
Contributor

@psytester there is no need to modify the tons of existing constructors just to add these settings while we already provide the methods to pass all what you mentionned. Here is a code snippet that illustrates how you can achieve that today:
ApiClient apiClient = new ApiClient(oAuthBasePath, authName, clientId, secret);
apiClient.setDebugging(isDebugging);
apiClient.setConnectTimeout(connectTimeout);
apiClient.setReadTimeout(readTimeout);

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

No branches or pull requests

3 participants