Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[passport-google-oauth20] Update email_verified type and override passport.Profile provider type #69338

Merged

Conversation

remscodes
Copy link
Contributor

@remscodes remscodes commented Apr 12, 2024

Please fill in this template.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

@remscodes remscodes changed the title [passport-google-oauth20] Update email_verified type and override passportProfile provider type [passport-google-oauth20] Update email_verified type and override passport.Profile provider type Apr 12, 2024
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 12, 2024

@remscodes Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 69338,
  "author": "remscodes",
  "headCommitOid": "c8e1ff4184618e14ab4b7a4ca13bc36564490eff",
  "mergeBaseOid": "0cebe5d5bcaad4a8f18e525b1cd098583b252585",
  "lastPushDate": "2024-04-12T13:42:38.000Z",
  "lastActivityDate": "2024-05-04T10:37:40.000Z",
  "mergeOfferDate": "2024-05-02T14:43:25.000Z",
  "mergeRequestDate": "2024-05-04T10:37:40.000Z",
  "mergeRequestUser": "remscodes",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "passport-google-oauth20",
      "kind": "edit",
      "files": [
        {
          "path": "types/passport-google-oauth20/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/passport-google-oauth20/passport-google-oauth20-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "yasupeke",
        "ezintz",
        "ngtan",
        "acerbic"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "ezintz",
      "date": "2024-05-02T14:42:45.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 2051790793,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Apr 12, 2024
@typescript-bot
Copy link
Contributor

🔔 @yasupeke @ezintz @ngtan @Acerbic — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Apr 12, 2024
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 12, 2024
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 12, 2024
@typescript-bot
Copy link
Contributor

@remscodes The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Apr 12, 2024
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 12, 2024
@ezintz
Copy link
Contributor

ezintz commented Apr 19, 2024

I am not so sure about this changes, if I browse the Google OpenID connect documentation I can see it still as a string, see https://developers.google.com/identity/openid-connect/openid-connect#an-id-tokens-payload. Did it change on passport?

Edit: I also see that since five years there has been no new version published https://www.npmjs.com/package/passport-google-oauth20

@remscodes
Copy link
Contributor Author

I’m sure that this change comes from Google API and not from passport librairies.
I think they haven't updated their documentation yet.

I recently noticed that my (email_verified === "true") comparison was always false even for emails actually verified.

I got this profile object from my TS project using passport-google-oauth20 :

Capture d’écran 2024-04-19 à 15 38 38

The _raw property is the result body from "https://www.googleapis.com/oauth2/v3/userinfo" response (passport-google-oauth20:strategy.js#L119)

The _json property is simply JSON.parse(body) (passport-google-oauth20:strategy.js#L103)

We can see that there is no parsing for email_verified, the _raw value comes directly from Google response.

I've looked in the sub-dependencies (passport-oauth2 and oauth) but there is nothing new that could convert email_verified into a boolean.

@typescript-bot
Copy link
Contributor

Re-ping @yasupeke, @ezintz, @ngtan, @Acerbic:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Apr 23, 2024
@typescript-bot
Copy link
Contributor

It has been more than two weeks and this PR still has no reviews.

I'll bump it to the DT maintainer queue. Thank you for your patience, @remscodes.

(Ping @yasupeke, @ezintz, @ngtan, @Acerbic.)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in New Pull Request Status Board Apr 30, 2024
Copy link
Contributor

@ezintz ezintz left a comment

Choose a reason for hiding this comment

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

The changes are looking good to me 👍 , thank you for clarifying!

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels May 2, 2024
@typescript-bot
Copy link
Contributor

@remscodes: Everything looks good here. I am ready to merge this PR (at c8e1ff4) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@yasupeke, @ezintz, @ngtan, @Acerbic: you can do this too.)

@typescript-bot typescript-bot moved this from Needs Maintainer Action to Waiting for Author to Merge in New Pull Request Status Board May 2, 2024
@remscodes
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board May 4, 2024
@typescript-bot typescript-bot merged commit 7c8a70d into DefinitelyTyped:master May 4, 2024
4 checks passed
@remscodes remscodes deleted the passport-google-oauth20 branch May 4, 2024 10:40
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants