Skip to content

Fix authorization in Swarming request#5193

Open
jardondiego wants to merge 1 commit intomasterfrom
fix-auth-swarming-task-create
Open

Fix authorization in Swarming request#5193
jardondiego wants to merge 1 commit intomasterfrom
fix-auth-swarming-task-create

Conversation

@jardondiego
Copy link
Collaborator

No description provided.

@cemon721-a11y

This comment was marked as spam.

headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': creds.token
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

AFAIU, 'Authorization' header should be formatted as proposed in this PR.

Comment on lines +155 to +156
if not creds.valid:
creds.refresh(requests.Request())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When credentials expire, refresh them.

@jardondiego jardondiego marked this pull request as ready for review March 6, 2026 15:18
@jardondiego jardondiego requested a review from a team as a code owner March 6, 2026 15:18
@cemon721-a11y

This comment was marked as spam.

@@ -151,10 +152,13 @@ def push_swarming_task(command, download_url, job_type):

task_spec = _get_new_task_spec(command, job_type, download_url)
creds, _ = credentials.get_default()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should validate the this uses the same service account which has permissions to trigger Swarming tasks.

@cemon721-a11y

This comment was marked as spam.

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