Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Schema Inaccuracy] Repository security advisory operations name `repository_advisories:read` / `repository_advisories:write` OAuth scopes that do not exist

Đang mở Phù hợp với người mới
#7,220 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
openapi
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với sáu mô tả thao tác tư vấn bảo mật repository trong descriptions/api.github.com/api.github.com.json và so sánh các mục tương ứng trong descriptions/ghec/ghec.json. Xác minh các scopes OAuth và classic personal access token được ghi trong tài liệu dựa trên kết quả tái hiện của issue; hoàn tất có nghĩa là cả hai tệp đều nhất quán chỉ nêu các scopes hợp lệ và không còn alternative repository_advisories không hợp lệ nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature

Schema Inaccuracy

Moved here from github/docs#46013 at a maintainer's request.

The description of six repository security advisory operations says that OAuth app tokens and personal access tokens (classic) can use either repo or a repository_advisories:* scope. GitHub's OAuth authorization server rejects both of those scope names as invalid.

Operation Scope named in the description
GET /orgs/{org}/security-advisories repository_advisories:write
GET /repos/{owner}/{repo}/security-advisories repository_advisories:read
POST /repos/{owner}/{repo}/security-advisories repository_advisories:write
GET /repos/{owner}/{repo}/security-advisories/{ghsa_id} repository_advisories:read
PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} repository_advisories:write
POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve repository_advisories:write

For example, GET /repos/{owner}/{repo}/security-advisories/{ghsa_id} says:

OAuth app tokens and personal access tokens (classic) need the repo or repository_advisories:read scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to.

The same text appears in descriptions/api.github.com/api.github.com.json and descriptions/ghec/ghec.json (checked at 642960c).

Expected

The descriptions should name only scopes that can actually be granted. For these operations that is repo, so the or repository_advisories:read / or repository_advisories:write alternatives should be removed.

If these scopes are meant to exist, they should be grantable. They are also missing from Scopes for OAuth apps.

Reproduction Steps

Request a device code with only the scope named in the description. Any OAuth app client ID will do:

$ curl -s -X POST -H "Accept: application/json" \
    -d "client_id=<oauth app client id>&scope=repository_advisories:read" \
    https://github.com/login/device/code
{"error":"invalid_scope","error_description":"The scopes requested are invalid: repository_advisories:read.","error_uri":"https://docs.github.com"}

Results for other scopes, tested against github.com on 2026-09-22 UTC:

Requested scope Response
repo, notifications, security_events device code issued
read:org, read:packages, write:discussion, admin:repo_hook, read:user device code issued
repo repository_advisories:read invalid_scope, naming only repository_advisories:read
repository_advisories:read invalid_scope
repository_advisories:write invalid_scope
nonexistent_scope_xyz, nonexistent:read invalid_scope

Other colon-separated scopes are accepted, so the colon is not the cause.

The "New personal access token (classic)" page at https://github.com/settings/tokens/new does not offer these scopes either.

Only github.com was tested. GHEC was not checked.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
1.6k
Fork
342
Merge trung bình
2 giờ 23 phút
Pull request đã merge (30 ngày)
57

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/rest-api-description

Tất cả issue của github/rest-api-description

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.