guardian / guardian/play-googleauth

deprecated GoogleGroupChecker constructor seems broken

Open
#86 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
39
Forks
11
Avg merge
5d 22h
Merged PRs (30d)
6

Description

I was encountering NullPointer exceptions when updating the `play-googleauth` version in our project.

I might be doing something wrong but it seems to me like the deprecated GoogleGroupChecker constructor that takes a `GoogleServiceAccount` doesn't build an equivalent `ServiceAccountCredentials` properly.

It sets **privateKey** and **serviceAccountUser**`:
https://github.com/guardian/play-googleauth/blob/d60875f5edf1ad8fa4323a659a35ba02317a4305/play-v27/src/main/scala/com/gu/googleauth/groups.scala#L61-L69

But the `GoogleServiceAccount` class requires **clientEmail** to be set (see code [here](https://github.com/googleapis/google-auth-library-java/blob/v0.22.0/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java#L138) )

It might be that we just should be setting **clientEmail** instead of, or in addition to **serviceAccountUser** I'm not sure what the difference is exactly.
I just refactored my code to not use this method anyway so It's not blocking anything on my side.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in play-v27/src/main/scala/com/gu/googleauth/groups.scala at the deprecated GoogleGroupChecker constructor around lines 61–69, then compare its credential construction with ServiceAccountCredentials.java. Reproduce the reported NullPointerException and verify that the deprecated constructor creates equivalent credentials without the failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.