Permalink
Browse files

Code review

  • Loading branch information...
rtannenbaum committed Aug 17, 2018
1 parent 8de8860 commit 1e9c11d1344ff0746388412ba8ca8139926be8ca
@@ -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
@@ -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
@@ -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(
@@ -34,7 +34,7 @@
@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
@@ -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);
}
@@ -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);
}
@@ -32,7 +32,11 @@
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 "";
}
@@ -24,7 +24,7 @@
*
* @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;

0 comments on commit 1e9c11d

Please sign in to comment.