git.iko.soy/typeable/oauth2-proxy
on master help sign in
Update providers tests
b333ef8Joel Speed
providers/google_test.go+6−6
@@ -237,30 +237,30 @@ func TestGoogleProviderGetEmailAddressEmailMissing(t *testing.T) {
237
237
238func TestGoogleProvider_userInGroup(t *testing.T) {
238func TestGoogleProvider_userInGroup(t *testing.T) {
239 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
239 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" {
241 fmt.Fprintln(w, `{"isMember": true}`)
241 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" {
243 fmt.Fprintln(w, `{"isMember": false}`)
243 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" {
245 http.Error(
245 http.Error(
246 w,
246 w,
247 `{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
247 `{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
248 http.StatusBadRequest,
248 http.StatusBadRequest,
249 )
249 )
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" {
251 http.Error(
251 http.Error(
252 w,
252 w,
253 `{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
253 `{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
254 http.StatusBadRequest,
254 http.StatusBadRequest,
255 )
255 )
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" {
257 // 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
257 // 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
258 http.Error(
258 http.Error(
259 w,
259 w,
260 `{"error": {"errors": [{"domain": "global","reason": "notFound","message": "Resource Not Found: memberKey"}],"code": 404,"message": "Resource Not Found: memberKey"}}`,
260 `{"error": {"errors": [{"domain": "global","reason": "notFound","message": "Resource Not Found: memberKey"}],"code": 404,"message": "Resource Not Found: memberKey"}}`,
261 http.StatusNotFound,
261 http.StatusNotFound,
262 )
262 )
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" {
264 fmt.Fprintln(w,
264 fmt.Fprintln(w,
265 `{"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"}}`,
265 `{"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"}}`,
266 )
266 )