Skip to content

Commit b69cb7a

Browse files
authored
release: 2.1.8 (#390)
2 parents bb981af + adccc4a commit b69cb7a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/kotlin/org/gitanimals/guild/domain/GuildRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ interface GuildRepository : JpaRepository<Guild, Long> {
110110
@Query(
111111
"""
112112
select g from Guild as g
113-
left join fetch g.members as m
113+
left join g.members as m
114114
left join g.waitMembers as wm
115115
where g.leader.name = :name or m.name = :name or wm.name = :name
116116
"""

src/main/kotlin/org/gitanimals/supports/orchestrate/SupportsOrchestrateHttpClientConfigurer.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.gitanimals.core.HttpClientErrorHandler
44
import org.gitanimals.core.auth.InternalAuthRequestInterceptor
55
import org.gitanimals.core.filter.MDCFilter
66
import org.slf4j.MDC
7+
import org.springframework.beans.factory.annotation.Value
78
import org.springframework.context.annotation.Bean
89
import org.springframework.context.annotation.Configuration
910
import org.springframework.context.annotation.Profile
@@ -14,6 +15,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory
1415
@Configuration
1516
@Profile("!test")
1617
class SupportsOrchestrateHttpClientConfigurer(
18+
@Value("\${internal.secret}") private val internalSecret: String,
1719
private val internalAuthRequestInterceptor: InternalAuthRequestInterceptor,
1820
) {
1921

@@ -23,6 +25,9 @@ class SupportsOrchestrateHttpClientConfigurer(
2325
.builder()
2426
.requestInterceptor { request, body, execution ->
2527
request.headers.add(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
28+
if (request.uri.path.startsWith("/internals")) {
29+
request.headers.add(INTERNAL_SECRET_KEY, internalSecret)
30+
}
2631
execution.execute(request, body)
2732
}
2833
.requestInterceptor(internalAuthRequestInterceptor)
@@ -40,6 +45,10 @@ class SupportsOrchestrateHttpClientConfigurer(
4045
@Bean
4146
fun supportsOrchestrateHttpClientErrorHandler(): HttpClientErrorHandler =
4247
HttpClientErrorHandler()
48+
49+
private companion object {
50+
private const val INTERNAL_SECRET_KEY = "Internal-Secret"
51+
}
4352
}
4453

4554
@Configuration

0 commit comments

Comments
 (0)