aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-15 20:40:59 +0300
committerGravatar Vitaly Takmazov2022-12-15 20:40:59 +0300
commit725f2fde72df4bdd92a2262fbb335f40e0a81a1c (patch)
tree71e1612dd27c630a4115c56838e974720a8850d8 /src/main/java/com/juick/config
parentb1267ab73fd601dcc1636a64d86135d72631b525 (diff)
Extract profile URI helpers into ProfileUriBuilder
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r--src/main/java/com/juick/config/ActivityPubConfig.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/juick/config/ActivityPubConfig.java b/src/main/java/com/juick/config/ActivityPubConfig.java
index 786e19c4..3570b97d 100644
--- a/src/main/java/com/juick/config/ActivityPubConfig.java
+++ b/src/main/java/com/juick/config/ActivityPubConfig.java
@@ -24,7 +24,9 @@ import com.juick.util.ActivityPubRequestInterceptor;
import com.juick.www.WebApp;
import com.juick.www.api.activity.converters.UserToActorConverter;
+import com.juick.www.api.activity.helpers.ProfileUriBuilder;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
@@ -45,6 +47,8 @@ public class ActivityPubConfig {
KeystoreManager keystoreManager;
@Inject
WebApp webApp;
+ @Value("${ap_base_uri:http://localhost:8080/}")
+ private String baseUri;
@Bean
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter() {
@@ -80,6 +84,10 @@ public class ActivityPubConfig {
@Bean
UserToActorConverter userToActorConverter() {
- return new UserToActorConverter(activityPubManager(), keystoreManager, webApp);
+ return new UserToActorConverter(profileUriBuilder(), keystoreManager, webApp);
+ }
+ @Bean
+ ProfileUriBuilder profileUriBuilder() {
+ return new ProfileUriBuilder(baseUri);
}
}