Skip to content

Commit

Permalink
[JENKINS-47097] added support to login using gitlab private token
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-el-habib committed Dec 18, 2017
1 parent fcab927 commit 529f5b3
Show file tree
Hide file tree
Showing 2 changed files with 477 additions and 477 deletions.
Expand Up @@ -92,13 +92,13 @@ public class GitLabAuthenticationToken extends AbstractAuthenticationToken {
private static final Cache<String, List<GitlabProject>> groupRepositoriesCache = CacheBuilder.newBuilder()
.expireAfterWrite(1, TimeUnit.HOURS).build();

private final List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
private final List<GrantedAuthority> authorities = new ArrayList<>();

public GitLabAuthenticationToken(String accessToken, String gitlabServer) throws IOException {
public GitLabAuthenticationToken(String accessToken, String gitlabServer, TokenType tokenType) throws IOException {
super(new GrantedAuthority[] {});

this.accessToken = accessToken;
this.gitLabAPI = GitlabAPI.connect(gitlabServer, accessToken, TokenType.ACCESS_TOKEN);
this.gitLabAPI = GitlabAPI.connect(gitlabServer, accessToken, tokenType);

this.me = gitLabAPI.getUser();
assert this.me != null;
Expand Down

0 comments on commit 529f5b3

Please sign in to comment.