Skip to content
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

Issue with getChecksum for private data package #262

Closed
eblondel opened this issue Oct 16, 2020 · 5 comments
Closed

Issue with getChecksum for private data package #262

eblondel opened this issue Oct 16, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@eblondel
Copy link

eblondel commented Oct 16, 2020

Hello,

Thanks for this great package. I'm currently trying it to insert/update cycles over data packages, and at some point I moved out from the CRAN version to install the current Github dev version.

I've tried to apply getDataPackage method, but for the data resource attached to it, I got this error:

Error in checksum$.attrs[["algorithm"]] : subscript out of bounds

Digging into the R code, i've identified this comes from the getChecksum function. For some unknown reason, I get an unauthorized GET request, which makes code break at https://github.com/DataONEorg/rdataone/blob/master/R/MNode.R#L307

My checksum object returned at line 304 looks like that:

$description
[1] "READ not allowed on urn:uuid:f806756e-0fa3-11eb-a2e5-e5e202a27544 for subject[s]: public; "

$.attrs
     detailCode       errorCode            name 
         "1820"           "401" "NotAuthorized" 

I've then realized this was because the data package was set as private, and the getChecksum is always done without authorization. Shouldn't it use auth_get instead native httr::GET ? so we can allow getting private data packages?

@mbjones mbjones added this to the 2.2.0 milestone Nov 24, 2020
@mbjones mbjones added bug and removed question labels Nov 24, 2020
@mbjones
Copy link
Member

mbjones commented Nov 24, 2020

@eblondel this looks like a bug in error handling to me, so I will target it at the next release if we can reproduce it (help on a short reprex would be useful. If we can't quickly reproduce it, we'll probably retarget it to 2.3.0.

gothub added a commit that referenced this issue Nov 24, 2020
Issue #262

Replace bare `GET` call with dataone::auth_get() so that checksums for private objects can be retrieved for authorized users.
@gothub
Copy link
Collaborator

gothub commented Nov 24, 2020

Thanks @eblondel for flagging this issue, and for providing the solution.

This problem has been resolved, such that authorized users can retrieve checksums for private content.

Fixed in commit 5ad2b7d

@gothub gothub closed this as completed Nov 24, 2020
@CDorich
Copy link

CDorich commented Nov 24, 2020 via email

gothub added a commit that referenced this issue Nov 24, 2020
@mbjones
Copy link
Member

mbjones commented Nov 24, 2020

@CDorich we can not, only you can. The overall email notification settings are controlled in your github account settings. And the repository-specific settings are controlled via the Watch button at the top of each repository page. Details of unsubscribing are in the GitHub docs: https://docs.github.com/en/free-pro-team@latest/github/managing-subscriptions-and-notifications-on-github/managing-your-subscriptions

@eblondel
Copy link
Author

Many thanks @gothub and @mbjones for this prompt fix, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants