Skip to content

Commit dd84ca6

Browse files
committed
Update gitlab-api dependency
1 parent 972a634 commit dd84ca6

File tree

4 files changed

+65
-2
lines changed

4 files changed

+65
-2
lines changed

pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
<id>repo.jenkins-ci.org</id>
5656
<url>https://repo.jenkins-ci.org/public/</url>
5757
</repository>
58+
<repository>
59+
<id>incrementals</id>
60+
<url>https://repo.jenkins-ci.org/incrementals/</url>
61+
</repository>
5862
</repositories>
5963
<pluginRepositories>
6064
<pluginRepository>
@@ -89,6 +93,12 @@
8993
<dependency>
9094
<groupId>io.jenkins.plugins</groupId>
9195
<artifactId>gitlab-api</artifactId>
96+
<version>6.1.0-106.v6c0b_5b_df4ee6</version>
97+
</dependency>
98+
<dependency>
99+
<groupId>io.jenkins.plugins</groupId>
100+
<artifactId>jakarta-xml-bind-api</artifactId>
101+
<version>4.0.5-3.v3d5b_a_73965b_9</version>
92102
</dependency>
93103
<dependency>
94104
<groupId>org.jenkins-ci.plugins</groupId>
@@ -97,6 +107,7 @@
97107
<dependency>
98108
<groupId>org.jenkins-ci.plugins</groupId>
99109
<artifactId>jackson2-api</artifactId>
110+
<version>2.20.0-417.va_5311a_823a_b_8</version>
100111
</dependency>
101112
</dependencies>
102113
<build>
@@ -276,6 +287,14 @@
276287
</execution>
277288
</executions>
278289
</plugin>
290+
<plugin>
291+
<groupId>org.apache.maven.plugins</groupId>
292+
<artifactId>maven-compiler-plugin</artifactId>
293+
<configuration>
294+
<source>8</source>
295+
<target>8</target>
296+
</configuration>
297+
</plugin>
279298
</plugins>
280299
</build>
281300
</project>

src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ of this software and associated documentation files (the "Software"), to deal
4343
import jenkins.model.Jenkins;
4444
import org.apache.commons.collections.CollectionUtils;
4545
import org.apache.commons.lang.StringUtils;
46-
import org.gitlab4j.api.Constants.TokenType;
4746
import org.gitlab4j.api.GitLabApi;
4847
import org.gitlab4j.api.GitLabApiException;
4948
import org.gitlab4j.api.models.Group;
5049
import org.gitlab4j.api.models.Project;
5150
import org.gitlab4j.api.models.User;
51+
import org.gitlab4j.models.Constants.TokenType;
5252
import org.springframework.security.authentication.AbstractAuthenticationToken;
5353
import org.springframework.security.core.GrantedAuthority;
5454
import org.springframework.security.core.authority.SimpleGrantedAuthority;

src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
import org.apache.http.impl.client.HttpClients;
7373
import org.apache.http.message.BasicNameValuePair;
7474
import org.apache.http.util.EntityUtils;
75-
import org.gitlab4j.api.Constants.TokenType;
7675
import org.gitlab4j.api.GitLabApiException;
7776
import org.gitlab4j.api.models.Group;
77+
import org.gitlab4j.models.Constants.TokenType;
7878
import org.jfree.util.Log;
7979
import org.kohsuke.stapler.DataBoundConstructor;
8080
import org.kohsuke.stapler.Header;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
The MIT License
3+
4+
Copyright (c) 2025 Jenkins contributors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+
*/
24+
25+
package org.jenkinsci.plugins;
26+
27+
import static org.junit.jupiter.api.Assertions.assertThrows;
28+
29+
import org.gitlab4j.api.GitLabApiException;
30+
import org.gitlab4j.models.Constants;
31+
import org.junit.jupiter.api.Test;
32+
33+
public class GitLabAuthenticationTokenTest {
34+
35+
/**
36+
* This checks that we get the correct exception.
37+
*/
38+
@Test
39+
public void testInvalidUrl() {
40+
assertThrows(GitLabApiException.class,
41+
() -> new GitLabAuthenticationToken("42",
42+
"http://localhost/_invalid_url", Constants.TokenType.ACCESS));
43+
}
44+
}

0 commit comments

Comments
 (0)