Skip to content

Commit

Permalink
Idporten userinfo request mer logging
Browse files Browse the repository at this point in the history
#deploy-dolly-backend
  • Loading branch information
stigus committed Aug 23, 2024
1 parent 4d37a63 commit 7104103
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import no.nav.testnav.libs.securitycore.domain.UserInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import java.util.Arrays;
import java.util.Optional;
import java.util.concurrent.Callable;

Expand All @@ -33,12 +31,7 @@ public Optional<UserInfo> call() {
var req = RequestContextHolder.getRequestAttributes();

if (nonNull(req)) {
log.info(Arrays.stream(req.getAttributeNames(RequestAttributes.SCOPE_REQUEST)).reduce("Request attributes: ", (acc, name) -> {
if (acc.length() != 11 && name.length() != 11) {
return acc + name + ", ";
}
return "";
}));
log.info("RequestAttributes er av type: {}", req.getClass().getName());
}
var requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (isNull(requestAttributes)) {
Expand Down

0 comments on commit 7104103

Please sign in to comment.