Repository: dexidp/dex
Pull request #2637 (2022-08-24 04:08:31)

build(deps): bump google.golang.org/api from 0.93.0 to 0.94.0
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.93.0 to 0.94.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/googleapis/google-api-go-client/releases">google.golang.org/api's releases</a>.</em></p>
<blockquote>
<h2>v0.94.0</h2>
<h2><a href="https://github.com/googleapis/google-api-go-client/compare/v0.93.0...v0.94.0">0.94.0</a> (2022-08-23)</h2>
<h3>Features</h3>
<ul>
<li><strong>all:</strong> auto-regenerate discovery clients, refs <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1676">#1676</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1673">#1673</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1672">#1672</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1671">#1671</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1667">#1667</a></li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>storage:</strong> *int64 instead of int64 for Age cond (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1598">#1598</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/9ea025dcfe9b67a95e08f4ec94ed4fb6a9767b8c">9ea025d</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>option:</strong> clarify behavior of WithScopes (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1670">#1670</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/07ceb9d607c85ffaa5bea97be66cf9d426ec55bb">07ceb9d</a>), refs <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1644">#1644</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md">google.golang.org/api's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/googleapis/google-api-go-client/compare/v0.93.0...v0.94.0">0.94.0</a> (2022-08-23)</h2>
<h3>Features</h3>
<ul>
<li><strong>all:</strong> auto-regenerate discovery clients, refs <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1676">#1676</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1673">#1673</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1672">#1672</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1671">#1671</a> <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1667">#1667</a></li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>storage:</strong> *int64 instead of int64 for Age cond (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1598">#1598</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/9ea025dcfe9b67a95e08f4ec94ed4fb6a9767b8c">9ea025d</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>option:</strong> clarify behavior of WithScopes (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1670">#1670</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/07ceb9d607c85ffaa5bea97be66cf9d426ec55bb">07ceb9d</a>), refs <a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1644">#1644</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/608f87742a6d319ca6208a80707baea3e183016b"><code>608f877</code></a> chore(main): release 0.94.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1668">#1668</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/1b6dbd85c567d273fdf3585edf6e556885de49f4"><code>1b6dbd8</code></a> feat(all): auto-regenerate discovery clients (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1676">#1676</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/c0825d4dc5f7c8a315bae39d97b744b9d8a40d35"><code>c0825d4</code></a> chore: bump version of oauth lib to latest (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1675">#1675</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/99c581190ff41cadbc6ed18240a90ca3eb3bba3c"><code>99c5811</code></a> feat(all): auto-regenerate discovery clients (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1673">#1673</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/9ce1130d29ac603d58f35d1cb10c6aedadbb0f89"><code>9ce1130</code></a> feat(all): auto-regenerate discovery clients (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1672">#1672</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/7158b896335d4f986ae6a3624955b5c1e7c1f51a"><code>7158b89</code></a> feat(all): auto-regenerate discovery clients (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1671">#1671</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/07ceb9d607c85ffaa5bea97be66cf9d426ec55bb"><code>07ceb9d</code></a> docs(option): clarify behavior of WithScopes (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1670">#1670</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/9ea025dcfe9b67a95e08f4ec94ed4fb6a9767b8c"><code>9ea025d</code></a> fix(storage): *int64 instead of int64 for Age cond (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1598">#1598</a>)</li>
<li><a href="https://github.com/googleapis/google-api-go-client/commit/c85b3052854ebb1f95bdbcba7aebc7007c8b5ba7"><code>c85b305</code></a> feat(all): auto-regenerate discovery clients (<a href="https://github-redirect.dependabot.com/googleapis/google-api-go-client/issues/1667">#1667</a>)</li>
<li>See full diff in <a href="https://github.com/googleapis/google-api-go-client/compare/v0.93.0...v0.94.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/api&package-manager=go_modules&previous-version=0.93.0&new-version=0.94.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/connector/oidc/oidc.go b/connector/oidc/oidc.go
index b4e67799..e345dca0 100644
--- a/connector/oidc/oidc.go
+++ b/connector/oidc/oidc.go
@@ -351,6 +351,11 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
 			vs, found = claims[groupsKey].([]interface{})
 		}
 
+		// Fallback when claims[groupsKey] is a string instead of an array of strings.
+		if g, b := claims[groupsKey].(string); b {
+			groups = []string{g}
+		}
+
 		if found {
 			for _, v := range vs {
 				if s, ok := v.(string); ok {
diff --git a/go.mod b/go.mod
index 84b35388..90787bf1 100644
--- a/go.mod
+++ b/go.mod
@@ -32,8 +32,8 @@ require (
 	go.etcd.io/etcd/client/v3 v3.5.4
 	golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
 	golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
-	golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2
-	google.golang.org/api v0.93.0
+	golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094
+	google.golang.org/api v0.94.0
 	google.golang.org/grpc v1.47.0
 	google.golang.org/protobuf v1.28.1
 	gopkg.in/square/go-jose.v2 v2.6.0
diff --git a/go.sum b/go.sum
index 0b548f11..9115865f 100644
--- a/go.sum
+++ b/go.sum
@@ -546,8 +546,8 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j
 golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
 golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
-golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0=
-golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
+golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8=
+golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -747,8 +747,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69
 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
 google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
 google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
-google.golang.org/api v0.93.0 h1:T2xt9gi0gHdxdnRkVQhT8mIvPaXKNsDNWz+L696M66M=
-google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
+google.golang.org/api v0.94.0 h1:KtKM9ru3nzQioV1HLlUf1cR7vMYJIpgls5VhAYQXIwA=
+google.golang.org/api v0.94.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=


Test patch:
diff --git a/connector/oidc/oidc_test.go b/connector/oidc/oidc_test.go
index d8b30b39..d94af79d 100644
--- a/connector/oidc/oidc_test.go
+++ b/connector/oidc/oidc_test.go
@@ -271,6 +271,22 @@ func TestHandleCallback(t *testing.T) {
 				"cognito:groups": []string{"group3", "group4"},
 			},
 		},
+		{
+			name:               "singularGroupResponseAsString",
+			userIDKey:          "", // not configured
+			userNameKey:        "", // not configured
+			expectUserID:       "subvalue",
+			expectUserName:     "namevalue",
+			expectGroups:       []string{"group1"},
+			expectedEmailField: "emailvalue",
+			token: map[string]interface{}{
+				"sub":            "subvalue",
+				"name":           "namevalue",
+				"groups":         "group1",
+				"email":          "emailvalue",
+				"email_verified": true,
+			},
+		},
 	}
 
 	for _, tc := range tests {