Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | avoid using capfd to test cliHEADmaster | Tomasz Kramkowski | 2023-04-04 | 2 | -16/+19 |
| | |||||
* | Make the main module succeed a strict pyright check | Tomasz Kramkowski | 2023-04-04 | 4 | -8/+13 |
| | |||||
* | application: use get_store to turn environ into Store | Tomasz Kramkowski | 2023-03-29 | 1 | -2/+8 |
| | | | | | This is a form of dependency injection and means that this function should now be testable without monkeypatching. | ||||
* | very basic cli test | Tomasz Kramkowski | 2023-03-29 | 2 | -8/+20 |
| | |||||
* | Use a list of middlewares instead of decorators | Tomasz Kramkowski | 2023-03-28 | 1 | -7/+14 |
| | |||||
* | add ruff to pyproject.toml | Tomasz Kramkowski | 2023-03-28 | 2 | -1/+29 |
| | |||||
* | remove unused variable | Tomasz Kramkowski | 2023-03-28 | 1 | -1/+0 |
| | |||||
* | remove unused imports | Tomasz Kramkowski | 2023-03-28 | 3 | -6/+2 |
| | |||||
* | Make authenticate easier to test without monkeypatching | Tomasz Kramkowski | 2023-03-28 | 2 | -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 import | Tomasz Kramkowski | 2023-03-28 | 1 | -1/+0 |
| | |||||
* | Split Store into Store and Auth | Tomasz Kramkowski | 2023-03-28 | 4 | -7/+12 |
| | | | | This separates the concerns | ||||
* | Switch back to centralised opening of the database | Tomasz Kramkowski | 2023-03-28 | 6 | -50/+59 |
| | | | | | | Create Store instances when needed This will make more sense with following commits | ||||
* | Store: remove superfluous version property | Tomasz Kramkowski | 2023-03-28 | 1 | -4/+0 |
| | |||||
* | move types into their own module | Tomasz Kramkowski | 2023-03-27 | 2 | -28/+38 |
| | |||||
* | rename open_database to open_store | Tomasz Kramkowski | 2023-03-27 | 2 | -5/+5 |
| | |||||
* | tests/middleware/open_database: simplify test | Tomasz Kramkowski | 2023-03-27 | 1 | -36/+13 |
| | |||||
* | Throw all data manipulation code in one place | Tomasz Kramkowski | 2023-03-27 | 6 | -180/+182 |
| | | | | | This means that everything now goes through a Store object, which should make testing a little bit easier. | ||||
* | POST request support | Tomasz Kramkowski | 2023-03-27 | 3 | -2/+62 |
| | |||||
* | Remove redirect functionality | Tomasz Kramkowski | 2023-03-27 | 2 | -30/+2 |
| | |||||
* | functional tests | Tomasz Kramkowski | 2023-03-27 | 3 | -1/+332 |
| | |||||
* | tests/db: pass URI to connect | Tomasz Kramkowski | 2023-03-27 | 1 | -2/+2 |
| | |||||
* | DELETE should 404 when nothing was deleted | Tomasz Kramkowski | 2023-03-27 | 2 | -4/+6 |
| | |||||
* | make DELETE not return content | Tomasz Kramkowski | 2023-03-27 | 1 | -1/+2 |
| | | | | | simple_response automatically includes a body which is not valid for 204 responses | ||||
* | paste.db: normalise UDF naming | Tomasz Kramkowski | 2023-03-27 | 1 | -1/+1 |
| | |||||
* | paste.db: readd missing import of sha256 | Tomasz Kramkowski | 2023-03-27 | 2 | -1/+7 |
| | |||||
* | guard main() call to allow importing __main__ | Tomasz Kramkowski | 2023-03-27 | 1 | -1/+2 |
| | |||||
* | Only handle PUT requests and respond correctly | Tomasz Kramkowski | 2023-03-27 | 2 | -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 HEAD | Tomasz Kramkowski | 2023-03-27 | 1 | -1/+1 |
| | |||||
* | if_none_match: quote ETag values | Tomasz Kramkowski | 2023-03-27 | 2 | -2/+5 |
| | |||||
* | Respond to auth failures with WWW-Authenticate | Tomasz Kramkowski | 2023-03-27 | 2 | -2/+13 |
| | |||||
* | tests/middleware/if_none_match: remove duplicate test | Tomasz Kramkowski | 2023-03-27 | 1 | -7/+0 |
| | |||||
* | pass exc_info explicitly | Tomasz Kramkowski | 2023-03-27 | 1 | -1/+1 |
| | |||||
* | Remove format executable | Tomasz Kramkowski | 2023-03-27 | 1 | -3/+0 |
| | |||||
* | add middleware tests | Tomasz Kramkowski | 2023-03-24 | 8 | -0/+483 |
| | |||||
* | add tests for paste.db | Tomasz Kramkowski | 2023-03-24 | 4 | -1/+141 |
| | |||||
* | paste.db.connect: add docstrings and doctests | Tomasz Kramkowski | 2023-03-24 | 1 | -0/+70 |
| | |||||
* | paste.db.connect: make migrations optional | Tomasz Kramkowski | 2023-03-24 | 1 | -2/+3 |
| | |||||
* | authenticate: rewrite | Tomasz Kramkowski | 2023-03-24 | 1 | -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 response | Tomasz Kramkowski | 2023-03-24 | 1 | -2/+8 |
| | |||||
* | terminate all migrations with semicolon | Tomasz Kramkowski | 2023-03-24 | 1 | -1/+1 |
| | |||||
* | prevent accessing a future database version | Tomasz Kramkowski | 2023-03-24 | 1 | -0/+4 |
| | |||||
* | do not shorten connection to conn in the db API | Tomasz Kramkowski | 2023-03-24 | 1 | -7/+7 |
| | |||||
* | .ignore: ignore poetry.lock for tools like ag | Tomasz Kramkowski | 2023-03-24 | 1 | -0/+1 |
| | |||||
* | Use blake2b instead of sha256 as the data hash | Tomasz Kramkowski | 2023-03-24 | 1 | -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 Kramkowski | 2023-03-24 | 2 | -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 imports | Tomasz Kramkowski | 2023-03-24 | 3 | -16/+14 |
| | |||||
* | add isort as a dev dependency | Tomasz Kramkowski | 2023-03-24 | 2 | -1/+20 |
| | |||||
* | paste.db: Refactor connect | Tomasz Kramkowski | 2023-03-24 | 1 | -10/+19 |
| | |||||
* | Implement If-None-Match handling | Tomasz Kramkowski | 2023-03-24 | 1 | -1/+55 |
| | |||||
* | Fix ETag header format | Tomasz Kramkowski | 2023-03-24 | 1 | -2/+2 |
| |