-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stronger validation of responses from MyTardis API (#483)
* Add a type for storing/validating an MD5 checksum, and associated tests * Introduce a base dataclass to be used for all the validation dataclasses representing MyTardis resources * Move hexadecimal validator to a new module specifically for validators * Extract two validation functions to the validators module * Rename validators module to avoid possible name clash with validators package * Delete unused regex * Use the ISO datetime parser from dateutils, instead of a hand-rolled regex * Extract MD5 checksum validation to a standalone function * Convert MD5Sum to an Annotated str to reduce verbosity * Move the definitions of some helper Annotated types to mytardis_client so they can be used in defining dataclasses there without introducing cyclic dependencies * Remove seemingly unnecessary boilerplate * Fix broken imports * Add dataclasses for validating/storing response data from the MyTardis API * Store the output data type associated with GET requests to each endpoint, and use this in the rest client GET calls * Use the more strongly typed GET interface in the overseer * Use the more strongly-typed GET interface in the Overseer * Introduce a MyTardisResource protocol to achieve structural subtyping in the return types from the MyTardis client * Simplify some type-checking logic * Delete commented code * Update the poetry lock file * Add package with typing stubs for the dateutil package * Fix broken tests * Avoid overriding default pagination from MyTardis if no pagination specified * Add missing f-string prefix * Fix broken Overseer tests * Rename modules to align terminology (validation instead of validate/validators)
- Loading branch information
1 parent
c75c502
commit 20b7c74
Showing
30 changed files
with
609 additions
and
292 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.