@@ -41,6 +41,7 @@ func testGitLabBackend() *httptest.Server {
4141 "groups": ["foo", "bar"]
4242 }
4343 `
44+
4445 projectInfo := `
4546 {
4647 "name": "MyProject",
@@ -56,6 +57,18 @@ func testGitLabBackend() *httptest.Server {
5657 }
5758 `
5859
60+ noAccessProjectInfo := `
61+ {
62+ "name": "NoAccessProject",
63+ "archived": false,
64+ "path_with_namespace": "no_access_group/no_access_project",
65+ "permissions": {
66+ "project_access": null,
67+ "group_access": null,
68+ }
69+ }
70+ `
71+
5972 personalProjectInfo := `
6073 {
6174 "name": "MyPersonalProject",
@@ -105,6 +118,13 @@ func testGitLabBackend() *httptest.Server {
105118 } else {
106119 w.WriteHeader(401)
107120 }
121+ case "/api/v4/projects/no_access_group/no_access_project":
122+ if r.Header["Authorization"][0] == authHeader {
123+ w.WriteHeader(200)
124+ w.Write([]byte(noAccessProjectInfo))
125+ } else {
126+ w.WriteHeader(401)
127+ }
108128 case "/api/v4/projects/my_group/my_archived_project":
109129 if r.Header["Authorization"][0] == authHeader {
110130 w.WriteHeader(200)
@@ -219,6 +239,10 @@ var _ = Describe("Gitlab Provider Tests", func() {
219239 expectedValue: nil,
220240 projects: []string{"my_group/my_project=40"},
221241 }),
242+ Entry("project membership invalid on group project, no access at all", entitiesTableInput{
243+ expectedValue: nil,
244+ projects: []string{"no_access_group/no_access_project=30"},
245+ }),
222246 Entry("project membership valid on personnal project", entitiesTableInput{
223247 expectedValue: []string{"project:my_profile/my_personal_project"},
224248 projects: []string{"my_profile/my_personal_project"},