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

Adds verify SSL option #10

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
id: versions
run: |
VERSION=$(git describe --tags --abbrev=0)
VERSION=${VERSION#v}
IMAGE=${{ env.REGISTRY }}/$(echo "${{ env.IMAGE_NAME }}" | awk '{print tolower($0)}')
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT
echo "TAG=$IMAGE:$VERSION" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies = [
"paramiko",
"xnat",
"arcana",
"arcana-xnat",
"arcana-xnat >=0.4.1",
]
license = { file = "LICENSE" }
authors = [{ name = "Thomas G. Close", email = "[email protected]" }]
Expand Down Expand Up @@ -47,7 +47,7 @@ dev = ["black", "pre-commit", "codespell", "flake8", "flake8-pyproject"]
test = [
"pytest >=6.2.5",
"pytest-env>=0.6.2",
"pytest-cov>=2.12.1",
"pytest-cov>=2.12.1",
"xnat4tests >=0.3",
"medimages4tests >=0.3.1",
"PyYAML",
Expand Down
1 change: 0 additions & 1 deletion xnat_ingest/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .base import cli
from .upload import upload
from .stage import stage
from .transfer import transfer
273 changes: 0 additions & 273 deletions xnat_ingest/cli/transfer.py

This file was deleted.

14 changes: 13 additions & 1 deletion xnat_ingest/cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@
default=0,
help="The number of days to keep files in the remote store for",
)
@click.option(
"--verify-ssl/--dont-verify-ssl",
type=bool,
default=False,
envvar="XNAT_INGEST_UPLOAD_VERIFY_SSL",
help="Whether to verify the SSL certificate of the XNAT server",
)
def upload(
staged: str,
server: str,
Expand All @@ -170,6 +177,7 @@ def upload(
temp_dir: ty.Optional[Path],
use_manifest: bool,
clean_up_older_than: int,
verify_ssl: bool,
):

set_logger_handling(
Expand All @@ -182,7 +190,11 @@ def upload(
tempfile.tempdir = str(temp_dir)

xnat_repo = Xnat(
server=server, user=user, password=password, cache_dir=Path(tempfile.mkdtemp())
server=server,
user=user,
password=password,
cache_dir=Path(tempfile.mkdtemp()),
verify_ssl=verify_ssl,
)

with xnat_repo.connection:
Expand Down
Loading