Loading group_scim.go +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ type ( // GitLab API docs: // https://docs.gitlab.com/api/scim/ type GroupSCIMIdentity struct { ExternalUID string `json:"external_uid"` ExternalUID string `json:"extern_uid"` UserID int64 `json:"user_id"` Active bool `json:"active"` } Loading group_scim_test.go +13 −2 Original line number Diff line number Diff line Loading @@ -12,11 +12,14 @@ func TestGroupSCIM_GetSCIMIdentitiesForGroup(t *testing.T) { t.Parallel() mux, client := setup(t) // GIVEN a group whose SCIM identities GitLab renders with // API::Entities::IdentityDetail, which exposes extern_uid, user_id and // active. mux.HandleFunc("/api/v4/groups/1/scim/identities", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprint(w, `[ { "external_uid": "be20d8dcc028677c931e04f387", "extern_uid": "be20d8dcc028677c931e04f387", "user_id": 48, "active": true } Loading @@ -29,9 +32,13 @@ func TestGroupSCIM_GetSCIMIdentitiesForGroup(t *testing.T) { Active: true, } // WHEN the identities are listed. identities, resp, err := client.GroupSCIM.GetSCIMIdentitiesForGroup(1) // THEN every field is decoded, the external UID included. require.NoError(t, err) require.NotNil(t, resp) require.Len(t, identities, 1) require.Equal(t, want, identities[0]) } Loading @@ -39,10 +46,11 @@ func TestGroupSCIM_GetSCIMIdentity(t *testing.T) { t.Parallel() mux, client := setup(t) // GIVEN a single SCIM identity rendered with the same entity. mux.HandleFunc("/api/v4/groups/1/scim/be20d8dcc028677c931e04f387", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprint(w, `{ "external_uid": "be20d8dcc028677c931e04f387", "extern_uid": "be20d8dcc028677c931e04f387", "user_id": 48, "active": true }`) Loading @@ -54,7 +62,10 @@ func TestGroupSCIM_GetSCIMIdentity(t *testing.T) { Active: true, } // WHEN that identity is fetched. identity, resp, err := client.GroupSCIM.GetSCIMIdentity(1, "be20d8dcc028677c931e04f387") // THEN every field is decoded, the external UID included. require.NoError(t, err) require.NotNil(t, resp) require.Equal(t, want, identity) Loading Loading
group_scim.go +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ type ( // GitLab API docs: // https://docs.gitlab.com/api/scim/ type GroupSCIMIdentity struct { ExternalUID string `json:"external_uid"` ExternalUID string `json:"extern_uid"` UserID int64 `json:"user_id"` Active bool `json:"active"` } Loading
group_scim_test.go +13 −2 Original line number Diff line number Diff line Loading @@ -12,11 +12,14 @@ func TestGroupSCIM_GetSCIMIdentitiesForGroup(t *testing.T) { t.Parallel() mux, client := setup(t) // GIVEN a group whose SCIM identities GitLab renders with // API::Entities::IdentityDetail, which exposes extern_uid, user_id and // active. mux.HandleFunc("/api/v4/groups/1/scim/identities", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprint(w, `[ { "external_uid": "be20d8dcc028677c931e04f387", "extern_uid": "be20d8dcc028677c931e04f387", "user_id": 48, "active": true } Loading @@ -29,9 +32,13 @@ func TestGroupSCIM_GetSCIMIdentitiesForGroup(t *testing.T) { Active: true, } // WHEN the identities are listed. identities, resp, err := client.GroupSCIM.GetSCIMIdentitiesForGroup(1) // THEN every field is decoded, the external UID included. require.NoError(t, err) require.NotNil(t, resp) require.Len(t, identities, 1) require.Equal(t, want, identities[0]) } Loading @@ -39,10 +46,11 @@ func TestGroupSCIM_GetSCIMIdentity(t *testing.T) { t.Parallel() mux, client := setup(t) // GIVEN a single SCIM identity rendered with the same entity. mux.HandleFunc("/api/v4/groups/1/scim/be20d8dcc028677c931e04f387", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprint(w, `{ "external_uid": "be20d8dcc028677c931e04f387", "extern_uid": "be20d8dcc028677c931e04f387", "user_id": 48, "active": true }`) Loading @@ -54,7 +62,10 @@ func TestGroupSCIM_GetSCIMIdentity(t *testing.T) { Active: true, } // WHEN that identity is fetched. identity, resp, err := client.GroupSCIM.GetSCIMIdentity(1, "be20d8dcc028677c931e04f387") // THEN every field is decoded, the external UID included. require.NoError(t, err) require.NotNil(t, resp) require.Equal(t, want, identity) Loading