对于最新的稳定版本,请使用 Spring Security 6.4.1! |
授权迁移
以下步骤与如何完成迁移授权支持相关。
用AuthorizationManager
针对 Message Security
在 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"/>
那么 defaults 可能会被删除:
-
Java
-
Kotlin
-
Xml
http
.authorizeHttpRequests((authorize) -> authorize
// ...
)
http {
authorizeHttpRequests {
// ...
}
}
<http/>
|