mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
add optional ID to api token request
This commit is contained in:
@@ -24,11 +24,17 @@ public class ApiTokenRequest {
|
|||||||
private final String name;
|
private final String name;
|
||||||
private final String role;
|
private final String role;
|
||||||
private final long ttl;
|
private final long ttl;
|
||||||
|
private final int id;
|
||||||
|
|
||||||
public ApiTokenRequest(String name, String role, long ttl) {
|
public ApiTokenRequest(String name, String role, long ttl, int id) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.role = checkRole(role);
|
this.role = checkRole(role);
|
||||||
this.ttl = ttl;
|
this.ttl = ttl;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiTokenRequest(String name, String role, long ttl) {
|
||||||
|
this(name, role, ttl, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String checkRole(String role) {
|
private String checkRole(String role) {
|
||||||
@@ -38,6 +44,10 @@ public class ApiTokenRequest {
|
|||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user