-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix(core): provider do_request to maintain verify in all request, basic headers #145
Changes from 8 commits
fea039c
5fab6dd
fc3207d
c70d728
154e1c7
8950923
c06067a
1b405b4
f848752
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,10 @@ def test_login_logout(registry, credentials): | |
""" | ||
Login and logout are all we can test with basic auth! | ||
""" | ||
client = oras.client.OrasClient(hostname=registry, insecure=True) | ||
client = oras.client.OrasClient(hostname=registry, tls_verify=False) | ||
res = client.login( | ||
hostname=registry, | ||
tls_verify=False, | ||
username=credentials.user, | ||
password=credentials.password, | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vsoch I've also aligned the previously existing auth test to make use of the self-signed certs server workflow 🤗 let me know if overall this PR now matches your expectations :) |
||
|
@@ -136,3 +137,34 @@ def test_directory_push_pull(tmp_path, registry, credentials, target_dir): | |
assert str(tmp_path) in files[0] | ||
assert os.path.exists(files[0]) | ||
assert "artifact.txt" in os.listdir(files[0]) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is great! We now have a proper test for ssl. |
||
|
||
@pytest.mark.with_auth(True) | ||
def test_directory_push_pull_selfsigned_auth( | ||
tmp_path, registry, credentials, target_dir | ||
): | ||
""" | ||
Test push and pull for directory using a self-signed cert registry (`tls_verify=False`) and basic auth (`auth_backend="basic"`) | ||
""" | ||
client = oras.client.OrasClient( | ||
hostname=registry, tls_verify=False, auth_backend="basic" | ||
) | ||
res = client.login( | ||
hostname=registry, | ||
tls_verify=False, | ||
username=credentials.user, | ||
password=credentials.password, | ||
) | ||
assert res["Status"] == "Login Succeeded" | ||
|
||
# Test upload of a directory | ||
upload_dir = os.path.join(here, "upload_data") | ||
res = client.push(files=[upload_dir], target=target_dir) | ||
assert res.status_code == 201 | ||
files = client.pull(target=target_dir, outdir=tmp_path) | ||
|
||
assert len(files) == 1 | ||
assert os.path.basename(files[0]) == "upload_data" | ||
assert str(tmp_path) in files[0] | ||
assert os.path.exists(files[0]) | ||
assert "artifact.txt" in os.listdir(files[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is also 0.2.0 (your addition is correct!) but let's indent the line below it to be a sub-bullet, and remove the second mention of 0.2.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with f848752 🚀