[EAGLE-7291] Use PATs for API calls that involve external models#250
Merged
tiit-clarifai merged 2 commits intomasterfrom Apr 9, 2026
Merged
[EAGLE-7291] Use PATs for API calls that involve external models#250tiit-clarifai merged 2 commits intomasterfrom
tiit-clarifai merged 2 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python gRPC test suite to authenticate write operations (inputs/annotations creation) with a Personal Access Token (PAT) so tests continue to work when base workflows depend on cross-application models (e.g., clarifai/main).
Changes:
- Add a
user_app_id()helper to consistently populateuser_app_idin requests. - Update
PostInputscalls in multiple tests to includeuser_app_idand use PAT-backed metadata. - Update
PostAnnotationscalls to includeuser_app_idand use PAT-backed metadata.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/common.py | Imports resources_pb2 and adds user_app_id() helper for UserAppIDSet. |
| tests/client/test_secure_data_hosting.py | Uses USER_APP_ID in PostInputs and switches those writes to PAT auth. |
| tests/client/test_model_crud.py | Adds user_app_id to PostInputs and switches to metadata(pat=True) for the create step. |
| tests/client/test_inputs_searches.py | Updates setup PostInputs to include user_app_id and PAT metadata. |
| tests/client/test_image_crud.py | Updates multiple PostInputs calls to include user_app_id and PAT metadata. |
| tests/client/test_dataset_version_export.py | Updates dataset input creation (PostInputs) to include user_app_id and PAT metadata. |
| tests/client/test_annotations_searches.py | Updates PostAnnotations and setup PostInputs to include user_app_id and PAT metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nitinbhojwani
approved these changes
Apr 9, 2026
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
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.
The test applications use the General base workflow which contains public models from clarifai/main. In order to authorize cross-application access, API calls that rely on the base workflow must use a Personal Access Token instead of an application-specific API key.
Update all calls to
PostInputsandPostAnnotationsto use a PAT.Note that
PostInputscurrently does work, but this is planned to change so update the tests now to avoid future breakage.