Commit 2b91dd5
authored
Refactor remote cluster interceptor and tests (#135747)
Initially, the
`RemoteClusterTransportInterceptor#getProfileTransportFilters` required
remote-cluster security extensions to provide transport filters for all
transport profiles. The method was too generic and not specific to only
`_remote_cluster` transport profile. This meant that RCS extensions were
free to decide which filter they wanted to "override" with its custom
transport filter implementation. This turned out to be unnecessary,
because RCS extensions only ever need to provide a custom implementation
for the remote cluster profile. This refactoring removes the need to
provide the "default" `ServerTransportFilter` in order for security to
work.
Followups to: -
#134785 (comment)
-
#134785 (comment)
-
#134245 (comment)
--- - Converted `ServerTransportFilter` to interface with a default
implementation. - Refactored `RemoteClusterTransportInterceptor` to
allow optionally providing only a custom remote cluster transport
filter. It's no longer required from RCS extensions to provide the
default `ServerTransportFilter` implementation. - Split transport
interceptor and filter tests: - `ServerTransportFilterTests` became
abstract and got split into two tests:
`CrossClusterAccessServerTransportFilterTests` and
`DefaultServerTransportFilterTests` - Cross-cluster access tests got
extracted from `SecurityServerTransportInterceptorTests` into its own
`CrossClusterAccessTransportInterceptorTests`class1 parent 40f90fb commit 2b91dd5
File tree
12 files changed
+1347
-1020
lines changed- x-pack/plugin/security
- qa/rcs-extension/src/main/java/org/elasticsearch/xpack/security/rcs/extension
- src
- main/java/org/elasticsearch/xpack/security
- transport
- test/java/org/elasticsearch/xpack/security/transport
12 files changed
+1347
-1020
lines changedLines changed: 8 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
19 | | - | |
20 | 16 | | |
21 | 17 | | |
22 | | - | |
23 | 18 | | |
24 | 19 | | |
25 | 20 | | |
26 | 21 | | |
27 | 22 | | |
28 | 23 | | |
29 | | - | |
30 | 24 | | |
31 | 25 | | |
| 26 | + | |
32 | 27 | | |
33 | 28 | | |
34 | 29 | | |
| |||
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 56 | | |
66 | | - | |
67 | | - | |
| 57 | + | |
| 58 | + | |
68 | 59 | | |
69 | 60 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
95 | 66 | | |
96 | 67 | | |
97 | 68 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1207 | 1207 | | |
1208 | 1208 | | |
1209 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
1210 | 1212 | | |
1211 | 1213 | | |
1212 | 1214 | | |
| |||
Lines changed: 17 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| |||
83 | 80 | | |
84 | 81 | | |
85 | 82 | | |
86 | | - | |
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
| |||
128 | 124 | | |
129 | 125 | | |
130 | 126 | | |
131 | | - | |
132 | 127 | | |
133 | 128 | | |
134 | 129 | | |
| |||
328 | 323 | | |
329 | 324 | | |
330 | 325 | | |
331 | | - | |
332 | | - | |
| 326 | + | |
| 327 | + | |
333 | 328 | | |
334 | 329 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 330 | + | |
| 331 | + | |
339 | 332 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
373 | 345 | | |
374 | | - | |
375 | | - | |
| 346 | + | |
376 | 347 | | |
377 | 348 | | |
378 | 349 | | |
| |||
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | | - | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
Lines changed: 55 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
60 | | - | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
65 | 79 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
70 | 120 | | |
71 | 121 | | |
72 | 122 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments