Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation of webhooks for project-scoped tokens #754

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phalbert
Copy link
Contributor

@phalbert phalbert commented Jun 28, 2024

Description

The genesis of this change is documented in this slack thread

What

  • Users encounter a 400 error when attempting to create subscriptions (webhooks) due to insufficient permissions to edit the subscription.
  • Modify the webhook creation process to include the projectId in the payload.

Why

  • The current setup assumes an organisation token when creating webhooks. If a project-scoped token is supplied, the craetion fails

How

  • When the user holds a project administrator role, and the PAT is scoped only to that specific project, it is necessary to explicitly define the projectId when creating a webhook.
{
  "publisherId": "tfs",
  "eventType": "git.pullrequest.updated",
  "consumerId": "webHooks",
  "consumerActionId": "httpRequest",
  "consumerInputs": {
    "url": "http://20.246.193.102/ado-port/integration/webhook"
  },
  "publisherInputs": {
    "projectId": "4901a905-d07b-4027-b7cc-577d2b6a0e31"
  }
}

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant