Index: sdk/lib/_internal/pub_generated/lib/src/oauth2.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/oauth2.dart b/sdk/lib/_internal/pub_generated/lib/src/oauth2.dart |
similarity index 87% |
copy from sdk/lib/_internal/pub/lib/src/oauth2.dart |
copy to sdk/lib/_internal/pub_generated/lib/src/oauth2.dart |
index 8de110c00b55f60e55446e2ee1c54cc1e0289d67..6edac4b3596a4f703f7c099e19e51e2108231929 100644 |
--- a/sdk/lib/_internal/pub/lib/src/oauth2.dart |
+++ b/sdk/lib/_internal/pub_generated/lib/src/oauth2.dart |
@@ -21,8 +21,8 @@ import 'utils.dart'; |
export 'package:oauth2/oauth2.dart'; |
/// The pub client's OAuth2 identifier. |
-final _identifier = '818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.' |
- 'googleusercontent.com'; |
+final _identifier = |
+ '818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.' 'googleusercontent.com'; |
/// The pub client's OAuth2 secret. |
/// |
@@ -38,7 +38,7 @@ final _secret = 'SWeqj8seoJW0w7_CpEPFLX0K'; |
/// [Google OAuth2 documentation]: https://developers.google.com/accounts/docs/OAuth2WebServer#offline |
final authorizationEndpoint = Uri.parse( |
'https://accounts.google.com/o/oauth2/auth?access_type=offline' |
- '&approval_prompt=force'); |
+ '&approval_prompt=force'); |
/// The URL from which the pub client will request an access token once it's |
/// been authorized by the user. |
@@ -91,8 +91,9 @@ Future withClient(SystemCache cache, Future fn(Client client)) { |
}); |
}).catchError((error) { |
if (error is ExpirationException) { |
- log.error("Pub's authorization to upload packages has expired and " |
- "can't be automatically refreshed."); |
+ log.error( |
+ "Pub's authorization to upload packages has expired and " |
+ "can't be automatically refreshed."); |
return withClient(cache, fn); |
} else if (error is AuthorizationException) { |
var message = "OAuth2 authorization failed"; |
@@ -117,8 +118,8 @@ Future<Client> _getClient(SystemCache cache) { |
var credentials = _loadCredentials(cache); |
if (credentials == null) return _authorize(); |
- var client = new Client(_identifier, _secret, credentials, |
- httpClient: httpClient); |
+ var client = |
+ new Client(_identifier, _secret, credentials, httpClient: httpClient); |
_saveCredentials(cache, client.credentials); |
return client; |
}); |
@@ -140,15 +141,17 @@ Credentials _loadCredentials(SystemCache cache) { |
var credentials = new Credentials.fromJson(readTextFile(path)); |
if (credentials.isExpired && !credentials.canRefresh) { |
- log.error("Pub's authorization to upload packages has expired and " |
- "can't be automatically refreshed."); |
+ log.error( |
+ "Pub's authorization to upload packages has expired and " |
+ "can't be automatically refreshed."); |
return null; // null means re-authorize. |
} |
return credentials; |
} catch (e) { |
- log.error('Warning: could not load the saved OAuth2 credentials: $e\n' |
- 'Obtaining new credentials...'); |
+ log.error( |
+ 'Warning: could not load the saved OAuth2 credentials: $e\n' |
+ 'Obtaining new credentials...'); |
return null; // null means re-authorize. |
} |
} |
@@ -195,20 +198,21 @@ Future<Client> _authorize() { |
// Closing the server here is safe, since it will wait until the response |
// is sent to actually shut down. |
server.close(); |
- chainToCompleter(grant.handleAuthorizationResponse(queryToMap(queryString)), |
+ chainToCompleter( |
+ grant.handleAuthorizationResponse(queryToMap(queryString)), |
completer); |
return new shelf.Response.found('http://pub.dartlang.org/authorized'); |
}); |
var authUrl = grant.getAuthorizationUrl( |
- Uri.parse('http://localhost:${server.port}'), scopes: _scopes); |
+ Uri.parse('http://localhost:${server.port}'), |
+ scopes: _scopes); |
log.message( |
'Pub needs your authorization to upload packages on your behalf.\n' |
- 'In a web browser, go to $authUrl\n' |
- 'Then click "Allow access".\n\n' |
- 'Waiting for your authorization...'); |
+ 'In a web browser, go to $authUrl\n' 'Then click "Allow access".\n\n' |
+ 'Waiting for your authorization...'); |
}); |
return completer.future.then((client) { |