fix token removal, improve system properties, add pretix request warnings
This commit is contained in:
parent
4b819f1d08
commit
1488a3b8b7
@ -525,11 +525,15 @@ public class PretixManager implements SmartInitializingSingleton {
|
|||||||
if (payload != null) {
|
if (payload != null) {
|
||||||
request.bodyValue(gson.toJson(payload));
|
request.bodyValue(gson.toJson(payload));
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
String jsonString = request.retrieve().bodyToMono(String.class).block();
|
||||||
|
|
||||||
String jsonString = request.retrieve().bodyToMono(String.class).block();
|
if (StringUtils.hasText(jsonString)) {
|
||||||
|
return JsonParser.parseString(jsonString);
|
||||||
if (StringUtils.hasText(jsonString)) {
|
}
|
||||||
return JsonParser.parseString(jsonString);
|
} catch (WebClientResponseException e) {
|
||||||
|
logger.warn("Error response: " + e.getResponseBodyAsString(), e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.beust.jcommander.internal.Lists;
|
||||||
|
|
||||||
import de.bstly.we.businesslogic.PretixManager;
|
import de.bstly.we.businesslogic.PretixManager;
|
||||||
import de.bstly.we.controller.support.EntityResponseStatusException;
|
import de.bstly.we.controller.support.EntityResponseStatusException;
|
||||||
import de.bstly.we.model.SystemProperty;
|
import de.bstly.we.model.SystemProperty;
|
||||||
@ -90,6 +92,17 @@ public class SystemController extends BaseController {
|
|||||||
return systemPropertyRepository.save(systemProperty);
|
return systemPropertyRepository.save(systemProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||||
|
@PostMapping("/properties/list")
|
||||||
|
public List<SystemProperty> createOrUpdateList(@RequestBody List<SystemProperty> systemProperties) {
|
||||||
|
List<SystemProperty> result = Lists.newArrayList();
|
||||||
|
for (SystemProperty systemProperty : systemProperties) {
|
||||||
|
result.add(
|
||||||
|
systemPropertyRepository.save(systemProperty));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete property.
|
* Delete property.
|
||||||
*
|
*
|
||||||
|
@ -260,9 +260,9 @@ public class TokenSessionManager {
|
|||||||
for (String token : ((String) sessionAttribute).split(",")) {
|
for (String token : ((String) sessionAttribute).split(",")) {
|
||||||
if (!token.equals(secret)) {
|
if (!token.equals(secret)) {
|
||||||
if (StringUtils.hasLength(tokens)) {
|
if (StringUtils.hasLength(tokens)) {
|
||||||
tokens += "," + secret;
|
tokens += "," + token;
|
||||||
} else {
|
} else {
|
||||||
tokens = secret;
|
tokens = token;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
pom.xml
2
pom.xml
@ -14,7 +14,7 @@
|
|||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<querydsl.version>5.0.0</querydsl.version>
|
<querydsl.version>5.0.0</querydsl.version>
|
||||||
<nimbus.version>9.37.3</nimbus.version>
|
<nimbus.version>9.37.3</nimbus.version>
|
||||||
<revision>3.0.2-SNAPSHOT</revision>
|
<revision>3.0.3-SNAPSHOT</revision>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
Loading…
Reference in New Issue
Block a user