Commit d057d0e
authored
chore(deps): upgrade to Spring Framework 7 generation (PR-MAJOR) (#24475)
* chore(deps): upgrade to Spring Framework 7 generation (PR-MAJOR)
Atomic generation bump after Phase 0 prep PRs A-G:
- Spring Framework 6.2.18 -> 7.0.8
- Spring Security 6.5.10 -> 7.0.6
- Spring Authorization Server 1.5.2 -> 7.0.6
- Spring Data Redis 2.7.18 -> 4.1.0
- Spring Session Data Redis 2.7.4 -> 4.1.0 (aligned with session-core 4.1.0)
- JUnit 5.12.2 -> 6.0.3
- surefire: spring.test.extension.context.scope=test_class
Spring-7-only API migrations:
- HttpHeaders no longer implements Map (AuthScheme, RouteService, advice, tests)
- OAuth2 RestClientAuthorizationCodeTokenResponseClient (private_key_jwt kept)
- Authorization Server package moves + OAuth2AuthorizationServerConfigurer ctor
- ObjectPostProcessor package move; AbstractAuthenticationToken(null) cast
- Hibernate SpringSessionContext FQCN -> org.springframework.orm.jpa.hibernate
- RedisTemplate<String,Object> for session
- setPatternParser(null) keep AntPathMatcher until PathPattern migration
- Temporary requireProofKey(false) bridge (SAS 7 PKCE-by-default); PR-H to adopt PKCE
Validated: clean reactor test-compile + unit-test profile green.
Based on spike PR #24087; Phase 0 prep already on master.
* fix: declare spring-web on dhis-api for HttpHeaders AuthScheme API
AuthScheme.apply now takes org.springframework.http.HttpHeaders (Spring 7
no longer implements Map). dependency:analyze requires an explicit
spring-web compile dependency on dhis-api.
* fix: use Spring Data Redis 4.0.6 + Lettuce 6.8.2 (not SDR 4.1)
SDR 4.1.0 requires Lettuce 7.5+ (DriverInfo). That blew up app boot in
api-test with ClassNotFoundException: io.lettuce.core.DriverInfo.
Stay on the 4.0.x line for MAJOR (aligned with spike PR #24087):
- spring-data-redis 4.0.6
- spring-session-core / spring-session-data-redis 4.0.4
- lettuce 6.8.2.RELEASE
Lettuce 7 remains PR-L after deliberate SDR 4.1+ adoption.
* fix: SAS 7 PKCE/DCR/auth_time + data-exchange dependency analyze
- dhis-service-data-exchange: drop unused spring-core (analyze fail)
- Force requireProofKey(false) on client create/toEntity/DCR converter
(SAS 7 PKCE-by-default temporary bridge; PR-H removes this)
- DCR tests: omit scope (SAS 7 rejects scope on registration)
- Federated OIDC test: clientSettings.requireProofKey(false) + Factor auth
- TwoFactorAuthenticationProvider + OAuth2Authorization load path: ensure
FactorGrantedAuthority so JwtGenerator can set OIDC auth_time when
SessionRegistry is present (fixes OAuth2Test 500 authenticationTime)
* fix: DCR default scopes; stop forcing requireProofKey on RegisteredClient save
- DCR without scope (SAS 7) gets openid/profile/username/email defaults so
client_credentials token requests still work
- Do not rewrite requireProofKey in toEntity (round-trip fidelity for
Dhis2OAuth2ClientServiceIntegrationTest); keep false only for CRUD
applyCreateDefaults when clientSettings is null + DCR converter
- Authorization integration test: allow FACTOR_* authorities after load
* style: clear Sonar new-code smells on Spring 7 PR
- avoid null credentials in UsernamePasswordAuthenticationToken.authenticated
- SessionFixationConfigurer method reference; drop unused throws Exception
- wrap AS filter-chain config Exception as IllegalStateException
- TestBase clearSecurityContext; package-private test methods
* style: clear remaining Sonar smells on Spring 7 PR
Wrap filterChain Exception; requireNonNull principals; package-private
RouteControllerTest beforeEach.
* style: null-check principal before AuthenticationToken.authenticated (S4449)
* fix: cast OAuth2User when rebuilding OAuth2AuthenticationToken
* style: spotless import order for OAuth2User
* chore: remove local plan and changelog docs from PR-MAJOR
These markdown planning/changelog files must not ship in product PRs.
* refactor: keep spring-web out of dhis-api
Reverts the AuthScheme signature change back to the JDK-typed
Map<String, List<String>> from master, removing the spring-web
dependency that was added to dhis-api.
Spring 7 HttpHeaders no longer implements MultiValueMap, so the two
call sites (RouteService, WebhookHandler) now collect auth headers in
a plain map and merge them into HttpHeaders afterwards, keeping the
web type in the web-aware modules where spring-web is available.
Keeps the Spring Security 7 constructor disambiguation cast in
OAuth2ClientCredentialsAuthScheme.1 parent e4a9688 commit d057d0e
30 files changed
Lines changed: 252 additions & 221 deletions
File tree
- dhis-2
- dhis-api/src/main/java/org/hisp/dhis/common/auth
- dhis-services
- dhis-service-core/src
- main/java/org/hisp/dhis
- route
- security
- oauth2
- authorization
- client
- oidc
- spring2fa
- test/java/org/hisp/dhis/sms
- dhis-service-data-exchange
- dhis-service-event-hook/src/main/java/org/hisp/dhis/eventhook/handlers
- dhis-support
- dhis-support-hibernate/src/main/java/org/hisp/dhis/config
- dhis-support-test/src/main/java/org/hisp/dhis/test
- dhis-test-integration/src/test/java/org/hisp/dhis/security/oauth2/authorization
- dhis-test-web-api/src/test/java/org/hisp/dhis
- test/webapi
- webapi/controller
- metadata
- security
- dhis-web-api/src
- main/java/org/hisp/dhis/webapi
- controller
- security
- apikey
- config
- session
- test/java/org/hisp/dhis/webapi
- controller
- utils
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
483 | | - | |
| 484 | + | |
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
| |||
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
589 | | - | |
| 590 | + | |
590 | 591 | | |
591 | 592 | | |
592 | 593 | | |
| 594 | + | |
593 | 595 | | |
594 | 596 | | |
595 | 597 | | |
596 | | - | |
| 598 | + | |
| 599 | + | |
597 | 600 | | |
598 | 601 | | |
599 | 602 | | |
| |||
646 | 649 | | |
647 | 650 | | |
648 | 651 | | |
649 | | - | |
| 652 | + | |
| 653 | + | |
650 | 654 | | |
651 | 655 | | |
652 | 656 | | |
| |||
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
258 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
| |||
474 | 482 | | |
475 | 483 | | |
476 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
477 | 524 | | |
478 | 525 | | |
479 | 526 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
391 | 393 | | |
392 | | - | |
| 394 | + | |
| 395 | + | |
393 | 396 | | |
394 | 397 | | |
395 | 398 | | |
| |||
Lines changed: 19 additions & 105 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 38 | | |
45 | 39 | | |
46 | 40 | | |
47 | | - | |
48 | | - | |
| 41 | + | |
49 | 42 | | |
50 | 43 | | |
51 | | - | |
52 | | - | |
53 | 44 | | |
54 | | - | |
55 | 45 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 46 | | |
61 | 47 | | |
62 | 48 | | |
63 | 49 | | |
64 | 50 | | |
65 | 51 | | |
66 | 52 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
72 | 58 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
77 | 63 | | |
78 | 64 | | |
79 | 65 | | |
80 | 66 | | |
81 | 67 | | |
82 | 68 | | |
83 | 69 | | |
84 | | - | |
85 | | - | |
86 | 70 | | |
87 | 71 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 72 | + | |
95 | 73 | | |
96 | 74 | | |
97 | | - | |
98 | | - | |
| 75 | + | |
| 76 | + | |
99 | 77 | | |
100 | 78 | | |
101 | 79 | | |
| |||
129 | 107 | | |
130 | 108 | | |
131 | 109 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
144 | 114 | | |
145 | 115 | | |
146 | 116 | | |
147 | 117 | | |
148 | | - | |
149 | | - | |
| 118 | + | |
150 | 119 | | |
151 | 120 | | |
152 | 121 | | |
153 | | - | |
154 | | - | |
155 | 122 | | |
156 | 123 | | |
157 | 124 | | |
158 | 125 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 126 | + | |
213 | 127 | | |
214 | 128 | | |
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | | - | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
| 191 | + | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
| |||
0 commit comments