Skip to content

Conversation

@liranbg
Copy link
Member

@liranbg liranbg commented Jan 1, 2026

📝 Description

Initialize Iguazio v4 OAuth token configuration automatically from /client-spec, so users no longer need to manually set OAuth env vars before importing MLRun.


🛠️ Changes Made

  • Extended /client-spec response with IG4 OAuth token config (internal svc + external ingress endpoints).
  • Updated SDK HTTPRunDB.connect() to apply OAuth config before token provider initialization (IG token flow).
  • Fixed pytest configuration to use importlib (best practice and avoids test issues on cursor/vscode)

✅ 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:
    • server/py/services/api/tests/unit/api/test_client_spec.py
    • tests/rundb/test_httpdb.py (IG4 OAuth auto-config)

🔗 References


🚨 Breaking Changes?

  • Yes (explain below)
  • No

🔍️ Additional Notes

N/A

@liranbg liranbg requested review from a team, moranbental and quaark as code owners January 1, 2026 11:31
@liranbg liranbg changed the title [SDK] Get IG4 Auth info from remote [SDK] Get IG4 Auth info from api Jan 1, 2026

if config.auth_with_client_id.enabled:
self.token_provider = mlrun.auth.OAuthClientIDTokenProvider(
token_endpoint=get_secret_or_env("MLRUN_AUTH_TOKEN_ENDPOINT"),
Copy link
Contributor

Choose a reason for hiding this comment

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

If _init_token_provider is called after the connect, then MLRUN_AUTH_TOKEN_ENDPOINT should be available on the config. Why fetch it from the env?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just didnt touch this code flow

Copy link
Contributor

Choose a reason for hiding this comment

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

But I think it needs to be touched because now MLRUN_AUTH_TOKEN_ENDPOINT won't be available anymore as an env var

@elbamit
Copy link
Contributor

elbamit commented Jan 1, 2026

@liranbg
Copy link
Member Author

liranbg commented Jan 1, 2026

@liranbg liranbg merged commit 3bb27db into mlrun:development Jan 1, 2026
13 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