3

I'm trying to get every project that a given user is authorized to "see". For example, when I log into my GitLab account i'm able to choose (from the dashboard) which project I want to explore.

So, what I need is to get that "list" dynamically with Jgit in order to show it to the user that's logged in my webapp.

Is it possible to do it using JGit? Or should I use the GIT-API?

TeslardG
  • 33
  • 7

1 Answers1

0

The GIT-API you mention (https://developer.github.com/v3/) is for GitHub, not GitLab.

For GitLab, you should use https://docs.gitlab.com/ce/api/.

Listing the projects accesible by a user was requested in gitlab-ce issue 33657 and implemented with gitlab-ce merge_request 12596 in commit 050eae8

GET /users/:user_id/projects

You don't need JGit, but a GitLAb API wrapper in Java like gmessner/gitlab4j-api.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you :) But is there a way to do it using Jgit? I'm trying to do it with JGit to keep the consitency of the code. – TeslardG Jul 17 '18 at 19:33
  • @TeslardG I understand, but this has nothing to do with JGit, since it does not involve git commands (JGit is a Java implementation of Git commands). It only involves curl calls, hence my proposition of other Java libraries, which are wrappers around those curl commands. – VonC Jul 17 '18 at 19:34
  • Oh, ok :) Thank you! – TeslardG Jul 17 '18 at 19:37