Skip to content

Commit

Permalink
Merge pull request #129 from JanardhanBS-SyncByte/develop-java21
Browse files Browse the repository at this point in the history
[MOSIP-33145]
  • Loading branch information
ckm007 committed May 24, 2024
2 parents 7e843af + c60fe49 commit 8080278
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ public HttpFirewall defaultHttpFirewall() {
@Bean
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
httpSecurity.httpBasic(AbstractHttpConfigurer::disable);
httpSecurity.csrf(AbstractHttpConfigurer::disable);
/*
* Disabling CSRF protection because this is a stateless API that uses token-based authentication
*/
httpSecurity.csrf(AbstractHttpConfigurer::disable); // NOSONAR
httpSecurity.authorizeHttpRequests(http -> http.anyRequest().permitAll());

return httpSecurity.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.Errors;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
Expand Down Expand Up @@ -44,7 +45,7 @@
@RestController
@RequestMapping("/")
@Api(tags = "Sdk")
//@CrossOrigin("*")
@CrossOrigin("*") // NOSONAR
public class MainController {

private Logger logger = LoggerConfig.logConfig(MainController.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@ private String decode(String data) {
try {
return Utils.base64Decode(data);
} catch (RuntimeException e) {
e.printStackTrace();
logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, ErrorMessages.INVALID_REQUEST_BODY.toString(),
e.toString() + " " + e.getMessage());
logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, ErrorMessages.INVALID_REQUEST_BODY.toString(), e);
throw new BioSDKException(ErrorMessages.INVALID_REQUEST_BODY.toString(),
ErrorMessages.INVALID_REQUEST_BODY.getMessage() + ": " + e.toString() + " " + e.getMessage());
}
Expand Down

0 comments on commit 8080278

Please sign in to comment.