Commit b7cee4c
authored
[Auth] Unified validation functions (#9158)
### 📝 Description
Follow-up to #9154. Refactors secret token validation by removing the
standalone `validate_secret_tokens` function and unifying validation
logic into `extract_and_validate_tokens_info`.
---
### 🛠️ Changes Made
- Removed redundant `validate_secret_tokens` function from
`mlrun/auth/utils.py`
- Unified token validation into `extract_and_validate_tokens_info` with
a new `filter_by_authenticated_id` parameter
- Updated `load_and_prepare_secret_tokens` to use the unified validation
function
- Updated tests to reflect the refactored validation logic
---
### ✅ Checklist
- [ ] I updated the documentation (if applicable)
- [x] I have tested the changes in this PR
- [ ] I confirmed whether my changes are covered by system tests
- [ ] If yes, I ran all relevant system tests and ensured they passed
before submitting this PR
- [ ] I updated existing system tests and/or added new ones if needed to
cover my changes
- [ ] If I introduced a deprecation:
- [ ] I followed the [Deprecation Guidelines](./DEPRECATION.md)
- [ ] I updated the relevant Jira ticket for documentation
---
### 🧪 Testing
- Unit tests updated to cover the refactored validation logic
- Tests verify token filtering by authenticated user ID with the new
`filter_by_authenticated_id` parameter
---
### 🔗 References
- Ticket link: N/A
- Related PR: #9154
---
### 🚨 Breaking Changes?
- [ ] Yes (explain below)
- [x] No
---
### 🔍️ Additional Notes
This is a code cleanup PR that consolidates duplicate validation logic
introduced in #9154.1 parent a474e38 commit b7cee4c
2 files changed
+152
-125
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
239 | 247 | | |
240 | 248 | | |
241 | 249 | | |
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | 254 | | |
305 | 255 | | |
306 | 256 | | |
| |||
332 | 282 | | |
333 | 283 | | |
334 | 284 | | |
| 285 | + | |
335 | 286 | | |
336 | 287 | | |
337 | 288 | | |
| |||
362 | 313 | | |
363 | 314 | | |
364 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
365 | 319 | | |
366 | 320 | | |
367 | 321 | | |
| |||
0 commit comments