Commit 8d7ff32
Thread factory through buildFullAuthzConfigJSON, drop redundant lookups
buildFullAuthzConfigJSON now returns the resolved AuthorizerFactory
alongside the envelope JSON, so validateAuthzConfig can dispatch
ValidateConfig directly without a second GetFactory call and without
re-Unmarshalling the JSON it just built.
Before: Validate() ran IsRegistered, buildFullAuthzConfigJSON ran
GetFactory, validateAuthzConfig re-Unmarshalled the envelope and ran
GetFactory again — three near-identical lookups for the same key on
every reconcile, with three slightly different error messages.
The authzConfigEnvelope struct is removed; nothing else consumed it.
Tests updated to assert the returned factory's ConfigKey matches the
expected nested envelope key, locking in the bidirectional contract.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent e6a8e16 commit 8d7ff32
2 files changed
Lines changed: 26 additions & 39 deletions
Lines changed: 19 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | 193 | | |
207 | 194 | | |
208 | 195 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | 196 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
219 | 203 | | |
220 | 204 | | |
221 | | - | |
| 205 | + | |
222 | 206 | | |
223 | 207 | | |
224 | 208 | | |
225 | | - | |
226 | | - | |
227 | 209 | | |
228 | | - | |
| 210 | + | |
229 | 211 | | |
230 | 212 | | |
231 | 213 | | |
232 | 214 | | |
233 | | - | |
| 215 | + | |
234 | 216 | | |
235 | 217 | | |
236 | 218 | | |
237 | | - | |
| 219 | + | |
238 | 220 | | |
239 | 221 | | |
240 | 222 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
244 | 226 | | |
245 | 227 | | |
246 | 228 | | |
247 | 229 | | |
248 | | - | |
| 230 | + | |
249 | 231 | | |
250 | | - | |
| 232 | + | |
251 | 233 | | |
252 | 234 | | |
253 | 235 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
138 | | - | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
0 commit comments