GitHub应用程序需要哪些权限才能访问存储库列表问题API? [英] Which permissions are needed for a GitHub app to access list-issues-for-a-repository API?

查看:170
本文介绍了GitHub应用程序需要哪些权限才能访问存储库列表问题API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'd like to create a GitHub app to display the current issues in a repository, organized by labels. The repositories under the organization are private, but my account has admin access. I've installed the app under my name. The API list-issues-for-a-repository is returning:

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

我已经按照以下步骤设置了应用权限:

I've set the app permissions as follows:

存储库权限

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

组织权限

  • 所有人无权访问

用户权限

  • 所有人无权访问

订阅事件

  • 未选中所有内容

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

Getting all the repos using /orgs/«org»/repos returns an empty array, meaning the private repositories aren't showing up, so there's likely a permission issue going on here, too.

问题:

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

  1. Do I need to install the app under the organization? The organization is not showing any installed apps, even though we're running Codacy and GitHub Desktop.

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

The app is not under the organization's Third-party access policy. Do I need to add it? I don't see any way to request permissions, and I don't know if GitHub apps work this way.

我需要为该应用添加更多权限吗?对于这些问题,我只需要只读,并且不想暴露比我需要的更多的东西.

Do I need to include more permissions for the app? I just need read-only for the issues and don't want to expose more than I need.

推荐答案

首先,确认它必须是"GitHub App"而不是"OAuth App",因为用于列出存储库中问题的API是,根据文档,仅适用于GitHub Apps.我采取了一个最初的错误选择,该错误记录在先前的相关问题的编辑历史中,它选择了OAuth应用程序,却一无所获.

First of all, confirmed it has to be a "GitHub App" and not an "OAuth App", because the API to list the issues in a repository is, according to the documentation, available only to GitHub Apps. I took an initial wrong turn, documented in the edit history of a previous related issue, of selecting an OAuth App, and getting nowhere.

关于我的具体问题:

  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的结果.

With these revisions I was able to access the repositories, and also get results for list-issues-for-a-repository.

这篇关于GitHub应用程序需要哪些权限才能访问存储库列表问题API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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