SUPPORT-8817: fix for review (4)

This commit is contained in:
Рауф Латыпов 2025-01-20 15:36:41 +03:00
parent 5081cbd5b8
commit f1c274d267
3 changed files with 3 additions and 8 deletions

View file

@ -49,11 +49,6 @@ public class ExtractController {
public ResponseEntity<Resource> getExtract(@PathVariable String formatRegistry) {
UserIdsPair userIdsPair = SecurityUtil.getUserIdsPair();
if (userIdsPair == null || (userIdsPair.getErvuId() == null
&& userIdsPair.getEsiaUserId() == null)) {
return ResponseEntity.noContent().build();
}
String ervuId = userIdsPair.getErvuId();
byte[] reply;

View file

@ -47,7 +47,7 @@ import ru.micord.ervu.security.webbpm.jwt.helper.SecurityHelper;
import ru.micord.ervu.security.webbpm.jwt.service.JwtTokenService;
import ru.micord.ervu.security.webbpm.jwt.model.Token;
import static ru.micord.ervu.security.webbpm.jwt.util.SecurityUtil.getUserAccountId;
import static ru.micord.ervu.security.webbpm.jwt.util.SecurityUtil.getCurrentUserEsiaId;
/**
* @author Eduard Tihomirov
@ -383,7 +383,7 @@ public class EsiaAuthService {
private String getMessageId(Exception exception) {
return Integer.toUnsignedString(Objects
.hashCode(getUserAccountId()), 36)
.hashCode(getCurrentUserEsiaId()), 36)
+ "-"
+ Integer.toUnsignedString(exception.hashCode(), 36);
}

View file

@ -30,7 +30,7 @@ public final class SecurityUtil {
.orElse(null);
}
public static String getUserAccountId() {
public static String getCurrentUserEsiaId() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (auth != null && auth.isAuthenticated()) {
return auth.getName();