Commit 8d41248
authored
Remove synthetic role names for legacy API keys (elastic#119844)
This PR addresses an issue where legacy API keys fail consistency checks
because they include synthetic role names.
We removed synthetic role names with
elastic#56005. We added
consistency checks sometime later to enforce no role names, with
elastic#93894 in `8.8.0`.
Rather than relaxing our consistency checks, this PR tweaks
de-serialization logic to strip out role names when appropriate. This
has the advantage that we maintain the invariant the consistency check
is meant to enforce.
Note that this does not manifest in production: outside of RCS 2.0, we
only execute consistency checks with assertions enabled. For RCS 2.0, an
API key would require `remote_indices` privileges to ever be sent cross
cluster and go through consistency checks. These were introduced after
we've stopped including role names in API keys so it's not a real issue
either.
Closes: elastic#119259 Closes:
elastic#119435 Closes:
elastic#119434 Closes:
elastic#119433 Closes:
elastic#119424 Closes:
elastic#119423 Closes:
elastic#119422 Closes:
elastic#119396 Closes:
elastic#119395 Closes:
elastic#119394 Closes:
elastic#1193931 parent abe8d7f commit 8d41248
File tree
3 files changed
+79
-32
lines changed- x-pack/plugin/core/src
- main/java/org/elasticsearch/xpack/core/security/authc
- test/java/org/elasticsearch/xpack/core/security/authc
3 files changed
+79
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | 431 | | |
444 | 432 | | |
445 | 433 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | 434 | | |
450 | 435 | | |
451 | 436 | | |
| |||
469 | 454 | | |
470 | 455 | | |
471 | 456 | | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | 457 | | |
488 | 458 | | |
489 | 459 | | |
| |||
Lines changed: 31 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
173 | 175 | | |
174 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| 186 | + | |
179 | 187 | | |
180 | 188 | | |
181 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
182 | 195 | | |
| 196 | + | |
183 | 197 | | |
184 | 198 | | |
185 | 199 | | |
186 | 200 | | |
187 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
188 | 217 | | |
189 | 218 | | |
190 | 219 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
| 28 | + | |
25 | 29 | | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 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 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
174 | 222 | | |
0 commit comments