aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2022-06-30 17:55:56 +0200
committersonartech <sonartech@sonarsource.com>2022-07-01 20:03:06 +0000
commitb12e93617de7e80dcb848c6b2cf7a011e11a288c (patch)
treecaddcda342010b1fdd5523d5b4a1a70f03e11faa /sonar-ws
parent5159eb8d7cda29c357aa06868a595d07fbc6f633 (diff)
downloadsonarqube-b12e93617de7e80dcb848c6b2cf7a011e11a288c.tar.gz
sonarqube-b12e93617de7e80dcb848c6b2cf7a011e11a288c.zip
SONAR-16567 update API api/user_tokens/search for returning the expiration date
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java10
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java3
-rw-r--r--sonar-ws/src/main/protobuf/ws-user_tokens.proto1
3 files changed, 13 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java
index c0b3214b7d8..f2e2b5de0c3 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java
@@ -35,6 +35,7 @@ public class GenerateRequest {
private String name;
private String type;
private String projectKey;
+ private String expirationDate;
/**
* Example value: "g.hopper"
@@ -78,4 +79,13 @@ public class GenerateRequest {
this.projectKey = projectKey;
return this;
}
+
+ public String getExpirationDate() {
+ return expirationDate;
+ }
+
+ public GenerateRequest setExpirationDate(String expirationDate) {
+ this.expirationDate = expirationDate;
+ return this;
+ }
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java
index 1539acc65f2..afe2f57fe16 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java
@@ -51,7 +51,8 @@ public class UserTokensService extends BaseService {
.setParam("login", request.getLogin())
.setParam("name", request.getName())
.setParam("type", request.getType())
- .setParam("projectKey", request.getProjectKey()),
+ .setParam("projectKey", request.getProjectKey())
+ .setParam("expirationDate", request.getExpirationDate()),
GenerateWsResponse.parser());
}
diff --git a/sonar-ws/src/main/protobuf/ws-user_tokens.proto b/sonar-ws/src/main/protobuf/ws-user_tokens.proto
index 786a3bfc5ff..a96d9551ffd 100644
--- a/sonar-ws/src/main/protobuf/ws-user_tokens.proto
+++ b/sonar-ws/src/main/protobuf/ws-user_tokens.proto
@@ -46,6 +46,7 @@ message SearchWsResponse {
optional string lastConnectionDate = 3;
optional string type = 4;
optional Project project = 5;
+ optional string expirationDate = 6;
message Project {
optional string key = 1;