Replace wildcard type ? with * in Kotlin and fix typo

This commit is contained in:
moon 2023-08-21 06:06:37 +09:00 committed by Steve Riesenberg
parent 91a8ed1ba7
commit 3a50c92168
1 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ Kotlin::
@EnableWebSocketSecurity // <1> <2> @EnableWebSocketSecurity // <1> <2>
open class WebSocketSecurityConfig { // <1> <2> open class WebSocketSecurityConfig { // <1> <2>
@Bean @Bean
fun messageAuthorizationManager(messages: MessageMatcherDelegatingAuthorizationManager.Builder): AuthorizationManager<Message<?>> { fun messageAuthorizationManager(messages: MessageMatcherDelegatingAuthorizationManager.Builder): AuthorizationManager<Message<*>> {
messages.simpDestMatchers("/user/**").hasRole("USER") // <3> messages.simpDestMatchers("/user/**").hasRole("USER") // <3>
return messages.build() return messages.build()
} }
@ -108,7 +108,7 @@ Kotlin::
@EnableWebSocketSecurity // <1> <2> @EnableWebSocketSecurity // <1> <2>
open class WebSocketSecurityConfig { open class WebSocketSecurityConfig {
@Bean @Bean
fun messageAuthorizationManager(messages: MessageMatcherDelegatingAuthorizationManager.Builder): AuthorizationManager<Message<?>> { fun messageAuthorizationManager(messages: MessageMatcherDelegatingAuthorizationManager.Builder): AuthorizationManager<Message<*>> {
return AuthorityAuthorizationManager.hasRole("USER") // <3> return AuthorityAuthorizationManager.hasRole("USER") // <3>
} }
} }
@ -156,7 +156,7 @@ Kotlin::
---- ----
@Configuration @Configuration
open class WebSocketSecurityConfig { open class WebSocketSecurityConfig {
fun messageAuthorizationManager(messages: MessageMatcherDelegatingAuthorizationManager.Builder): AuthorizationManager<Message<?> { fun messageAuthorizationManager(messages: MessageMatcherDelegatingAuthorizationManager.Builder): AuthorizationManager<Message<*>> {
messages messages
.nullDestMatcher().authenticated() // <1> .nullDestMatcher().authenticated() // <1>
.simpSubscribeDestMatchers("/user/queue/errors").permitAll() // <2> .simpSubscribeDestMatchers("/user/queue/errors").permitAll() // <2>
@ -394,7 +394,7 @@ open class WebSocketSecurityConfig : WebSocketMessageBrokerConfigurer {
@Override @Override
override fun configureClientInboundChannel(registration: ChannelRegistration) { override fun configureClientInboundChannel(registration: ChannelRegistration) {
var myAuthorizationRules: AuthorizationManager<Message<?>> = AuthenticatedAuthorizationManager.authenticated() var myAuthorizationRules: AuthorizationManager<Message<*>> = AuthenticatedAuthorizationManager.authenticated()
var authz: AuthorizationChannelInterceptor = AuthorizationChannelInterceptor(myAuthorizationRules) var authz: AuthorizationChannelInterceptor = AuthorizationChannelInterceptor(myAuthorizationRules)
var publisher: AuthorizationEventPublisher = SpringAuthorizationEventPublisher(this.context) var publisher: AuthorizationEventPublisher = SpringAuthorizationEventPublisher(this.context)
authz.setAuthorizationEventPublisher(publisher) authz.setAuthorizationEventPublisher(publisher)