Skip to content

DOM-75929 add job auth to the model register endpoint#60

Merged
niole merged 3 commits into
mainfrom
niole.DOM-75929.auth_registyr_ept
Apr 13, 2026
Merged

DOM-75929 add job auth to the model register endpoint#60
niole merged 3 commits into
mainfrom
niole.DOM-75929.auth_registyr_ept

Conversation

@niole
Copy link
Copy Markdown
Collaborator

@niole niole commented Apr 10, 2026

JIRA https://dominodatalab.atlassian.net/browse/DOM-75929

This finishes the auth implementation for the register model and deploy model api actions in the Deployments tab in the Job Results view

Screenshot 2026-04-10 at 12 40 07 PM
  • Use getjobor404 in registry and deploy model from job endpoint so that we get some domino job auth
  • fix tests
  • refactor other calls to getjobor404 to not add username arg, which was not used
  • Updated tests to verify that get_job_or_404 is called in the register and deploy from job endpoint
  • add net new test for the deploy from job deployment route

…auth, fix tests, refactor other calls to getjobor404 to not add username arg, which was not used
@niole niole requested review from a team and ddl-ryan-connor April 10, 2026 17:12
job = await crud.get_job(db, request.job_id)
if not job:
raise HTTPException(status_code=404, detail=f"Job not found: {request.job_id}")
job = await get_job_or_404(db, request.job_id)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was the missing piece to make sure all entities are retrieved only if authorized

"""Create a Domino Model API from a job's registered model."""
async with get_db_session() as db:
job = await crud.get_job(db, job_id)
job = await get_job_or_404(db, job_id)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was also the only thing that needed to be updated to make sure everything is authorized in the deploy model from job endpoint

tracking_uri = str(tmp_path / "mlruns")

# Use an isolated local MLflow file store instead of any ambient tracking config.
mlflow.set_tracking_uri(tracking_uri)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I set this here to point to a local directory, because an API request sent in my local environment by this test was being sent to a remote Domino and making the test fail

@niole niole merged commit b60892a into main Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants