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

Add standard interface for handling file uploads in the Dioptra client #708

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

jkglasbrenner
Copy link
Collaborator

@jkglasbrenner jkglasbrenner commented Jan 10, 2025

Addresses client-side solution for #694

Added requests-toolbelt as a new project dependency to support streaming of multi-file uploads.

This branch does not include any new unit tests for this new functionality, as it will start being exercised via the REST API integration tests once we integrate the solutions for #694 with #658. However, in the interest of verifying this new feature for the client works, I created this branch, https://github.com/usnistgov/dioptra/tree/test-client-uploading-support, that adds a simple /echoes endpoint that allows you to upload files, and the server echoes back the name and size of the files you upload. I tested it locally and I also created two simple REST API integration tests based on this endpoint to validate the test client implementation. Both seem to be working as expected.

Todos

  • Add a utility that scans a directory, either with or without recursion, and builds up a list of DioptraFile objects for upload. The filenames will retain relative filepaths with respect to the source directory's root path, and be standardized in the POSIX format.
  • Add a utility that accepts a filepath/list of filepaths and converts them into a DioptraFile object/list of DioptraFile objects to upload. The filenames will be stripped of any directory paths.

@jkglasbrenner jkglasbrenner changed the title Add uploading support to client Add standard interface for handling file uploads in the Dioptra client Jan 10, 2025
@jkglasbrenner jkglasbrenner linked an issue Jan 10, 2025 that may be closed by this pull request
@jkglasbrenner jkglasbrenner marked this pull request as draft January 10, 2025 23:29
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.

Add general support for uploading files to the Dioptra Client
3 participants