Skip to content

Conversation

@liranbg
Copy link
Member

@liranbg liranbg commented Jan 5, 2026

📝 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)
  • 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:

🧪 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


🚨 Breaking Changes?

  • Yes (explain below)
  • No

🔍️ Additional Notes

This is a code cleanup PR that consolidates duplicate validation logic introduced in #9154.

@liranbg liranbg requested review from a team and moranbental as code owners January 5, 2026 11:22
@liranbg liranbg changed the title unify functions [Auth] Unified validation functions Jan 5, 2026
@liranbg liranbg requested a review from elbamit January 5, 2026 11:57
Copy link
Contributor

@elbamit elbamit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@liranbg liranbg merged commit b7cee4c into mlrun:development Jan 5, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants