Webhooks可以与GitHub OAuth App一起使用吗? [英] Can Webhooks be used with a GitHub OAuth App?

查看:60
本文介绍了Webhooks可以与GitHub OAuth App一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在阅读GitHub开发人员文档,并且有关webhooks的声明如下:

So I've been reading GitHub developer docs and about webhooks they have the following statement:

Webhooks允许您构建或设置可订阅GitHub.com上某些事件的GitHub Apps.当这些事件之一被触发时,我们将向Webhook的配置URL发送HTTP POST有效负载.Webhooks可用于更新外部问题跟踪器,触发CI构建,更新备份镜像,甚至部署到您的生产服务器.您只受您的想象力限制.

Webhooks allow you to build or set up GitHub Apps which subscribe to certain events on GitHub.com. When one of those events is triggered, we'll send a HTTP POST payload to the webhook's configured URL. Webhooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server. You're only limited by your imagination.

但是,关于Apps,他们也有以下说法:

However, about Apps they've also got this statement:

GitHub上的应用程序可扩展和改善现有的工作流程.人们可以从GitHub Marketplace购买应用程序或浏览有用的工具,以及与GitHub结合使用的与GitHub集成的服务.

Apps on GitHub extend and improve existing workflows. People can purchase apps from GitHub Marketplace or browse useful tools and services that integrate with GitHub in Works with GitHub.

如果您要构建或添加集成,本文档将帮助您启动并运行.

If you're building or adding integrations, this documentation will help get you up and running.

对于支持请求,错误报告以及与GitHub相关的讨论应用程序(不是OAuth应用程序),请使用GitHub平台论坛.论坛允许您可以与其他集成商以及工程师和来自GitHub的产品经理.

For support requests, bug reports, and discussions related to GitHub Apps (not OAuth Apps), use the GitHub Platform Forum. The forum allows you to collaborate with other integrators as well as engineers and product managers from GitHub.

如果您的请求是关于OAuth应用的,或者您需要讨论私人关注,请直接与支持人员联系.

If your request is about OAuth Apps, or if you need to discuss a private concern, please contact support directly.

似乎Webhooks只能与GitHub Apps一起使用?GitHub Apps和GitHub OAuth Apps之间的区别不是很清楚,我看不到为什么OAuth应用程序将无法使用Webhooks?

This seems that Webhooks can only be used with GitHub Apps? The difference between GitHub Apps and GitHub OAuth Apps isn't very clear and I fail to see why an OAuth app would not be able to use Webhooks?

推荐答案

编辑

Webhooks可以与GitHub OAuth App一起使用吗?

Can Webhooks be used with a GitHub OAuth App?

是的

Webhooks允许您构建或设置可订阅GitHub.com上某些事件的GitHub Apps.

Webhooks allow you to build or set up GitHub Apps which subscribe to certain events on GitHub.com.

这是不正确的陈述.这应该是与GitHub集成",而不是"GitHub Apps".

This is an incorrect statement. This should be 'an integration with GitHub' rather than 'GitHub Apps'.

似乎Webhooks只能与GitHub Apps一起使用?

This seems that Webhooks can only be used with GitHub Apps?

不.GitHub Apps包含对Webhooks的隐式支持.OAuth应用程序请求令牌的范围为 write:repo_hook admin:org_hook

No. GitHub Apps include implicit support for Webhooks. OAuth Applications request tokens with a scope for write:repo_hook or admin:org_hook to register a Webhook on the Repository or Organization.

有一个有关创建webhooks 的指南,该指南建议使用 repo钩子 org钩子 API端点.

There is a guide for creating webhooks that suggests to use the repo hooks or org hooks API endpoints.

GitHub Apps和GitHub OAuth Apps之间的区别不是很清楚,我看不到为什么OAuth应用程序将无法使用Webhooks?

The difference between GitHub Apps and GitHub OAuth Apps isn't very clear and I fail to see why an OAuth app would not be able to use Webhooks?

有些文档描述了 GitHub Apps和OAuth Apps之间的一些区别.

GitHub Apps的TLDR优势:

TLDR advantages of GitHub Apps:

Webhooks 允许您的服务器/应用程序在发生特定事件时得到通知-无论是否发生您正在使用OAuth或GitHub App.然后,您的应用程序将需要处理事件并采取相应措施.

Webhooks allow your server/application to get notified whenever a specific event happens - regardless of whether you are using OAuth or GitHub App. Your application will then need to process an event and act accordingly.

另外,您的应用程序将需要与GitHub的API交互以创建,读取,编辑或删除信息.GitHub通常需要凭据来访问或更新特定信息.对GitHub API的身份验证可以使用多种方法:

Separately, your application will need to interact with GitHub's API to create, read, edit, or delete information. GitHub will usually require credentials to access or update specific information. Authentication to GitHub's API can use multiple methods:

  • None
  • Basic Authentication (username/password)
  • OAuth2 Token
  • Personal Access Token (PAT)
  • Installation Access Token

旧版GitHub集成和GitHub Apps之间还有其他区别.

There are additional differences between legacy GitHub integrations and GitHub Apps.

  • Older integrations were based on Oauth2 and use a Token associated with a user's account. Integrations would interact with GitHub's API on behalf of a user - which is why some organizations would set up a machine user. Webhooks also need to be added explicitly.

GitHub Apps将代表自己与GitHub的API进行交互.您必须为组织或存储库明确授予GitHub App访问权限,以同时启用Webhook和API访问.

GitHub Apps will interact with GitHub's API on it's own behalf. You must explicitly grant a GitHub App access to an Organization or Repository which enables both Webhook and API access.

这篇关于Webhooks可以与GitHub OAuth App一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆