From 725f2fde72df4bdd92a2262fbb335f40e0a81a1c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 15 Dec 2022 20:40:59 +0300 Subject: Extract profile URI helpers into ProfileUriBuilder --- src/main/java/com/juick/config/ActivityPubConfig.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/config') 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); } } -- cgit v1.2.3