googleapis_auth: prepare to publish v1.4.0 (#523)
diff --git a/googleapis_auth/CHANGELOG.md b/googleapis_auth/CHANGELOG.md
index a6581ad..81a44f7 100644
--- a/googleapis_auth/CHANGELOG.md
+++ b/googleapis_auth/CHANGELOG.md
@@ -1,4 +1,4 @@
-## 1.4.0-dev
+## 1.4.0
- Update `README` to include a warning about Flutter application usage.
- Require Dart 2.17 or later.
@@ -15,6 +15,7 @@
- Added `requestAccessCredentials`, `requestAuthorizationCode`, `revokeConsent`,
and `CodeResponse` to support the new
[Google Identity Services](https://developers.google.com/identity/oauth2/web/guides/overview).
+- Deprecated `createImplicitBrowserFlow` function.
#### `auth_io.dart` library
diff --git a/googleapis_auth/lib/auth_browser.dart b/googleapis_auth/lib/auth_browser.dart
index 86d1df6..f87b358 100644
--- a/googleapis_auth/lib/auth_browser.dart
+++ b/googleapis_auth/lib/auth_browser.dart
@@ -11,6 +11,7 @@
import 'src/auth_http_utils.dart';
import 'src/http_client_base.dart';
import 'src/oauth2_flows/implicit.dart';
+import 'src/oauth2_flows/token_model.dart';
import 'src/service_account_credentials.dart';
export 'googleapis_auth.dart';
@@ -24,6 +25,11 @@
/// Will create and complete with a [BrowserOAuth2Flow] object.
///
+/// {@template googleapis_auth_gis_deprecated}
+/// This member is *deprecated*. Use [requestAccessCredentials] or
+/// [requestAuthorizationCode] instead.
+/// {@endtemplate}
+///
/// This function will perform an implicit browser based oauth2 flow.
///
/// It will load Google's `gapi` library and initialize it. After initialization
@@ -42,6 +48,10 @@
///
/// {@macro googleapis_auth_close_the_client}
/// {@macro googleapis_auth_not_close_the_baseClient}
+@Deprecated(
+ 'This member is deprecated. Use requestAccessCredentials or '
+ 'requestAuthorizationCode instead.',
+)
Future<BrowserOAuth2Flow> createImplicitBrowserFlow(
ClientId clientId,
List<String> scopes, {
@@ -69,6 +79,8 @@
/// Used for obtaining oauth2 access credentials.
///
+/// {@macro googleapis_auth_gis_deprecated}
+///
/// Warning:
///
/// The methods [obtainAccessCredentialsViaUserConsent] and
@@ -79,6 +91,10 @@
/// methods should only be called inside an event handler, since most
/// browsers do not block popup windows created in response to a user
/// interaction.
+@Deprecated(
+ 'This member is deprecated. Use requestAccessCredentials or '
+ 'requestAuthorizationCode instead.',
+)
class BrowserOAuth2Flow {
final ImplicitFlow _flow;
final RefCountedClient _client;
@@ -248,6 +264,8 @@
/// Represents the result of running a browser based hybrid flow.
///
+/// {@macro googleapis_auth_gis_deprecated}
+///
/// The `credentials` field holds credentials which can be used on the client
/// side. The `newClient` function can be used to make a new authenticated HTTP
/// client using these credentials.
@@ -258,6 +276,10 @@
/// See the `obtainAccessCredentialsViaCodeExchange` function in the
/// `googleapis_auth.auth_io` library for more details on how to use the
/// authorization code.
+@Deprecated(
+ 'This member is deprecated. Use requestAccessCredentials or '
+ 'requestAuthorizationCode instead.',
+)
class HybridFlowResult {
final BrowserOAuth2Flow _flow;
diff --git a/googleapis_auth/lib/src/oauth2_flows/token_model.dart b/googleapis_auth/lib/src/oauth2_flows/token_model.dart
index 83316a9..f06867d 100644
--- a/googleapis_auth/lib/src/oauth2_flows/token_model.dart
+++ b/googleapis_auth/lib/src/oauth2_flows/token_model.dart
@@ -18,7 +18,7 @@
///
/// The returned [AccessCredentials] will *always* have a `null` value for
/// [AccessCredentials.refreshToken] and
-/// [AccessCredentials.accessToken.idToken].
+/// [AccessCredentials.idToken].
///
/// See
/// [Choose a user authorization model](https://developers.google.com/identity/oauth2/web/guides/choose-authorization-model)
diff --git a/googleapis_auth/pubspec.yaml b/googleapis_auth/pubspec.yaml
index 0b5d25b..7ef02b2 100644
--- a/googleapis_auth/pubspec.yaml
+++ b/googleapis_auth/pubspec.yaml
@@ -1,5 +1,5 @@
name: googleapis_auth
-version: 1.4.0-dev
+version: 1.4.0
description: Obtain Access credentials for Google services using OAuth 2.0
repository: https://github.com/google/googleapis.dart/tree/master/googleapis_auth
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_force_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_force_test.dart
index 69526a7..fc9f91b 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_force_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_force_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
final result = await flow.runHybridFlow();
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_immediate_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_immediate_test.dart
index 6d55b97..6752ce9 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_immediate_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_immediate_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
final result = await flow.runHybridFlow(force: false, immediate: true);
final credentials = result.credentials;
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_nonforce_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_nonforce_test.dart
index 8838f0b..b78765d 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_nonforce_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_hybrid_nonforce_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
final result = await flow.runHybridFlow(force: false);
final credentials = result.credentials;
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_immediate_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_immediate_test.dart
index 60a0264..5d72e93 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_immediate_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_immediate_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
final credentials =
await flow.obtainAccessCredentialsViaUserConsent(immediate: true);
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_implicit_idtoken_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_implicit_idtoken_test.dart
index 8b5a8b3..08e0f76 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_implicit_idtoken_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_implicit_idtoken_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
final credentials = await flow.obtainAccessCredentialsViaUserConsent(
responseTypes: [auth.ResponseType.idToken, auth.ResponseType.token]);
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_nonforce_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_nonforce_test.dart
index 94e1d16..81c7180 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_nonforce_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_nonforce_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
final credentials = await flow.obtainAccessCredentialsViaUserConsent();
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_user_denied_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_user_denied_test.dart
index 8536f7c..7d895ff 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_user_denied_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_auth_user_denied_test.dart
@@ -18,6 +18,7 @@
final clientId = auth.ClientId('foo_client', 'foo_secret');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
final flow = await auth.createImplicitBrowserFlow(clientId, scopes);
try {
await flow.obtainAccessCredentialsViaUserConsent();
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_initialize_successful_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_initialize_successful_test.dart
index 885bf22..d93258c 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_initialize_successful_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_initialize_successful_test.dart
@@ -19,7 +19,9 @@
final clientId2 = auth.ClientId('c', 'd');
final scopes = ['scope1', 'scope2'];
+ // ignore: deprecated_member_use_from_same_package
expect(auth.createImplicitBrowserFlow(clientId, scopes), completes);
+ // ignore: deprecated_member_use_from_same_package
expect(auth.createImplicitBrowserFlow(clientId2, scopes), completes);
});
}
diff --git a/googleapis_auth/test/oauth2_flows/implicit/gapi_load_failure_test.dart b/googleapis_auth/test/oauth2_flows/implicit/gapi_load_failure_test.dart
index c8a4781..0cbc918 100644
--- a/googleapis_auth/test/oauth2_flows/implicit/gapi_load_failure_test.dart
+++ b/googleapis_auth/test/oauth2_flows/implicit/gapi_load_failure_test.dart
@@ -20,6 +20,7 @@
test('gapi-load-failure', () {
impl.gapiUrl = resource('non_existent.js');
expect(
+ // ignore: deprecated_member_use_from_same_package
auth.createImplicitBrowserFlow(_clientId, _scopes),
throwsA(isA<auth.AuthenticationException>()),
);
@@ -39,6 +40,7 @@
final sw = Stopwatch()..start();
try {
+ // ignore: deprecated_member_use_from_same_package
await auth.createImplicitBrowserFlow(_clientId, _scopes);
fail('expected error');
} catch (error) {
diff --git a/test_integration/web/implicit_browser_flow.dart b/test_integration/web/implicit_browser_flow.dart
index 66685d3..8da0e8b 100644
--- a/test_integration/web/implicit_browser_flow.dart
+++ b/test_integration/web/implicit_browser_flow.dart
@@ -1,3 +1,5 @@
+// ignore_for_file: deprecated_member_use
+
import 'dart:html';
import 'package:googleapis/oauth2/v2.dart';
@@ -12,7 +14,6 @@
_flow = await createImplicitBrowserFlow(
clientId(),
[Oauth2Api.userinfoProfileScope],
- // ignore: deprecated_member_use
enableDebugLogs: true,
);