mirror of https://github.com/usbharu/Hideout.git
style: fix lint (CI)
This commit is contained in:
parent
27cf8227ea
commit
5e5bbe756b
|
@ -8,7 +8,6 @@ import org.springframework.http.HttpMethod.POST
|
|||
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
||||
import org.springframework.security.config.annotation.web.invoke
|
||||
import org.springframework.security.web.SecurityFilterChain
|
||||
import org.springframework.security.web.util.matcher.AnyRequestMatcher
|
||||
import org.springframework.security.web.util.matcher.RequestMatcher
|
||||
|
||||
@Configuration
|
||||
|
@ -17,10 +16,12 @@ class ActivityPubSecurityConfig {
|
|||
@Order(4)
|
||||
fun activityPubSecurityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||
http {
|
||||
securityMatcher(RequestMatcher {
|
||||
securityMatcher(
|
||||
RequestMatcher {
|
||||
val accept = it.getHeader("Accept") ?: ""
|
||||
return@RequestMatcher accept == "application/json" || accept == "application/activity+json"
|
||||
})
|
||||
}
|
||||
)
|
||||
authorizeHttpRequests {
|
||||
authorize(POST, "/inbox", permitAll)
|
||||
authorize(POST, "/users/{username}/inbox", permitAll)
|
||||
|
|
|
@ -10,6 +10,4 @@ class Task<out T : TaskBody>(
|
|||
val publishedOn: Instant,
|
||||
val body: T,
|
||||
val domain: Domain
|
||||
) : Task() {
|
||||
|
||||
}
|
||||
) : Task()
|
||||
|
|
|
@ -29,17 +29,19 @@ class ActivityStreamHttpMessageConverter : HttpMessageConverter<JsonLd> {
|
|||
outputMessage.headers.contentType = MediaType.APPLICATION_JSON
|
||||
outputMessage.body.bufferedWriter()
|
||||
.use {
|
||||
it.write(JsonUtils.toString(
|
||||
it.write(
|
||||
JsonUtils.toString(
|
||||
JsonLdProcessor.compact(
|
||||
JsonUtils.fromString(JacksonSerializationConverter.convert(t.json).toString()), "https://www.w3.org/ns/activitystreams",
|
||||
JsonUtils.fromString(JacksonSerializationConverter.convert(t.json).toString()),
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
JsonLdOptions()
|
||||
)
|
||||
))
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun read(clazz: Class<out JsonLd>, inputMessage: HttpInputMessage): JsonLd {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package dev.usbharu.hideout.activitypub.external.activitystreams
|
||||
|
||||
|
||||
import dev.usbharu.activitystreamsserialization.dsl.ActivityBuilder
|
||||
import dev.usbharu.activitystreamsserialization.other.JsonLd
|
||||
import dev.usbharu.hideout.core.domain.model.actor.Actor
|
||||
|
@ -25,16 +24,16 @@ class ActorTranslator {
|
|||
owner(actor.url)
|
||||
publicKeyPem(actor.publicKey.publicKey)
|
||||
id(actor.keyId.keyId)
|
||||
})
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
iconMedia?.let {
|
||||
icon {
|
||||
listOf(
|
||||
Image {
|
||||
url(iconMedia.url)
|
||||
})
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
bannerMedia?.let {
|
||||
|
@ -42,7 +41,8 @@ class ActorTranslator {
|
|||
listOf(
|
||||
Image {
|
||||
url(bannerMedia.url)
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue