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

BF: ORA authenticated HTTP access #5026

Merged
merged 5 commits into from Oct 19, 2020
Merged

BF: ORA authenticated HTTP access #5026

merged 5 commits into from Oct 19, 2020

Conversation

mih
Copy link
Member

@mih mih commented Oct 13, 2020

This sits on top of #5025 (to be able to make use of the download_url() helper), and replaces a custom HTTP GET that is unaware of error response codes (#4980) and necessary credentials (#5024).

ATM this solution is only working for git annex get, but not datalad get. No idea why.
#5024 (comment)

Fixes #4980
Fixes #5024

Copy link
Member

@bpoldrack bpoldrack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #5035 should solve the issue re datalad-get which is an artifact of running in a virtualenv.

Otherwise this change is fine with me. We loose progress reporting by the special remote that way, but supporting authenticated HTTP seems more important and breaking down download_url in a way that allows for it is a bigger surgery.

@bpoldrack
Copy link
Member

Note, that the failure boils down to is_interactive again.

It intentionally does not support all of the capabilities of
downloaders/providers.
Previous request result handling assumed that HTTP error codes
necessarily result in exceptions, which they do not.

Instead of implementing error handling per request, use an existing
abstraction.

Fixes dataladgh-5023

... although it could be made better by supporting git-credentials as
a credential sources in DataLad.
This uses a newly established helper (from dataladgh-5025).

However, while this is working with `git annex get`, it does not with
`datalad get` -- unclear why.
@mih
Copy link
Member Author

mih commented Oct 19, 2020

Rebased on top of reworked #5025

@codecov
Copy link

codecov bot commented Oct 19, 2020

Codecov Report

Merging #5026 into maint will decrease coverage by 0.02%.
The diff coverage is 76.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            maint    #5026      +/-   ##
==========================================
- Coverage   89.94%   89.92%   -0.03%     
==========================================
  Files         292      292              
  Lines       40849    40861      +12     
==========================================
+ Hits        36742    36744       +2     
- Misses       4107     4117      +10     
Impacted Files Coverage Δ
datalad/distributed/ora_remote.py 31.25% <0.00%> (+0.29%) ⬆️
datalad/core/distributed/clone.py 89.05% <25.00%> (+0.29%) ⬆️
datalad/support/network.py 86.90% <83.33%> (-0.05%) ⬇️
datalad/downloaders/tests/test_http.py 88.52% <100.00%> (-1.62%) ⬇️
datalad/downloaders/http.py 81.85% <0.00%> (-2.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf97236...1c9382d. Read the comment docs.

@mih mih marked this pull request as ready for review October 19, 2020 14:47
@mih
Copy link
Member Author

mih commented Oct 19, 2020

Thx @bpoldrack This is good now.

providers = Providers.from_config_files()
# not returning anything: download() seems to just echo `dest`
if dest:
return providers.download(url, path=str(dest), overwrite=overwrite)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a comment/code mismatch regarding return behavior.

Otherwise, it looks fine to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, removed completely now -- wasn't valid.

@kyleam
Copy link
Contributor

kyleam commented Oct 19, 2020

There is a test failure in one of the Travis jobs: test_download_url:test_download_url_exceptions. This didn't fail before the comment removal, and obviously isn't caused by it. I also tried locally (exporting the same environment variables) and couldn't trigger.

https://travis-ci.org/github/datalad/datalad/jobs/737149417

@kyleam kyleam merged commit 9d7ee3d into datalad:maint Oct 19, 2020
@yarikoptic yarikoptic added this to the 0.13.5 milestone Dec 12, 2020
@mih mih deleted the bf-5024 branch January 15, 2021 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ORA does not support authenticated HTTP(S) access ORA remote does not handle HTTP403 responses properly
4 participants