Commit 07c9785
fix(model-registry): scope in-cluster K8s client to SAR-only interface in MCP deployment auth (#7259)
* fix(model-registry): scope in-cluster K8s client to SAR-only interface in MCP deployment auth
Move the MCP server SubjectAccessReview logic into the shared
KubernetesClientInterface (CanVerbMcpServersInNamespace) so
requireMcpDeploymentAccess uses the same K8s client infrastructure
as every other handler. This removes the separate InClusterConfig
path, the cached authorizationv1client.SubjectAccessReviewInterface,
and the package-level sync.Once from mcp_deployment_auth.go.
- InternalKubernetesClient: SAR with explicit user/groups
- TokenKubernetesClient: SelfSubjectAccessReview via user token
- requireMcpDeploymentAccess: delegates to factory client
https: //issues.redhat.com/browse/RHOAIENG-57223
Made-with: Cursor
* Update packages/model-registry/upstream/bff/internal/redhat/handlers/mcp_deployment_auth.go
Co-authored-by: Pushpa Padti <99261071+ppadti@users.noreply.github.com>
* Update packages/model-registry/upstream/bff/internal/redhat/handlers/mcp_deployment_auth.go
Co-authored-by: Pushpa Padti <99261071+ppadti@users.noreply.github.com>
* restore auth method guard in requireMcpDeploymentAccess
---------
Co-authored-by: Pushpa Padti <99261071+ppadti@users.noreply.github.com>1 parent bb045de commit 07c9785
5 files changed
Lines changed: 84 additions & 57 deletions
File tree
- packages/model-registry/upstream/bff/internal
- integrations/kubernetes
- redhat/handlers
- repositories
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
152 | 183 | | |
153 | 184 | | |
154 | 185 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
237 | 266 | | |
238 | 267 | | |
239 | 268 | | |
| |||
Lines changed: 16 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 7 | | |
16 | 8 | | |
17 | 9 | | |
18 | 10 | | |
19 | 11 | | |
20 | 12 | | |
21 | 13 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
48 | 19 | | |
49 | 20 | | |
50 | 21 | | |
51 | 22 | | |
52 | 23 | | |
53 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
54 | 29 | | |
55 | | - | |
56 | | - | |
| 30 | + | |
| 31 | + | |
57 | 32 | | |
58 | 33 | | |
59 | 34 | | |
| |||
62 | 37 | | |
63 | 38 | | |
64 | 39 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 40 | + | |
82 | 41 | | |
83 | | - | |
| 42 | + | |
84 | 43 | | |
85 | 44 | | |
86 | 45 | | |
| |||
90 | 49 | | |
91 | 50 | | |
92 | 51 | | |
93 | | - | |
94 | | - | |
| 52 | + | |
| 53 | + | |
95 | 54 | | |
96 | 55 | | |
97 | 56 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
0 commit comments