Closed hadley closed 9 years ago
Beats me. Using devtools::check()
with dev httr I see:
check()
Updating rfigshare documentation
Loading rfigshare
'/usr/lib/R/bin/R' --vanilla CMD build '/rfigshare' --no-manual \
--no-resave-data
* checking for file ‘/rfigshare/DESCRIPTION’ ... OK
* preparing ‘rfigshare’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Quitting from lines 43-47 (README.Rmd)
Error: processing vignette 'README.Rmd' failed with diagnostics:
is.oauth_endpoint(endpoint) is not TRUE
Execution halted
Error: Command failed (1)
But I run:
devtools::build_vignettes()
Building rfigshare vignettes
Moving README.html, README.R to inst/doc/
Copying README.Rmd to inst/doc/
And everything is happy. Outside of check()
itself I'm having a hard time reproducing this error. You probably know much better than I why check()
fails to build vignettes but build_vignettes()
doesn't...
Do you get the error with CRAN httr? Maybe I don't need to worry about it
Nope, check() is happy with httr 0.5 from CRAN.
On Fri Dec 05 2014 at 1:01:20 PM Hadley Wickham notifications@github.com wrote:
Do you get the error with CRAN httr? Maybe I don't need to worry about it
— Reply to this email directly or view it on GitHub https://github.com/ropensci/rfigshare/issues/86#issuecomment-65853827.
Sigh :( This is the worst type of error
I'll take a look next week
It fails for me in the vignette too
And when I run it line-by-line
Hmmm, and it appears to be because, I've broken sign_oauth1.0
, but that functions is deprecated anyway. Can you remind me why you're using it? I have a vague memory of some partial OAuth1.0 flow where the app gives you the token and secret directly. Is that what's happening here?
Yup, that's what is happening. We use a special set of testing token & secret to make sure all the tests actually run on cran, travis, etc.
On Mon, Dec 8, 2014, 6:50 AM Hadley Wickham notifications@github.com wrote:
Hmmm, and it appears to be because, I've broken sign_oauth1.0, but that functions is deprecated anyway. Can you remind me why you're using it? I have a vague memory of some partial OAuth1.0 flow where the app gives you the token and secret directly. Is that what's happening here?
— Reply to this email directly or view it on GitHub https://github.com/ropensci/rfigshare/issues/86#issuecomment-66125548.
I've fixed the httr bug, but this reprex fails with an auth error. Any ideas?
cKey <- "Kazwg91wCdBB9ggypFVVJg"
cSecret <- "izgO06p1ymfgZTsdsZQbcA"
token <- "xdBjcKOiunwjiovwkfTF2QjGhROeLMw0y0nSCSgvg3YQxdBjcKOiunwjiovwkfTF2Q"
token_secret <- "4mdM3pfekNGO16X4hsvZdg"
endpoint <- oauth_endpoint(
base_url = "http://api.figshare.com/v1/pbl/oauth",
"request_token", "authorize", "access_token"
)
myapp <- oauth_app("rfigshare", key = cKey, secret = cSecret)
resp1 <- oauth1.0_token(endpoint, myapp)
resp <- sign_oauth1.0(myapp, token = token, token_secret = token_secret)
oauth <- resp$token
response <- GET("http://api.figshare.com/v1/my_data/articles", config(token = oauth))
stop_for_status(response)
content(response)
Don't worry, figured it out
I'm going to add this as a test in httr - is the figshare API pretty stable?
BTW hitting just http://api.figshare.com/v1/my_data
seems to be a faster way to determine if auth has succeeded
Ok, all fixed in httr :)
Any thoughts?