Skip to content

WebDav support#51

Merged
labkey-alan merged 7 commits into
developfrom
fb_webdav
Jun 30, 2022
Merged

WebDav support#51
labkey-alan merged 7 commits into
developfrom
fb_webdav

Conversation

@labkey-alan
Copy link
Copy Markdown
Contributor

@labkey-alan labkey-alan commented Jun 28, 2022

Rationale

This PR adds two methods to our ServerContext: webdav_client and webdav_path, which create a WebDav Client and construct a LabkeyServer WebDav path.

Related Pull Requests

  • n/a

Changes

  • Add hostname property to ServerContext
  • Add base_url property to ServerContext
  • Add webdav_client method to ServerContext
    • This method returns a webdavclient3 Client instance
  • Add webdav_path method to ServerContext
  • Add docs for WebDav support
  • Add unit tests for ServerContext

@labkey-alan labkey-alan self-assigned this Jun 28, 2022
@labkey-alan
Copy link
Copy Markdown
Contributor Author

@labkey-nicka @cnathe I tested this locally with embedded tomcat, but have not tested using a server that has a context path. I am fairly certain I got this right but would be good to have someone test with a context path set on their LKS instance.

Copy link
Copy Markdown
Contributor

@labkey-nicka labkey-nicka left a comment

Choose a reason for hiding this comment

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

Looks good and works well with my local testing. Here is the final script I utilized:

image

Comment thread labkey/server_context.py
def webdav_client(self, webdav_options: dict = None):
# We localize the import of webdav3 here so it is an optional dependency. Only users who want to use webdav will
# need to pip install webdavclient3
from webdav3.client import Client
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is rad.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's rare that his feature is useful, but it's powerful when used!

Comment thread labkey/server_context.py

client = Client(options)

if self._verify_ssl is False:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch.

@cnathe cnathe removed their request for review June 30, 2022 13:23
@labkey-alan labkey-alan merged commit 7644bd6 into develop Jun 30, 2022
@labkey-alan labkey-alan deleted the fb_webdav branch June 30, 2022 22:42
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.

2 participants