Skip to content

Commit

Permalink
Merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
borbuevbeksultan committed Dec 30, 2024
1 parent 8bc90e0 commit 9d48b2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.openfuture.openmessenger.configuration

import io.openfuture.openmessenger.security.AwsCognitoTokenFilter
import io.openfuture.openmessenger.security.CognitoAuthenticationProvider
import jakarta.servlet.http.HttpServletRequest
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.Customizer
Expand All @@ -14,9 +13,6 @@ import org.springframework.security.config.annotation.web.configurers.SessionMan
import org.springframework.security.config.http.SessionCreationPolicy
import org.springframework.security.web.SecurityFilterChain
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
import org.springframework.web.cors.CorsConfiguration
import org.springframework.web.cors.CorsConfigurationSource
import org.springframework.web.cors.UrlBasedCorsConfigurationSource

@Configuration
@EnableWebSecurity
Expand Down Expand Up @@ -54,10 +50,9 @@ class SecurityConfig(
"/api/v1/public/login",
"/api/v1/public/signup",
"/api/v1/attachments/download/**",
listOf("/*", "/webjars/**", "/js/*", "/img/*", "/css/*", "/video/*")
listOf("/*", "/webjars/**", "/js/*", "/img/*", "/css/*", "/video/*"),
"/api/v1/refreshToken",
"/api/v1/wallets/webhook",
"/api/v1/attachments/download/**"
"/api/v1/wallets/webhook"
),
UsernamePasswordAuthenticationFilter::class.java
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ class AwsCognitoTokenFilter(
allowedPages: List<String>,
refreshTokenUrl: String?,
webhookUrl: String?,
attachmentDownloadUrl: String?
) : AbstractAuthenticationProcessingFilter(defaultFilterProcessesUrl) {
companion object{
companion object {
private val log = LoggerFactory.getLogger(AwsCognitoTokenFilter::class.java)
}

Expand All @@ -47,6 +46,8 @@ class AwsCognitoTokenFilter(
return !loginRequestMatcher.matches(request) &&
!signupRequestMatcher.matches(request) &&
!attachmentDownloadRequestMatcher.matches(request) &&
!refreshTokenRequestMatcher.matches(request) &&
!webhookRequestMatcher.matches(request) &&
allowedPagesRequestMatchers.all { !it.matches(request) }
}

Expand Down

0 comments on commit 9d48b2d

Please sign in to comment.