Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
rtannenbaum committed Aug 17, 2018
1 parent 8de8860 commit 1e9c11d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
Expand Up @@ -120,7 +120,7 @@ public AuthFlowConfiguration generateConfiguration(String callbackBaseUrl, Strin
.setRedirectUri(callbackBaseUrl + redirectPath)
.setState(encodedJobId)
.build();
return new AuthFlowConfiguration(url, getTokenUrl(), AUTH_PROTOCOL);
return new AuthFlowConfiguration(url, AUTH_PROTOCOL, getTokenUrl());
}

@Override
Expand Down
Expand Up @@ -66,7 +66,7 @@ public AuthFlowConfiguration generateConfiguration(String callbackBaseUrl, Strin
.setRedirectUri(callbackBaseUrl + CALLBACK_PATH)
.setState(encodedJobId)
.build();
return new AuthFlowConfiguration(url, getTokenUrl(), AUTHORIZATION_PROTOCOL);
return new AuthFlowConfiguration(url, AUTHORIZATION_PROTOCOL, getTokenUrl());
}

@Override
Expand Down
Expand Up @@ -108,7 +108,7 @@ public AuthFlowConfiguration generateConfiguration(String callbackBaseUrl, Strin
// constructs a request for the Microsoft Graph authorization code.
String redirectUrl = callbackBaseUrl + redirectPath;
String queryPart = constructAuthQueryPart(redirectUrl, id, scopes);
return new AuthFlowConfiguration(AUTHORIZATION_URL + "?" + queryPart, getTokenUrl(), AUTHORIZATION_PROTOCOL);
return new AuthFlowConfiguration(AUTHORIZATION_URL + "?" + queryPart, AUTHORIZATION_PROTOCOL, getTokenUrl());
}

public TokenAuthData generateAuthData(
Expand Down
Expand Up @@ -34,7 +34,7 @@ public class OfflineDemoAuthDataGenerator implements AuthDataGenerator {

@Override
public AuthFlowConfiguration generateConfiguration(String callbackBaseUrl, String id) {
return new AuthFlowConfiguration(callbackBaseUrl + "/callback/offline-demo?code=123", getTokenUrl(), AUTH_PROTOCOL);
return new AuthFlowConfiguration(callbackBaseUrl + "/callback/offline-demo?code=123", AUTH_PROTOCOL, getTokenUrl());
}

@Override
Expand Down
Expand Up @@ -34,6 +34,7 @@ public TransferJob handle(GetTransferJob transferRequest) {

PortabilityJob job = jobStore.findJob(jobId);

// TODO(#553): This list of nulls should be cleaned up when we refactor TransferJob.
return new TransferJob(id, job.exportService(), job.importService(), job.transferDataType(),
null, null, null, null, null, null);
}
Expand Down
Expand Up @@ -66,6 +66,7 @@ public TransferJob handle(StartTransferJob startTransferJob) {
startTransferJob.getImportAuthData());
}

// TODO(#553): This list of nulls should be cleaned up when we refactor TransferJob.
return new TransferJob(id, job.exportService(), job.importService(), job.transferDataType(),
null, null, null, null, null, null);
}
Expand Down
Expand Up @@ -32,7 +32,11 @@ public interface AuthDataGenerator {
AuthData generateAuthData(
String callbackBaseUrl, String authCode, String id, AuthData initialAuthData, String extra);

// TODO(#553): Implement this for auth extensions. Currently unused by the demo-server frontend.
/**
* Return the URL used to exchange an access code for token.
*
* <p>TODO(#553): Implement this for auth extensions. Currently unused by the demo-server frontend.
*/
default String getTokenUrl() {
return "";
}
Expand Down
Expand Up @@ -24,7 +24,7 @@ public class AuthFlowConfiguration extends PortableType {
*
* @param authUrl the initial URL.
*/
public AuthFlowConfiguration(String authUrl, String tokenUrl, AuthProtocol authProtocol) {
public AuthFlowConfiguration(String authUrl, AuthProtocol authProtocol, String tokenUrl) {
this.authUrl = authUrl;
this.tokenUrl = tokenUrl;
this.authProtocol = authProtocol;
Expand Down

0 comments on commit 1e9c11d

Please sign in to comment.