aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/security
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-11-11 23:15:01 +0300
committerGravatar Vitaly Takmazov2023-11-11 23:15:01 +0300
commit816db24929732fa3967667ec76d95cbfb01068d1 (patch)
tree6a1686bb4161be22ff32765ec270236935d94dcd /src/main/java/com/juick/service/security
parent4d51f184da68cf8b70bdd406f0b90f3e758f1607 (diff)
Make sure HTTP requests actually use caching
* OkHttp dispatcher is not used for synchronous requests * @Cacheable only works for bean method calls, refactor beans to use it correctly
Diffstat (limited to 'src/main/java/com/juick/service/security')
-rw-r--r--src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java b/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java
index 55c87383..30cb1512 100644
--- a/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java
+++ b/src/main/java/com/juick/service/security/HTTPSignatureAuthenticationFilter.java
@@ -17,8 +17,8 @@
package com.juick.service.security;
+import com.juick.ActivityPubManager;
import com.juick.model.User;
-import com.juick.service.ActivityPubService;
import com.juick.service.UserService;
import com.juick.service.security.entities.JuickUser;
import jakarta.servlet.FilterChain;
@@ -37,13 +37,13 @@ import java.util.stream.Collectors;
public class HTTPSignatureAuthenticationFilter extends BaseAuthenticationFilter {
- private final ActivityPubService signatureManager;
+ private final ActivityPubManager activityPubManager;
private final UserService userService;
public HTTPSignatureAuthenticationFilter(
- final ActivityPubService activityPubService,
+ final ActivityPubManager activityPubManager,
final UserService userService) {
- this.signatureManager = activityPubService;
+ this.activityPubManager = activityPubManager;
this.userService = userService;
}
@@ -54,7 +54,7 @@ public class HTTPSignatureAuthenticationFilter extends BaseAuthenticationFilter
Map<String, String> headers = Collections.list(request.getHeaderNames())
.stream()
.collect(Collectors.toMap(String::toLowerCase, request::getHeader));
- var user = signatureManager.verifyActor(request.getMethod(), request.getRequestURI(), headers);
+ var user = activityPubManager.verifyActor(request.getMethod(), request.getRequestURI(), headers);
String userUri = user.getUri().toString();
if (!user.isAnonymous() || userUri.length() > 0) {
if (userUri.length() == 0) {