-
Notifications
You must be signed in to change notification settings - Fork 294
[Client v4] Implementing refresh_access_token [feature/ig4-authentication] #8443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
moranbental
merged 74 commits into
mlrun:feature/ig4-authentication
from
moranbental:refresh-access-token
Aug 20, 2025
Merged
[Client v4] Implementing refresh_access_token [feature/ig4-authentication] #8443
moranbental
merged 74 commits into
mlrun:feature/ig4-authentication
from
moranbental:refresh-access-token
Aug 20, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # server/py/services/api/tests/unit/conftest.py
# Conflicts: # mlrun/common/schemas/constants.py # server/py/framework/utils/clients/iguazio/v3.py # server/py/framework/utils/clients/iguazio/v4.py # server/py/services/api/tests/unit/conftest.py # server/py/services/api/tests/unit/utils/clients/iguazio/test_iguazio_v3.py # tests/system/feature_store/test_feature_store.py
# Conflicts: # server/py/framework/utils/clients/iguazio/v4.py # server/py/services/api/tests/unit/crud/test_secrets.py
TomerShor
approved these changes
Aug 17, 2025
Member
TomerShor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
TomerShor
reviewed
Aug 20, 2025
1b89b62
into
mlrun:feature/ig4-authentication
13 checks passed
moranbental
added a commit
to moranbental/mlrun
that referenced
this pull request
Oct 15, 2025
β¦feature/ig4-authentication] (mlrun#8408) This PR introduces a new API endpoint to store or update multiple offline tokens: `PUT /api/v1/user-secrets/tokens` For each token in the request, the following validations and operations are performed: 1. Token Name Validation β Ensure each token has a non-empty and unique name within the request. 2. JWT Decoding β Decode the offline token and verify it contains the required claims: sub (user ID) and exp (expiration). 3. User Ownership Validation β Confirm that the sub in the offline token matches the authenticated user ID 4. Token Verification β Use the Iguazio SDK to validate all tokens via the `refresh_access_tokens` call. This will be enabled in a separate PR (mlrun#8443). 5. Secret Storage β (Not implemented in this PR) Creation and updating of Kubernetes secrets will be handled in a separate PR. Response Structure β Return lists of token names categorized by action: created_tokens, updated_tokens, and skipped_tokens. This functionality has been verified only via unit tests for now Additional Changes 1. Renamed `api/endpoints/secrets.py` β `api/endpoints/project_secrets.py`. 2. Extracting the user_id from Orcaβs session verification endpoint and saving it in the AuthInfo https://iguazio.atlassian.net/browse/ML-10487
moranbental
added a commit
to moranbental/mlrun
that referenced
this pull request
Oct 15, 2025
β¦tion] (mlrun#8443) <!-- A short summary of what this PR does. --> <!-- Include any relevant context or background information. --> Implement token verification when storing tokens by using the Iguazio SDK to validate all tokens via the `refresh_access_token` call. --- <!-- - Key changes (e.g., added feature X, refactored Y, fixed Z) --> 1. Install iguazio version 0.0.1a9 from Test PyPI. 2. The iguazio package is only supported on Python β₯ 3.11, so run `test_iguazio_v4.py` only on Python 3.11. 3. Update the test/Dockerfile to install iguazio only when Python β₯ 3.11. 4. Import `iguazio` only on Python β₯ 3.11. 5. Initialize the Iguazio client with `auto_login=False` (will not attempt to login on unauthenticated requests). 6. Implement the `refresh_access_token` method. 7. Catch errors and handle failures by raising an `Unauthorized `error. --- - [x] I updated the documentation (if applicable) - [x] I have tested the changes in this PR --- <!-- - How it was tested (unit tests, manual, integration) --> <!-- - Any special cases covered. --> Tested in the system with valid and invalid access tokens, including tokens that: - Do not belong to the user. - Are expired. --- - Ticket link: https://iguazio.atlassian.net/browse/ML-10814 - Design docs links: https://iguazio.atlassian.net/wiki/spaces/MLRUN/pages/404521061/BE+Secret+Token+Support+HLD - External links: https://iguazio.atlassian.net/wiki/spaces/ARC/pages/361103361/MLRun+Secret+Tokens+in+IG4 --- - [ ] Yes (explain below) - [x] No <!-- If yes, describe what needs to be changed downstream: --> --- <!-- Anything else reviewers should know (follow-up tasks, known issues, affected areas etc.). --> <!-- ### πΈ Screenshots / Logs -->
6 tasks
liranbg
pushed a commit
that referenced
this pull request
Nov 3, 2025
### π Description <!-- A short summary of what this PR does. --> <!-- Include any relevant context or background information. --> This PR introduces support for MLRun authentication with IG4. It rebases the `feature/ig4-authentication` branch onto `development` This PR includes the following PRs: 1. #8345 2. #8370 3. #8366 4. #8388 5. #8440 6. #8408 7. #8466 8. #8471 9. #8443 10. #8484 11. #8498 12. #8574 13. #8529 14. #8584 15. #8588 16. #8589 17. #8567 18. #8623 19. #8612 20. #8514 21. #8626 22. #8632 23. #8633 24. #8667 25. #8668 26. #8674 27. #8780 28. #8754 29. #8796 30. #8811 --- ### π οΈ Changes Made <!-- - Key changes (e.g., added feature X, refactored Y, fixed Z) --> To enable IG4 project authorization, set the following configs in mlrun api: ``` MLRUN_HTTPDB__AUTHENTICATION__MODE: iguazio-v4 MLRUN_HTTPDB__AUTHENTICATION__IGUAZIO__SESSION_VERIFICATION_ENDPOINT: v1/identity/self MLRUN_IGUAZIO_API_URL: http://igz-api:8000 ``` Before importing MLRun, you must set: ``` MLRUN_AUTH_WITH_OAUTH_TOKEN__ENABLED=true MLRUN_AUTH_TOKEN_ENDPOINT="https://igz-api.<namespace>.<system-domain>/api/v1/refresh-access-token" ``` --- ### β Checklist - [x] I updated the documentation (if applicable) - [x] I have tested the changes in this PR - [ ] If I introduced a deprecation: - [ ] I followed the [Deprecation Guidelines](./DEPRECATION.md) - [ ] I updated the relevant Jira ticket for documentation --- ### π§ͺ Testing <!-- - How it was tested (unit tests, manual, integration) --> <!-- - Any special cases covered. --> Tested on IG4 system + unit tests --- ### π References - Ticket link: https://iguazio.atlassian.net/browse/ML-9683, https://iguazio.atlassian.net/browse/ML-9870, https://iguazio.atlassian.net/browse/ML-9998 - Design docs links: https://iguazio.atlassian.net/wiki/spaces/MLRUN/pages/399179866/Support+IG4+Authentication+in+MLRun+AuthVerifier+HLD, https://iguazio.atlassian.net/wiki/spaces/MLRUN/pages/411960071/Support+sdk-side+IG4+authentication+-+token+usage+and+management+HLD, https://iguazio.atlassian.net/wiki/spaces/MLRUN/pages/404521061/BE+Secret+Token+Support+HLD, - External links: https://iguazio.atlassian.net/wiki/spaces/ARC/pages/361103361/MLRun+Secret+Tokens+in+IG4 --- ### π¨ Breaking Changes? - [x] Yes (explain below) - [] No Removed unused API endpoints `- POST /api/v1/user-secrets` which was not in used --- ### ποΈ Additional Notes How to enable IG4 authentication - https://iguazio.atlassian.net/wiki/spaces/PLAT/pages/457671097/Enable+IG4+Authentication+in+MLRun --------- Co-authored-by: Katerina Molchanova <[email protected]> Co-authored-by: Amit Elbaz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Description
Implement token verification when storing tokens by using the Iguazio SDK to validate all tokens via the
refresh_access_tokencall.π οΈ Changes Made
test_iguazio_v4.pyonly on Python 3.11.iguazioonly on Python β₯ 3.11.auto_login=False(will not attempt to login on unauthenticated requests).refresh_access_tokenmethod.Unauthorizederror.β Checklist
π§ͺ Testing
Tested in the system with valid and invalid access tokens, including tokens that:
π References
π¨ Breaking Changes?
ποΈ Additional Notes