mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2026-03-06 22:37:58 -05:00
fix to users controller and added logging
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -31,3 +31,6 @@ build/
|
|||||||
|
|
||||||
### VS Code ###
|
### VS Code ###
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
###
|
||||||
|
/logs/
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
|
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
|
||||||
.requestMatchers("/actuator/health", "/actuator/info").permitAll()
|
.requestMatchers("/actuator/health", "/actuator/info").permitAll()
|
||||||
.requestMatchers("/api/products/gunbuilder/**", "/api/v1/products/gunbuilder/**").permitAll()
|
.requestMatchers("/api/products/gunbuilder/**", "/api/v1/products/gunbuilder/**").permitAll()
|
||||||
|
.requestMatchers("/api/admin/users/**").permitAll()
|
||||||
|
|
||||||
// Short links (public redirect)
|
// Short links (public redirect)
|
||||||
.requestMatchers(HttpMethod.GET, "/go/**").permitAll()
|
.requestMatchers(HttpMethod.GET, "/go/**").permitAll()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.time.OffsetDateTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping({"/api/v1/admin/users"})
|
@RequestMapping({"/api/v1/save/admin/users"})
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
public class AdminUsersController {
|
public class AdminUsersController {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static org.testng.Reporter.log;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping({"/admin/users", "/api/v1/admin/users"})
|
@RequestMapping({"/admin/users", "/api/v1/admin/users"})
|
||||||
@PreAuthorize("hasRole(" + Constants.ROLE_ADMIN + ")")
|
@PreAuthorize("hasRole(" + Constants.ROLE_ADMIN + ")")
|
||||||
@@ -24,6 +26,7 @@ public class AdminUserController {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public List<AdminUserDto> listUsers() {
|
public List<AdminUserDto> listUsers() {
|
||||||
|
log("AdminUserController: listUsers called");
|
||||||
return adminUserService.getAllUsersForAdmin();
|
return adminUserService.getAllUsersForAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,4 +86,19 @@ spring.jackson.serialization.fail-on-empty-beans=false
|
|||||||
# looking for a fix to the http & https CORS issue
|
# looking for a fix to the http & https CORS issue
|
||||||
server.forward-headers-strategy=framework
|
server.forward-headers-strategy=framework
|
||||||
|
|
||||||
org.springframework.security=DEBUG
|
|
||||||
|
#Logging
|
||||||
|
logging.file.name=logs/spring.log
|
||||||
|
|
||||||
|
# General logging
|
||||||
|
logging.level.root=INFO
|
||||||
|
|
||||||
|
# Web + Controller requests
|
||||||
|
logging.level.org.springframework.web=DEBUG
|
||||||
|
|
||||||
|
# Spring Security (403 / 401 / auth issues)
|
||||||
|
logging.level.org.springframework.security=DEBUG
|
||||||
|
|
||||||
|
# Tomcat + proxy headers
|
||||||
|
logging.level.org.apache.catalina=DEBUG
|
||||||
|
logging.level.org.springframework.boot.web.embedded.tomcat=DEBUG
|
||||||
Reference in New Issue
Block a user