authorization.adoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. = Authorization Migrations
  2. The following steps relate to how to finish migrating authorization support.
  3. == Use `AuthorizationManager` for Method Security
  4. There are no further migration steps for this feature.
  5. == Use `AuthorizationManager` for Message Security
  6. In 6.0, `<websocket-message-broker>` defaults `use-authorization-manager` to `true`.
  7. So, to complete migration, remove any `websocket-message-broker@use-authorization-manager=true` attribute.
  8. For example:
  9. ====
  10. .Xml
  11. [source,xml,role="primary"]
  12. ----
  13. <websocket-message-broker use-authorization-manager="true"/>
  14. ----
  15. ====
  16. changes to:
  17. ====
  18. .Xml
  19. [source,xml,role="primary"]
  20. ----
  21. <websocket-message-broker/>
  22. ----
  23. ====
  24. There are no further migrations steps for Java or Kotlin for this feature.
  25. == Use `AuthorizationManager` for Request Security
  26. In 6.0, `<http>` defaults `once-per-request` to `false`, `filter-all-dispatcher-types` to `true`, and `use-authorization-manager` to `true`.
  27. Also, xref:servlet/authorization/authorize-requests.adoc#filtersecurityinterceptor-every-request[`authorizeRequests#filterSecurityInterceptorOncePerRequest`] defaults to `false` and xref:servlet/authorization/authorize-http-requests.adoc[`authorizeHttpRequests#filterAllDispatcherTypes`] defaults to `true`.
  28. So, to complete migration, any defaults values can be removed.
  29. For example, if you opted in to the 6.0 default for `filter-all-dispatcher-types` or `authorizeHttpRequests#filterAllDispatcherTypes` like so:
  30. ====
  31. .Java
  32. [source,java,role="primary"]
  33. ----
  34. http
  35. .authorizeHttpRequests((authorize) -> authorize
  36. .filterAllDispatcherTypes(true)
  37. // ...
  38. )
  39. ----
  40. .Kotlin
  41. [source,java,role="secondary"]
  42. ----
  43. http {
  44. authorizeHttpRequests {
  45. filterAllDispatcherTypes = true
  46. // ...
  47. }
  48. }
  49. ----
  50. .Xml
  51. [source,xml,role="secondary"]
  52. ----
  53. <http use-authorization-manager="true" filter-all-dispatcher-types="true"/>
  54. ----
  55. ====
  56. then the defaults may be removed:
  57. ====
  58. .Java
  59. [source,java,role="primary"]
  60. ----
  61. http
  62. .authorizeHttpRequests((authorize) -> authorize
  63. // ...
  64. )
  65. ----
  66. .Kotlin
  67. [source,java,role="secondary"]
  68. ----
  69. http {
  70. authorizeHttpRequests {
  71. // ...
  72. }
  73. }
  74. ----
  75. .Xml
  76. [source,xml,role="secondary"]
  77. ----
  78. <http/>
  79. ----
  80. ====
  81. [NOTE]
  82. ====
  83. `once-per-request` applies only when `use-authorization-manager="false"` and `filter-all-dispatcher-types` only applies when `use-authorization-manager="true"`
  84. ====