对于最新的稳定版本,请使用 Spring Security 6.5.3! |
授权迁移
以下步骤与如何完成授权支持的迁移有关。
用AuthorizationManager
用于消息安全
在 6.0 中,<websocket-message-broker>
默认值use-authorization-manager
自true
.
因此,要完成迁移,请删除任何websocket-message-broker@use-authorization-manager=true
属性。
例如:
-
Xml
<websocket-message-broker use-authorization-manager="true"/>
更改为:
-
Xml
<websocket-message-broker/>
对于此功能,没有进一步的 Java 或 Kotlin 迁移步骤。
用AuthorizationManager
用于请求安全性
在 6.0 中,<http>
默认值once-per-request
自false
,filter-all-dispatcher-types
自true
和use-authorization-manager
自true
.
也authorizeRequests#filterSecurityInterceptorOncePerRequest
默认为false
和authorizeHttpRequests#filterAllDispatcherTypes
默认为true
.
因此,要完成迁移,可以删除任何默认值。
例如,如果您选择启用 6.0 默认值filter-all-dispatcher-types
或authorizeHttpRequests#filterAllDispatcherTypes
这样:
-
Java
-
Kotlin
-
Xml
http
.authorizeHttpRequests((authorize) -> authorize
.filterAllDispatcherTypes(true)
// ...
)
http {
authorizeHttpRequests {
filterAllDispatcherTypes = true
// ...
}
}
<http use-authorization-manager="true" filter-all-dispatcher-types="true"/>
然后可以删除默认值:
-
Java
-
Kotlin
-
Xml
http
.authorizeHttpRequests((authorize) -> authorize
// ...
)
http {
authorizeHttpRequests {
// ...
}
}
<http/>
|