Skip to content

feat(taskbroker): Add Authentication to Push Taskbroker#580

Open
james-mcnulty wants to merge 1 commit intomainfrom
george/push-taskbroker/add-push-authentication
Open

feat(taskbroker): Add Authentication to Push Taskbroker#580
james-mcnulty wants to merge 1 commit intomainfrom
george/push-taskbroker/add-push-authentication

Conversation

@james-mcnulty
Copy link
Copy Markdown
Member

Linear

Completes STREAM-845

Description

Currently, taskworkers pull tasks from taskbrokers via RPC. This approach works, but has some drawbacks. Therefore, we want taskbrokers to push tasks to taskworkers instead. Read this page on Notion for more information.

This PR adds authentication to the push taskbroker using the same scheme as we use now. If the user provides a list of secrets in the configuration, the taskbroker will add a sentry-signature field to the RPC metadata. The value of this field is <name of the method>:<body> run through HMAC-SHA256 and hexadecimal encoded.

The worker side of this authentication scheme is already implemented. When the taskbroker sends a PushTaskRequest, if the worker has a list of secrets provided, it reconstructs the signature using each secret and checks whether it matches the one included in the request. If it does, the call proceeds. If it doesn't, the server returns code 16 (unauthenticated).

Details

  • Update WorkerClient::send to accept a list of secrets (which may be empty)
  • Add helper function sentry_signature_hex to compute the signature
  • Add a test to make sure sentry_signature_hex computes the signature as expected

@james-mcnulty james-mcnulty requested a review from a team as a code owner March 28, 2026 19:30
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 28, 2026

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.

1 participant