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

EA-437 remove oauth properties and add auth token varibale in client #287

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

SrishtiSingh-eu
Copy link
Contributor

No description provided.

this.configuration.getServiceUri(),
this.configuration.getApiKey(),
regularUserToken);
this.apiConnection = new UserSetApiConnection(this.configuration.getServiceUri());
Copy link
Collaborator

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{
Copy link
Collaborator

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<>();
Copy link
Collaborator

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());
Copy link
Collaborator

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() {
Copy link
Collaborator

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",

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