aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* avoid using capfd to test cliHEADmasterTomasz Kramkowski2023-04-042-16/+19
|
* Make the main module succeed a strict pyright checkTomasz Kramkowski2023-04-044-8/+13
|
* application: use get_store to turn environ into StoreTomasz Kramkowski2023-03-291-2/+8
| | | | | This is a form of dependency injection and means that this function should now be testable without monkeypatching.
* very basic cli testTomasz Kramkowski2023-03-292-8/+20
|
* Use a list of middlewares instead of decoratorsTomasz Kramkowski2023-03-281-7/+14
|
* add ruff to pyproject.tomlTomasz Kramkowski2023-03-282-1/+29
|
* remove unused variableTomasz Kramkowski2023-03-281-1/+0
|
* remove unused importsTomasz Kramkowski2023-03-283-6/+2
|
* Make authenticate easier to test without monkeypatchingTomasz Kramkowski2023-03-282-45/+43
| | | | | | By having authenticate be a function taking a parameter to a getter which can get an Auth from an Env, it's now possible to test it without needing monkeypatching.
* remove superfluous importTomasz Kramkowski2023-03-281-1/+0
|
* Split Store into Store and AuthTomasz Kramkowski2023-03-284-7/+12
| | | | This separates the concerns
* Switch back to centralised opening of the databaseTomasz Kramkowski2023-03-286-50/+59
| | | | | | Create Store instances when needed This will make more sense with following commits
* Store: remove superfluous version propertyTomasz Kramkowski2023-03-281-4/+0
|
* move types into their own moduleTomasz Kramkowski2023-03-272-28/+38
|
* rename open_database to open_storeTomasz Kramkowski2023-03-272-5/+5
|
* tests/middleware/open_database: simplify testTomasz Kramkowski2023-03-271-36/+13
|
* Throw all data manipulation code in one placeTomasz Kramkowski2023-03-276-180/+182
| | | | | This means that everything now goes through a Store object, which should make testing a little bit easier.
* POST request supportTomasz Kramkowski2023-03-273-2/+62
|
* Remove redirect functionalityTomasz Kramkowski2023-03-272-30/+2
|
* functional testsTomasz Kramkowski2023-03-273-1/+332
|
* tests/db: pass URI to connectTomasz Kramkowski2023-03-271-2/+2
|
* DELETE should 404 when nothing was deletedTomasz Kramkowski2023-03-272-4/+6
|
* make DELETE not return contentTomasz Kramkowski2023-03-271-1/+2
| | | | | simple_response automatically includes a body which is not valid for 204 responses
* paste.db: normalise UDF namingTomasz Kramkowski2023-03-271-1/+1
|
* paste.db: readd missing import of sha256Tomasz Kramkowski2023-03-272-1/+7
|
* guard main() call to allow importing __main__Tomasz Kramkowski2023-03-271-1/+2
|
* Only handle PUT requests and respond correctlyTomasz Kramkowski2023-03-272-12/+22
| | | | | | | Previously PUT and POST requests were handled the same way, this isn't correct and POST should be used for the functionality where a random URL is generated. Additionally PUT should reply with 201 when inserting and 204 when updating.
* Return a string content_length for HEADTomasz Kramkowski2023-03-271-1/+1
|
* if_none_match: quote ETag valuesTomasz Kramkowski2023-03-272-2/+5
|
* Respond to auth failures with WWW-AuthenticateTomasz Kramkowski2023-03-272-2/+13
|
* tests/middleware/if_none_match: remove duplicate testTomasz Kramkowski2023-03-271-7/+0
|
* pass exc_info explicitlyTomasz Kramkowski2023-03-271-1/+1
|
* Remove format executableTomasz Kramkowski2023-03-271-3/+0
|
* add middleware testsTomasz Kramkowski2023-03-248-0/+483
|
* add tests for paste.dbTomasz Kramkowski2023-03-244-1/+141
|
* paste.db.connect: add docstrings and doctestsTomasz Kramkowski2023-03-241-0/+70
|
* paste.db.connect: make migrations optionalTomasz Kramkowski2023-03-241-2/+3
|
* authenticate: rewriteTomasz Kramkowski2023-03-241-10/+15
| | | | | | | | | | Fixes a few core issues: - No longer uses the Bearer type, instead using a custom APIKey type, this is because this has nothing to do with OAuth 2.0 bearer tokens. - Validation is moved into the middleware, with the check_auth function renamed to check_token with the sole job of checking the token, this makes testing easier - Validation handles more cases
* catch_exceptions: set exc_info in responseTomasz Kramkowski2023-03-241-2/+8
|
* terminate all migrations with semicolonTomasz Kramkowski2023-03-241-1/+1
|
* prevent accessing a future database versionTomasz Kramkowski2023-03-241-0/+4
|
* do not shorten connection to conn in the db APITomasz Kramkowski2023-03-241-7/+7
|
* .ignore: ignore poetry.lock for tools like agTomasz Kramkowski2023-03-241-0/+1
|
* Use blake2b instead of sha256 as the data hashTomasz Kramkowski2023-03-241-2/+2
| | | | With a digest size of 32 so it takes up the same amount of space
* Add a DATA_HASH UDF (same as SHA256)Tomasz Kramkowski2023-03-242-6/+15
| | | | | | This means that the underlying hash function can be changed without needing to change the name. Although the change would still break the database backwards compatibility, but that's a separate problem.
* isort importsTomasz Kramkowski2023-03-243-16/+14
|
* add isort as a dev dependencyTomasz Kramkowski2023-03-242-1/+20
|
* paste.db: Refactor connectTomasz Kramkowski2023-03-241-10/+19
|
* Implement If-None-Match handlingTomasz Kramkowski2023-03-241-1/+55
|
* Fix ETag header formatTomasz Kramkowski2023-03-241-2/+2
|