git.iko.soy/typeable/oauth2-proxy
on master help sign in
Update providers tests
commitb333ef89bc0ac23c9117da57d8c0f13675bfcb3e authorJoel Speed <joel.speed@hotmail.co.uk> dateTue 25 Oct 2022, 20:34 (4 years ago) parent7034f0d
1 file changed+6−6
providers/google_test.go+6−6
providers/google_test.go+6−6
@@ -237,30 +237,30 @@ func TestGoogleProviderGetEmailAddressEmailMissing(t *testing.T) {
237237
238238func TestGoogleProvider_userInGroup(t *testing.T) {
239239 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
240− if r.URL.Path == "/groups/group@example.com/hasMember/member-in-domain@example.com" {
240+ if r.URL.Path == "/admin/directory/v1/groups/group@example.com/hasMember/member-in-domain@example.com" {
241241 fmt.Fprintln(w, `{"isMember": true}`)
242− } else if r.URL.Path == "/groups/group@example.com/hasMember/non-member-in-domain@example.com" {
242+ } else if r.URL.Path == "/admin/directory/v1/groups/group@example.com/hasMember/non-member-in-domain@example.com" {
243243 fmt.Fprintln(w, `{"isMember": false}`)
244− } else if r.URL.Path == "/groups/group@example.com/hasMember/member-out-of-domain@otherexample.com" {
244+ } else if r.URL.Path == "/admin/directory/v1/groups/group@example.com/hasMember/member-out-of-domain@otherexample.com" {
245245 http.Error(
246246 w,
247247 `{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
248248 http.StatusBadRequest,
249249 )
250− } else if r.URL.Path == "/groups/group@example.com/hasMember/non-member-out-of-domain@otherexample.com" {
250+ } else if r.URL.Path == "/admin/directory/v1/groups/group@example.com/hasMember/non-member-out-of-domain@otherexample.com" {
251251 http.Error(
252252 w,
253253 `{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
254254 http.StatusBadRequest,
255255 )
256− } else if r.URL.Path == "/groups/group@example.com/members/non-member-out-of-domain@otherexample.com" {
256+ } else if r.URL.Path == "/admin/directory/v1/groups/group@example.com/members/non-member-out-of-domain@otherexample.com" {
257257 // note that the client currently doesn't care what this response text or code is - any error here results in failure to match the group
258258 http.Error(
259259 w,
260260 `{"error": {"errors": [{"domain": "global","reason": "notFound","message": "Resource Not Found: memberKey"}],"code": 404,"message": "Resource Not Found: memberKey"}}`,
261261 http.StatusNotFound,
262262 )
263− } else if r.URL.Path == "/groups/group@example.com/members/member-out-of-domain@otherexample.com" {
263+ } else if r.URL.Path == "/admin/directory/v1/groups/group@example.com/members/member-out-of-domain@otherexample.com" {
264264 fmt.Fprintln(w,
265265 `{"kind": "admin#directory#member","etag":"12345","id":"1234567890","email": "member-out-of-domain@otherexample.com","role": "MEMBER","type": "USER","status": "ACTIVE","delivery_settings": "ALL_MAIL"}}`,
266266 )