■ ■ ■ ■ ■ ■ ■
src/main/java/org/owasp/wrongsecrets/StatsController.java
1 1 package org.owasp.wrongsecrets; 2 2 3 + import io.swagger.v3.oas.annotations.Operation; 3 4 import org.owasp.wrongsecrets.canaries.CanaryCounter; 4 5 import org.springframework.beans.factory.annotation.Autowired; 5 6 import org.springframework.beans.factory.annotation.Value; skipped 16 lines 22 23 @Value("${ctf_enabled}") 23 24 private boolean ctfModeEnabled; 24 25 26 + @Value("${springdoc.swagger-ui.enabled}") 27 + private boolean swaggerUIEnabled; 28 + 29 + @Value("${springdoc.api-docs.enabled}") 30 + private boolean springdockenabled; 31 + 25 32 @Value("${canarytokenURLs}") 26 33 private String[] canaryTokenURLs; 27 34 35 + @Value("${springdoc.swagger-ui.path}") 36 + private String swaggerURI; 37 + 28 38 @GetMapping("/stats") 39 + @Operation(description = "Returns all dynamic data for the stats screen") 29 40 public String getStats(Model model) { 30 41 model.addAttribute("canaryCounter", canaryCounter.getTotalCount()); 31 42 model.addAttribute("sessioncounter", sessionConfiguration.getCounter()); skipped 1 lines 33 44 model.addAttribute("canarytokenURLs", canaryTokenURLs); 34 45 model.addAttribute("hintsEnabled", hintsEnabled); 35 46 model.addAttribute("reasonEnabled", reasonEnabled); 36 - model.addAttribute("ctfModeEnabled",ctfModeEnabled); 47 + model.addAttribute("ctfModeEnabled", ctfModeEnabled); 48 + model.addAttribute("swaggerUIEnabled", swaggerUIEnabled); 49 + model.addAttribute("springdockenabled", springdockenabled); 50 + model.addAttribute("swaggerURI", swaggerURI); 37 51 return "stats"; 38 52 } 39 53 } skipped 1 lines