Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[google_sign_in] Bridge google_sign_in and googleapis. #2824

Merged
merged 10 commits into from
Jul 14, 2020

Conversation

ditman
Copy link
Member

@ditman ditman commented Jun 10, 2020

Description

This new package extends the Google Sign In plugin with a Future<AuthClient> authenticatedClient() method, that lets you retrieve a googleapis_auth AuthClient from the currently authenticated googleSignIn instance:

...

import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart';

...

final peopleApi = PeopleApi(await _googleSignIn.authenticatedClient());
final response = await peopleApi.people.connections.list(
  'people/me',
  personFields: 'names',
);

...

This package also contains a copy of package:google_sign_in example app, modified to use the new method, and the googleapis package. This is what a refactor from raw HTTP requests to authenticated googleapis clients looks like.

Related Issues

n/a (Internal)

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@ditman ditman requested a review from cyanglaz June 10, 2020 00:50
ditman added 4 commits June 9, 2020 17:56
The fact that extension_google_sign_in_as_googleapis_auth is *not* a
plugin but it *has* tests is confusing the tooling.

Since these tests are just a copy-paste from google_sign_in/example,
remove them from here.
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM

@ditman ditman merged commit 5971e2f into flutter:master Jul 14, 2020
@ditman ditman deleted the google-sign-in-as-googleapis-auth branch July 14, 2020 00:33
jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
Introduce the first version of the `extension_google_sign_in_as_googleapis_auth` package.

This package lets users of the `google_sign_in` plugin to create an authenticated HTTP clients (from `googleapis_auth`) that can access any APIs from the `googleapis` package.
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
Introduce the first version of the `extension_google_sign_in_as_googleapis_auth` package.

This package lets users of the `google_sign_in` plugin to create an authenticated HTTP clients (from `googleapis_auth`) that can access any APIs from the `googleapis` package.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants