Skip to content

[EAGLE-7291] Use PATs for API calls that involve external models#250

Merged
tiit-clarifai merged 2 commits intomasterfrom
EAGLE-7291-use-pat-for-base-workflow
Apr 9, 2026
Merged

[EAGLE-7291] Use PATs for API calls that involve external models#250
tiit-clarifai merged 2 commits intomasterfrom
EAGLE-7291-use-pat-for-base-workflow

Conversation

@tiit-clarifai
Copy link
Copy Markdown
Contributor

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 PostInputs and PostAnnotations to use a PAT.

Note that PostInputs currently does work, but this is planned to change so update the tests now to avoid future breakage.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 populate user_app_id in requests.
  • Update PostInputs calls in multiple tests to include user_app_id and use PAT-backed metadata.
  • Update PostAnnotations calls to include user_app_id and 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.

Comment thread tests/common.py
Comment thread tests/client/test_secure_data_hosting.py
@tiit-clarifai tiit-clarifai enabled auto-merge (squash) April 9, 2026 08:35
@tiit-clarifai tiit-clarifai merged commit 396107c into master Apr 9, 2026
29 of 59 checks passed
@tiit-clarifai tiit-clarifai deleted the EAGLE-7291-use-pat-for-base-workflow branch April 9, 2026 08:52
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.

3 participants