spring-cloud / spring-cloud/spring-cloud-config

Support GitLab configuration with private access token

Open
#1,766 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

Hi everyone!

According to the GitLab documentation you can read repositories with a private access token. See link:
https://docs.gitlab.com/ee/api/README.html#personalproject-access-tokens

The current version and prior version of Spring Cloud Config Server seem not to support this feature.

Environment

Component       Version
Spring Boot     2.4.0
Spring Cloud    2020.0.0-M5
GitLab CE       13.5.3
Java VM         openjdk 11

What I have tried so far
I have created a private access token on the GitLab server and tried to configure it inside the spring cloud config server.

  1. When I add the ?private-token= parameter, the server won't start because JGit seems to append a path to the configured uri which leads to an invalid url.
    Caused by: org.apache.http.client.CircularRedirectException: Circular redirect to 'https://gitlab.home.local/spring-cloud-config.git?private_token=<token>/info/refs&service=git-upload-pack'
  2. I have tried to add the token as a header field in the application.properties. But the property seems to be ignored or at least not evaluated at this point.
    spring.cloud.config.headers.PRIVATE-TOKEN=<token> or
    spring.cloud.config.headers.Authorization=Bearer <token>

Best regards,
David

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the GitLab repository access failure with the private-token URI and the two application.properties header configurations described in the issue. Trace how Spring Cloud Config Server passes the repository URI and credentials to JGit, then verify that a private GitLab repository can be read without the malformed URL or ignored authentication settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, gitlab, java, spring
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.