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

Storage fields validators #51

Merged
merged 9 commits into from
Feb 3, 2021
Merged

Conversation

pdelboca
Copy link
Collaborator

@pdelboca pdelboca commented Feb 1, 2021

sha256, size and lfs_prefix attributes are key to be able to download correctly so we need to validate they're being set correctly when creating a resource via UI or API.

Nowadays all the logic and validation is in the FronEnd, this will move the logic to the backed so API users can also have a validation.

Note: the creation and the structure of the lfs_prefix depends on each instance so I'm just validating that the field exist in the resource schema. Let me know your thoughts!

@pdelboca pdelboca requested a review from shevron February 1, 2021 19:00
@pdelboca pdelboca changed the title [WIP] Storage fields validators Storage fields validators Feb 1, 2021
@pdelboca pdelboca changed the title Storage fields validators [WIP] Storage fields validators Feb 1, 2021
@pdelboca pdelboca marked this pull request as draft February 1, 2021 19:01
ckanext/external_storage/validators.py Outdated Show resolved Hide resolved
ckanext/external_storage/validators.py Show resolved Hide resolved
ckanext/external_storage/validators.py Show resolved Hide resolved
@shevron
Copy link
Contributor

shevron commented Feb 2, 2021

Re lfs_prefix it kind of makes sense to create it on the server side, but it also doesn't - the uploading client should set it after doing the upload, after all the server isn't uploading. I'm thinking that maybe the right solution would be an endpoint that provides the "right" lfs_prefix, along with the LFS server URL and an auth token. This can be used by API clients to upload and then set the right prefix. I'm not sure about this. What do you think?

@pdelboca pdelboca marked this pull request as ready for review February 3, 2021 14:14
@pdelboca pdelboca merged commit fd608ce into master Feb 3, 2021
@pdelboca pdelboca changed the title [WIP] Storage fields validators Storage fields validators Feb 3, 2021
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.

None yet

2 participants