Skip to content

Consider how to implement validation of binary content #9

@mwvaughn

Description

@mwvaughn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions