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

Consider how to implement validation of binary content #9

Open
mwvaughn opened this issue Oct 1, 2020 · 0 comments
Open

Consider how to implement validation of binary content #9

mwvaughn opened this issue Oct 1, 2020 · 0 comments
Labels
brainstorm Ideas in the works enhancement New feature or request

Comments

@mwvaughn
Copy link
Contributor

mwvaughn commented Oct 1, 2020

As @shwetagopaul92 has implemented binary uploads in the Tapis CLI, we should consider how to implement at least minimal validation of a binary upload. The use case is to allow a developer to enforce requirements on a binary upload. For example, "the binary must be a JPEG or PNG file".

My initial instinct is I don't think we can accomplish this task declaratively, i.e. by simply providing a JSON schema file(s), which is what we're doing for context and message.

One possible function signature might look like: validate_binary(self, binary=None, validator=None, permissive=True) where validator is a function that accepts the binary and raises ValueError on failure. We could supply a trivial validator function that verifies that presence of bytes (or something simple like that) and returns True. Implementation of more sophisticated validator logic would be up to the developer.

@mwvaughn mwvaughn added enhancement New feature or request brainstorm Ideas in the works labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorm Ideas in the works enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant