mirror of
https://github.com/gotson/komga.git
synced 2025-12-06 08:32:25 +01:00
refactor: replace deprecated AntPathRequestMatcher with PathPatternRequestMatcher
This commit is contained in:
parent
d4de08a105
commit
f674d65692
1 changed files with 3 additions and 6 deletions
|
|
@ -1,6 +1,5 @@
|
|||
package org.gotson.komga.infrastructure.security
|
||||
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||
import jakarta.servlet.Filter
|
||||
import org.gotson.komga.domain.model.UserRoles
|
||||
import org.gotson.komga.infrastructure.configuration.KomgaSettingsProvider
|
||||
|
|
@ -35,9 +34,7 @@ import org.springframework.security.web.authentication.AnonymousAuthenticationFi
|
|||
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource
|
||||
import org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher
|
||||
|
||||
private val logger = KotlinLogging.logger {}
|
||||
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
|
|
@ -123,7 +120,7 @@ class SecurityConfiguration(
|
|||
it.maximumSessions(-1)
|
||||
}
|
||||
}.exceptionHandling {
|
||||
it.defaultAuthenticationEntryPointFor(opdsAuthenticationEntryPoint, AntPathRequestMatcher("/opds/v2/**"))
|
||||
it.defaultAuthenticationEntryPointFor(opdsAuthenticationEntryPoint, PathPatternRequestMatcher.withDefaults().matcher("/opds/v2/**"))
|
||||
}
|
||||
|
||||
if (oauth2Enabled) {
|
||||
|
|
@ -242,7 +239,7 @@ class SecurityConfiguration(
|
|||
fun koboAuthenticationFilter(): Filter =
|
||||
ApiKeyAuthenticationFilter(
|
||||
apiKeyAuthenticationProvider(),
|
||||
UriRegexApiKeyAuthenticationConverter(Regex("""\/kobo\/([\w-]+)"""), tokenEncoder, userAgentWebAuthenticationDetailsSource),
|
||||
UriRegexApiKeyAuthenticationConverter(Regex("""/kobo/([\w-]+)"""), tokenEncoder, userAgentWebAuthenticationDetailsSource),
|
||||
)
|
||||
|
||||
fun kosyncAuthenticationFilter(): Filter =
|
||||
|
|
|
|||
Loading…
Reference in a new issue