- Fix a security config for Swagger.
- Add the "displayRequestDuration" for "Try it out" requests in Swagger. - Code polishing.
This commit is contained in:
parent
dc469df9d6
commit
a2a387be90
|
@ -64,7 +64,7 @@ public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.regexMatchers("/actuator/.*").permitAll()
|
.regexMatchers("/actuator/.*").permitAll()
|
||||||
.regexMatchers("/metrics").permitAll()
|
.regexMatchers("/metrics").permitAll()
|
||||||
.antMatchers("/v3/api-docs/**","/swagger-ui/**").permitAll()
|
.antMatchers("/api-docs/**","/swagger-ui/**").permitAll()
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
.and()
|
.and()
|
||||||
.logout().logoutUrl("/openid_logout")
|
.logout().logoutUrl("/openid_logout")
|
||||||
|
|
|
@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
|
||||||
@Tag(name="sushilite", description = "Sushi-Lite API")
|
@Tag(name="sushilite", description = "Sushi-Lite API")
|
||||||
public class SushiliteController {
|
public class SushiliteController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SushiliteServiceImpl sushiliteService;
|
private SushiliteServiceImpl sushiliteService;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package eu.dnetlib.repo.manager.controllers;
|
package eu.dnetlib.repo.manager.controllers;
|
||||||
|
|
||||||
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5Service;
|
|
||||||
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5ServiceImpl;
|
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5ServiceImpl;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
@ -42,7 +41,6 @@ public class SushiliteR5Controller {
|
||||||
@RequestParam(value = "dataType",required=false, defaultValue="") String dataType,
|
@RequestParam(value = "dataType",required=false, defaultValue="") String dataType,
|
||||||
@RequestParam(value = "Granularity", required = false, defaultValue ="Monthly") String granularity,
|
@RequestParam(value = "Granularity", required = false, defaultValue ="Monthly") String granularity,
|
||||||
@RequestParam(value = "Pretty",required=false, defaultValue="") String pretty) {
|
@RequestParam(value = "Pretty",required=false, defaultValue="") String pretty) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return sushiliteR5Service.getReportResults(report, release, requestorID, beginDate, endDate, repositoryIdentifier, datasetIdentifier, itemIdentifier, metricTypes, dataType, granularity, pretty);
|
return sushiliteR5Service.getReportResults(report, release, requestorID, beginDate, endDate, repositoryIdentifier, datasetIdentifier, itemIdentifier, metricTypes, dataType, granularity, pretty);
|
||||||
} catch (JSONException je) {
|
} catch (JSONException je) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package eu.dnetlib.repo.manager.service.sushilite;
|
package eu.dnetlib.repo.manager.service.sushilite;
|
||||||
|
|
||||||
import eu.dnetlib.usagestats.sushilite.domain.ReportResponseWrapper;
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ springdoc:
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
disable-swagger-default-url: true
|
disable-swagger-default-url: true
|
||||||
path: /swagger-ui.html
|
path: /swagger-ui.html
|
||||||
|
displayRequestDuration: true
|
||||||
api-docs:
|
api-docs:
|
||||||
path: /api-docs
|
path: /api-docs
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,5 @@
|
||||||
<Logger name="org.springframework.boot" level="warn" additivity="false">
|
<Logger name="org.springframework.boot" level="warn" additivity="false">
|
||||||
<AppenderRef ref="LogToConsole"/>
|
<AppenderRef ref="LogToConsole"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
<Logger name="springfox.documentation" level="warn" additivity="false">
|
|
||||||
<AppenderRef ref="LogToConsole"/>
|
|
||||||
</Logger>
|
|
||||||
</Loggers>
|
</Loggers>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
|
|
Loading…
Reference in New Issue