gpt4 book ai didi

github - GitHub 应用程序需要哪些权限才能访问 list-issues-for-a-repository API?

转载 作者:行者123 更新时间:2023-12-04 10:58:53 24 4
gpt4 key购买 nike

我想创建一个 GitHub 应用程序来显示存储库中的当前问题,按标签组织。组织下的存储库是私有(private)的,但我的帐户具有管理员权限。我已经以我的名义安装了该应用程序。 API list-issues-for-a-repository正在返回:

{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3/issues/#list-issues-for-a-repository"
}

我已将应用权限设置如下:

存储库权限

  • 问题 - 只读
  • 元数据 - 只读
  • 无权访问其他所有内容

组织权限

  • 所有人都不能访问

用户权限

  • 所有人都不能访问

订阅事件

  • 全部未选中

使用 /orgs/«org»/repos 获取所有存储库返回一个空数组,这意味着私有(private)存储库没有显示,因此这里也可能存在权限问题。

问题:

  1. 我需要在组织下安装应用程序吗?该组织没有显示任何已安装的应用程序,即使我们正在运行 Codacy 和 GitHub Desktop。

  2. 该应用不受组织的第三方访问政策约束。我需要添加它吗?我看不到任何请求权限的方式,我不知道 GitHub 应用程序是否以这种方式工作。

  3. 我是否需要为该应用添加更多权限?我只需要问题的只读权限,不想公开超出我需要的内容。

最佳答案

首先,确认它必须是“GitHub 应用程序”而不是“OAuth 应用程序”,因为根据文档,列出存储库中问题的 API 仅适用于 GitHub 应用程序。我最初走错了路,记录在 a previous related issue 的编辑历史中,选择一个 OAuth 应用程序,却一事无成。

就我的具体问题而言:

  1. 我是否需要在组织下安装该应用程序?该组织没有显示任何已安装的应用程序,即使我们正在运行 Codacy 和 GitHub Desktop。

Yes, it needs to be installed or added under the organization. It was easier for me to delete the existing app under my account, and re-add (vs re-install) under the organization.

  1. 该应用不受组织的第三方访问政策约束。我需要添加它吗?我看不到任何请求权限的方式,我不知道 GitHub 应用程序是否以这种方式工作。

Once the app is added under the organization, it is automatically given access. You can fine tune which repositories it can access or let it access them all. Installing, as opposed to adding, might need a few more steps, and the app needs to be published first. My app is intended for the organization only, so I opted for the simpler solution. Also, even if you give the app access to all repositories, the access rights of whoever logs in take precedence. For example, someone outside of the organization won't see any private repositories.

  1. 我是否需要为该应用添加更多权限?我只需要对问题进行只读,不想公开超出我需要的内容。

No, just read-only for issues, meta-data is included automatically.

通过这些修订,我能够访问存储库,并获得 list-issues-for-a-repository 的结果。

关于github - GitHub 应用程序需要哪些权限才能访问 list-issues-for-a-repository API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58964401/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com