New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub app API query parameter deprecation #343
GitHub app API query parameter deprecation #343
Comments
都收到通知邮件了 |
+1,今天被这个邮件轰炸了 |
有老哥知道该怎么解决吗? |
+1 |
2 similar comments
+1 |
+1 |
我也收到了,蹲一个解决 |
+1 |
+1 Mark |
mark, same problem |
+1 Mark |
plz modify HTTP requests to put |
It uses Right now, the browser can't produce a GET request with a modified header. Only POST can do. So I have no idea how to fix this without 3rd party support(e.g., forward by the backend, etc.) |
Is there any temporary solution? |
Gitalk should use basic auth to replace client_id/client_secret query parameter. I open a pull request diff to resolve the issue, about ten lines are modified. And I regenerate gitalk.min.js. All regenerated files are here Follow next steps
If you need higher limit rate
const gitalk = new Gitalk({
clientID: 'GitHub Application Client ID',
clientSecret: 'GitHub Application Client Secret',
accessToken: 'Github Personal Access Token', // IMPORTANT !!!
repo: 'GitHub repo',
owner: 'GitHub repo owner',
...
}) |
How to generate a public read-only token?I just find Access public repositories permission.It's dangerous. |
About accessToken security According to Understanding scopes for OAuth Apps, if you don't select any scope when generating your access token, the token just grants read-only access to public information. Here is my blog, it works well. If you find it dangerous, please tell me to revoke it, thank you. |
So is it possible to create a new github account to generate the public access token? |
@draveness You're right, gitalk uses access token( client secret before) to get higher api rate limit, so any account's access token is ok. with access token, 5000 requests per hour curl -H "Authorization: token YOUR TOKEN" https://api.github.com/rate_limit
{
"resources": {
"core": {
"limit": 5000,
"remaining": 4961,
"reset": 1580799676
},
... without access token, 60 requests per hour.
See Rate limiting One more thing
const { owner, repo, id, labels, accessToken } = this.options
return axiosGithub.get(`/repos/${owner}/${repo}/issues`, {
headers: {
Authorization: `token ${this.accessToken || accessToken}`
},
... |
Thanks for the detailed explanation. |
@geektutu It would probably be better to just use anonymous requests here. Since the API request would be associated with the user's IP instead of your account (for example if they grabbed your PAT and began to abuse it). Since the limit is only used to retrieve comments 60 should be plenty. I'd also be worried about someone generating a PAT with too large of a scope such that a malicious actor could abuse it. Furthermore users who are logged in won't have any rate limit issues. |
@fletchto99 Your worry is right. However, many people share the same public IP, eg, through the same gateway of the company, or in some areas where IP is lacking. Each page will cost 2 or more requests. 60 per hour will be used up soon. Probably it'll bring bad experience. I have no idea but to add danger notice to guide people to select nothing when generating PAT. |
+1 Mark |
+1 |
1 similar comment
+1 |
+1 Mark |
mark |
关注,我也出现了这个问题 |
|
以我博客的访问量,就geektutu的解决方案感觉已经很完美了 |
我就一个账号,但今天就收到了近20封 |
at most 修飾的是分子 once 不是分母 3 days ,頻率應該變小而不是變大啊。 |
我的也收到了,按你的方法,去生成了一个token,不知道还会不会发邮件! |
插眼 |
关注 |
I've opened #346 to address the concerns I had expressed in #343 (comment) - I've confirmed with GitHub that sending the |
我也遇到了同样的问题,怎么个具体解决呢? |
Update dependency Gitalk to V1.5.2. Fix `GitHub app API query parameter deprecation`. Email bombs from GitHub said that **"Please use Basic Authentication instead as using OAuth credentials in query parameters has been deprecated."** Gitalk V1.5.2 fixed the problem without any changes to other files. For more infomation, visit gitalk/gitalk#343 , or gitalk/gitalk#343 .
这可能是因为浏览器缓存或者CDN缓存未刷新的问题,问题缓存可能不在你这里,你的用户没有刷新缓存。 可以尝试将gitalk js和css 保存到本地后引用。 或者指定版本号
|
看你图中,引用了两次 gitalk 资源文件,猜测一个是新的,一个是旧的,旧的只要初始化就会发告警邮件。 |
已经解决了,谢谢,是缓存的原因 |
已经解决了,谢谢,是缓存的原因
已经解决了,谢谢,确实是缓存的原因 |
GitHub is going to be deprecating sending the client ID and client secret as query parameters. Gitalk will need to be updated to use basic authentication. For more information see: https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters
This has been fixed in #346 and pushed out in v1.52
The text was updated successfully, but these errors were encountered: