- Fix a security config for Swagger.

- Add the "displayRequestDuration" for "Try it out" requests in Swagger.
- Code polishing.
This commit is contained in:
Lampros Smyrnaios 2023-06-02 14:23:54 +03:00
parent dc469df9d6
commit a2a387be90
7 changed files with 5 additions and 11 deletions

View File

@ -64,7 +64,7 @@ public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter {
.authorizeRequests()
.regexMatchers("/actuator/.*").permitAll()
.regexMatchers("/metrics").permitAll()
.antMatchers("/v3/api-docs/**","/swagger-ui/**").permitAll()
.antMatchers("/api-docs/**","/swagger-ui/**").permitAll()
.anyRequest().authenticated()
.and()
.logout().logoutUrl("/openid_logout")

View File

@ -61,9 +61,9 @@ public class PiWikController {
@Parameter(name = "searchField", description = "string")
})
public Paging<PiwikInfo> getPiwikSitesForRepos(
@RequestParam(value = "from",required=false,defaultValue = "0") int from,
@RequestParam(value = "quantity",required=false,defaultValue = "100") int quantity,
@RequestParam(value = "order",required=false,defaultValue = "DSC") OrderByType orderType,
@RequestParam(value = "from", required=false, defaultValue = "0") int from,
@RequestParam(value = "quantity", required=false, defaultValue = "100") int quantity,
@RequestParam(value = "order", required=false, defaultValue = "DSC") OrderByType orderType,
@RequestParam(value = "orderField", required = false, defaultValue = "REPOSITORY_NAME") OrderByField orderField,
@RequestParam(value = "searchField", required = false, defaultValue = "") String searchField

View File

@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
@Tag(name="sushilite", description = "Sushi-Lite API")
public class SushiliteController {
@Autowired
private SushiliteServiceImpl sushiliteService;

View File

@ -1,6 +1,5 @@
package eu.dnetlib.repo.manager.controllers;
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5Service;
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5ServiceImpl;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.json.JSONException;
@ -42,7 +41,6 @@ public class SushiliteR5Controller {
@RequestParam(value = "dataType",required=false, defaultValue="") String dataType,
@RequestParam(value = "Granularity", required = false, defaultValue ="Monthly") String granularity,
@RequestParam(value = "Pretty",required=false, defaultValue="") String pretty) {
try {
return sushiliteR5Service.getReportResults(report, release, requestorID, beginDate, endDate, repositoryIdentifier, datasetIdentifier, itemIdentifier, metricTypes, dataType, granularity, pretty);
} catch (JSONException je) {

View File

@ -1,6 +1,5 @@
package eu.dnetlib.repo.manager.service.sushilite;
import eu.dnetlib.usagestats.sushilite.domain.ReportResponseWrapper;
import org.json.JSONException;
import org.springframework.http.ResponseEntity;

View File

@ -7,6 +7,7 @@ springdoc:
swagger-ui:
disable-swagger-default-url: true
path: /swagger-ui.html
displayRequestDuration: true
api-docs:
path: /api-docs

View File

@ -15,8 +15,5 @@
<Logger name="org.springframework.boot" level="warn" additivity="false">
<AppenderRef ref="LogToConsole"/>
</Logger>
<Logger name="springfox.documentation" level="warn" additivity="false">
<AppenderRef ref="LogToConsole"/>
</Logger>
</Loggers>
</Configuration>