-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Default imgur key not working, causes problems with reprex #97
Comments
It appears that someone abused the default key recently. The error message I get from the imgur API with the default key is "Too Many Requests". Since the API call is anonymous, I have no idea who made the many requests or what were uploaded. Oddly enough, this key appears to have full credits at the moment: > str(xfun::rest_api('https://api.imgur.com', '/3/credits', token = c('Client-ID' = '9f3460e67f308f6')))
List of 3
$ data :List of 5
..$ UserLimit : int 500
..$ UserRemaining : int 500
..$ UserReset : int 1736838327
..$ ClientLimit : int 12500
..$ ClientRemaining: int 12500
$ success: logi TRUE
$ status : int 200 If you want to provide your own key to reprex, you need to set it via either the option |
Thanks for looking into this so quickly, and for sharing your key for all this time. The more detailed error I get with (Edited with the new message from 60c3bb9)
That's the same as the issue posted in the reprex repo linked above. But I see now that that's because the knitr one wraps around the xfun one. Setting the envvar Anyway, if the solution is for us ungrateful devs to register our own keys, that's more than fair! Just wanted to bring it to your attention & help think through workarounds, since right now it requires this extra hidden step. |
@yihui Do you think it's a coincidence that this has happened so near an xfun release? Just brainstorming, has anything changed recently about xfun in some sort of CI situation where running tests or examples could be consuming quota? I wonder if something about CRAN submission and checks is part of the story. |
@jennybc I don't think it has anything to do with the recent xfun release. The default key has worked for more than a decade (at least no one has ever reported a quota issue). I'm sure it was still working last week, but I have no idea what happened from yesterday. I tried to register for a new key (https://api.imgur.com/oauth2/addclient), and it worked fine. I can definitely switch the default key to the new one. |
You might want to take some mild measures to obfuscate the key, just to make it a little more work for a robot-ish actor that's scouring github repos for a key to abuse. Historically we've done this with other API keys that aren't really sensitive but for which it's nice to minimize external, inorganic use. |
Good point. Thanks for the tip! |
I've added three new (obfuscated) keys and will use a random one each time. I feel the old key may have been banned by Imgur. By searching on Github, I can see a few PHP applications seem to be using it (so you are right that it has definitely been discovered by actors outside the R community). For reprex to work again, I'll have to release new versions of both knitr and xfun to CRAN, or you provide a new key in reprex and make a new release. |
I suppose reprex might be one of the main ways people end up using But if it's going to be a while, I can do something in reprex. |
I think so. I'm not aware of major usage of this function in other places.
I can probably release knitr next week to resolve this issue. |
OK thanks! Let me know if this ends up not working out and I'll do something in reprex. |
Hey just chiming in here to say thank you and also that installing the latest version of xfun solved this issue with reprex for me :) |
Hi, I was doing some debugging of errors I got making a reprex (someone else reported tidyverse/reprex#475), and traced it back to how
xfun::upload_imgur
is used by the reprex package. It seems that the default key isn't currently working. I already set an environment variable with my own key, but to illustrate with the default one:On its own supplying your own key is fine, but passing an argument to it in the context of calling
reprex::reprex
or the reprex add-in requires a workaround with explicitly setting theupload.fun
knitr option. My current workaround, in case it's useful to see how this looks downstream, is to set that option within the scope of what reprex knows about, either by including it in what's on the clipboard or the file reprex is sourcing:Thanks in advance!
xfun::session_info("xfun")
By filing an issue to this repo, I promise that
xfun::session_info('xfun')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/xfun')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: