Skip to content

Commit

Permalink
Fix Sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
federicaagostini committed Jan 27, 2025
1 parent 113aff6 commit ec5c1ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public String approveDevice(@RequestParam("user_code") String userCode,
ClientDetailsEntity client = clientEntityService.loadClientByClientId(dc.getClientId());
model.put("client", client);

if (Boolean.FALSE.equals(approve)) {
if (Boolean.FALSE.equals(approve) || approve == null) {
model.addAttribute(APPROVAL_ATTRIBUTE_KEY, false);
return DEVICE_APPROVED_PAGE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.mitre.openid.connect.service.ScopeClaimTranslationService;
import org.mitre.openid.connect.service.StatsService;
import org.mitre.openid.connect.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

Expand All @@ -38,18 +37,18 @@
@Component
public class IamUserApprovalUtils {

@Autowired
private SystemScopeService scopeService;

@Autowired
private StatsService statsService;

@Autowired
private ScopeClaimTranslationService scopeClaimTranslationService;

@Autowired
private UserInfoService userInfoService;

private final SystemScopeService scopeService;
private final StatsService statsService;
private final ScopeClaimTranslationService scopeClaimTranslationService;
private final UserInfoService userInfoService;

public IamUserApprovalUtils(SystemScopeService scopeService, StatsService statsService,
ScopeClaimTranslationService scopeClaimTranslationService, UserInfoService userInfoService) {
this.scopeService = scopeService;
this.statsService = statsService;
this.scopeClaimTranslationService = scopeClaimTranslationService;
this.userInfoService = userInfoService;
}

public Set<String> sortScopes(Set<SystemScope> scopes) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ public void testDeviceCodeNoApproval() throws Exception {
responseJson = mapper.readTree(response);

userCode = responseJson.get("user_code").asText();
deviceCode = responseJson.get("device_code").asText();

session = (MockHttpSession) mvc.perform(get(DEVICE_USER_URL).session(session))
.andExpect(status().isOk())
Expand Down

0 comments on commit ec5c1ae

Please sign in to comment.