|
|
@@ -19,6 +19,9 @@ import org.gitlab4j.api.models.User;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.time.Instant;
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
public class UserServiceImpl implements UserService {
|
|
|
@@ -134,7 +137,8 @@ public class UserServiceImpl implements UserService {
|
|
|
Scope[] scopes = new Scope[]{Scope.API};
|
|
|
ImpersonationToken token;
|
|
|
log.info(String.format("createToken, userId = %d",userId));
|
|
|
- token = gitlabApi.getUserApi().createImpersonationToken(userId.toString(), "AES-" + Tools.randomUUID(), null, scopes);
|
|
|
+ // 亿年之后
|
|
|
+ token = gitlabApi.getUserApi().createImpersonationToken(userId.toString(), "AES-" + Tools.randomUUID(), Date.from(Instant.MAX), scopes);
|
|
|
return token.getToken();
|
|
|
}
|
|
|
|