-
Notifications
You must be signed in to change notification settings - Fork 4
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
EA-437 remove oauth properties and add auth token varibale in client #287
base: develop
Are you sure you want to change the base?
Conversation
this.configuration.getServiceUri(), | ||
this.configuration.getApiKey(), | ||
regularUserToken); | ||
this.apiConnection = new UserSetApiConnection(this.configuration.getServiceUri()); |
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.
we should still allow the set API to fetch OAuth tokens, only that it becomes optional when the token is provided with the configuration. consequntly the verification of oath endpoint and params is to be verified only if no oauth token is provided
@@ -56,27 +38,6 @@ public BaseUserSetApi() throws SetApiClientException { | |||
this(new ClientConfiguration()); | |||
} | |||
|
|||
private String getOauthToken(String oauthServiceUri, String oauthRequestParams ) throws SetApiClientException{ |
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.
we still need this method
@@ -17,6 +17,8 @@ | |||
|
|||
public class UserSetApiClient extends BaseUserSetApi { | |||
|
|||
public static final ThreadLocal<String> token = new ThreadLocal<>(); |
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.
we should move this to bsase classtogether with the getter and setter methods, so that the token can be initialized in the constructor pf the base class. We should also rename the base class to BaseUserSetApiClient or AbstractUserSetApiClient
/** | ||
* Web User Set Client class | ||
*/ | ||
private class WebUserSetClient implements WebUserSetApi { | ||
@Override | ||
public UserSet createUserSet(String set, String profile) throws SetApiClientException { | ||
return getApiConnection().createUserSet(set, profile); | ||
return getApiConnection().createUserSet(set, profile, UserSetApiClient.token.get()); |
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.
we should use a getToken() method instead of accessing the field directly
/** | ||
* Close / purge the token from memory | ||
*/ | ||
public void close() { |
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.
close method is typically used for closing streams, we should rename this method to somthing else, somthing like "logout",
No description provided.