Feature request: Document which permissions the tools needs exactly
Closed this issue · 6 comments
lehphyro commented
The feature request
Document clearly which permissions listed at github docs are needed by multi-gitter.
My use case
I'm not sure about which permissions to set on my PAT.
I've set but it's not enough:
Metadata: Read-only
Pull requests: Read and write
Implementation
- I would like to contribute this feature if it's a suitable addition to multi-gitter
- I have no intention of adding this feature myself.
lehphyro commented
Here are the trace logs where I get a 404 error with my PAT:
TRAC[0000] http request host=api.github.com request="GET /orgs/my-org/repos?page=1&per_page=100 HTTP/1.1
Host: api.github.com
User-Agent: go-github/v59.0.0
Accept: application/vnd.github.mercy-preview+json, application/vnd.github.nebula-preview+json
X-Github-Api-Version: 2022-11-28
Accept-Encoding: gzip
" response="HTTP/2.0 200 OK
Content-Length: 2
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
Cache-Control: private, max-age=60, s-maxage=60
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Wed, 10 Apr 2024 16:49:31 GMT
Etag: \"515c5279f749c9c96572c25c95f9a5b267cbef7ecdaeedff19bee33e0fd968a1\"
Github-Authentication-Token-Expiration: 2025-04-10 00:00:00 -0300
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Github-Permissions: metadata=read
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Api-Version-Selected: 2022-11-28
X-Github-Media-Type: github.mercy-preview; param=nebula-preview; format=json
X-Github-Request-Id: 1A71:2CAB14:2305E88:237D8C1:6616C31B
X-Ratelimit-Limit: 5000
X-Ratelimit-Remaining: 4991
X-Ratelimit-Reset: 1712768052
X-Ratelimit-Resource: core
X-Ratelimit-Used: 9
X-Xss-Protection: 0
[]" took=441.918838ms
TRAC[0000] http request host=api.github.com request="GET /repos/my-org/my-project HTTP/1.1
Host: api.github.com
User-Agent: go-github/v59.0.0
Accept: application/vnd.github.scarlet-witch-preview+json, application/vnd.github.mercy-preview+json, application/vnd.github.baptiste-preview+json, application/vnd.github.nebula-preview+json
X-Github-Api-Version: 2022-11-28
Accept-Encoding: gzip
" response="HTTP/2.0 404 Not Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Wed, 10 Apr 2024 16:49:31 GMT
Github-Authentication-Token-Expiration: 2025-04-10 00:00:00 -0300
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Github-Permissions: metadata=read
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Api-Version-Selected: 2022-11-28
X-Github-Media-Type: github.v3; param=scarlet-witch-preview; format=json, github.mercy-preview; param=baptiste-preview.nebula-preview; format=json
X-Github-Request-Id: 1A71:2CAB14:2305F00:237D93E:6616C31B
X-Ratelimit-Limit: 5000
X-Ratelimit-Remaining: 4990
X-Ratelimit-Reset: 1712768052
X-Ratelimit-Resource: core
X-Ratelimit-Used: 10
X-Xss-Protection: 0
{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/repos/repos#get-a-repository\"}" took=198.818605ms
lindell commented
From readme:
How to generate a GitHub personal access token. Make sure to give
repo
permissions.
lehphyro commented
There are no repo
permissions.
lindell commented
lehphyro commented
That's for classic tokens, fine-grained personal access tokens don't work like that.
lindell commented
The fine-grained access token is in beta and does not work with APIs that is needed for multi-gitter to work (the GraphQL API).