From 40298c079414577371626e28a445b9fbb2bc4e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Sat, 18 Sep 2021 22:36:46 -0500 Subject: [PATCH 01/11] add base model --- fast_agave/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_agave/version.py b/fast_agave/version.py index ffcc925..56bd823 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.0.3' +__version__ = '0.0.4.dev0' From c3b1a232924065b87fadb209b19b4c9243279392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Sat, 18 Sep 2021 22:48:39 -0500 Subject: [PATCH 02/11] base model --- fast_agave/models/__init__.py | 3 +++ fast_agave/models/base.py | 23 +++++++++++++++++++++++ fast_agave/version.py | 2 +- setup.py | 2 +- tests/models/__init__.py | 0 tests/models/test_base.py | 26 ++++++++++++++++++++++++++ 6 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 fast_agave/models/base.py create mode 100644 tests/models/__init__.py create mode 100644 tests/models/test_base.py diff --git a/fast_agave/models/__init__.py b/fast_agave/models/__init__.py index e69de29..3692f95 100644 --- a/fast_agave/models/__init__.py +++ b/fast_agave/models/__init__.py @@ -0,0 +1,3 @@ +from .base import BaseModel + +__all__ = ['BaseModel'] diff --git a/fast_agave/models/base.py b/fast_agave/models/base.py new file mode 100644 index 0000000..866994d --- /dev/null +++ b/fast_agave/models/base.py @@ -0,0 +1,23 @@ +from typing import ClassVar, Dict + +from mongoengine_plus.models.helpers import mongo_to_dict + + +class BaseModel: + _excluded: ClassVar = [] + _hidden: ClassVar = [] + + def __init__(self, *args, **values): + return super().__init__(*args, **values) + + def to_dict(self) -> Dict: + private_fields = [f for f in dir(self) if f.startswith('_')] + excluded = self._excluded + private_fields + mongo_dict: dict = mongo_to_dict(self, excluded) + + for field in self._hidden: + mongo_dict[field] = '********' + return mongo_dict + + def __repr__(self) -> str: + return str(self.to_dict()) # pragma: no cover diff --git a/fast_agave/version.py b/fast_agave/version.py index 56bd823..cc73f19 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.0.4.dev0' +__version__ = '0.0.4.dev1' diff --git a/setup.py b/setup.py index fa0191a..dbb8ebe 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ install_requires=[ 'cuenca-validations>=0.9.4,<1.0.0', 'fastapi>=0.63.0,<1.0.0', - 'mongoengine-plus>=0.0.2,<1.0.0', + 'mongoengine-plus>=0.0.2,<0.1.0', 'starlette-context>=0.3.2,<0.4.0', ], classifiers=[ diff --git a/tests/models/__init__.py b/tests/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/test_base.py b/tests/models/test_base.py new file mode 100644 index 0000000..aa1f735 --- /dev/null +++ b/tests/models/test_base.py @@ -0,0 +1,26 @@ +from enum import Enum + +from mongoengine import Document, StringField +from mongoengine_plus.types import EnumField + +from fast_agave.models import BaseModel + + +class ModelType(Enum): + test = 'test' + + +class TestModel(BaseModel, Document): + id = StringField() + secret_field = StringField() + type = EnumField(ModelType) + __test__ = False + _hidden = ['secret_field'] + + +def test_hide_field(): + model = TestModel(id='12345', secret_field='secret', type=ModelType.test) + model_dict = model.to_dict() + assert model_dict['secret_field'] == '********' + assert model_dict['id'] == '12345' + assert model_dict['type'] == 'test' From 0c917c739d150f19bb1d7dd246ede0de66c247c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Mon, 20 Sep 2021 17:26:08 -0500 Subject: [PATCH 03/11] add exception handlers --- examples/app.py | 8 ++++++++ examples/resources/base.py | 15 ++++++++++++++- fast_agave/exc.py | 10 +++++----- fast_agave/exception_handlers.py | 20 ++++++++++++++++++++ fast_agave/version.py | 2 +- tests/test_app.py | 18 ++++++++++++++++++ 6 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 fast_agave/exception_handlers.py diff --git a/examples/app.py b/examples/app.py index 34cd806..c0163f9 100644 --- a/examples/app.py +++ b/examples/app.py @@ -1,9 +1,15 @@ from typing import Dict +from cuenca_validations.errors import CuencaError from mongoengine import connect from fastapi import FastAPI from starlette.middleware import Middleware +from fast_agave.exc import FastAgaveError +from fast_agave.exception_handlers import ( + fast_agave_exceptions_handler, + cuenca_errors_handler, +) from .resources import app as resources from .middlewares import AuthedMiddleware @@ -11,6 +17,8 @@ connect(host='mongomock://localhost:27017/db') app = FastAPI(middleware=[Middleware(AuthedMiddleware)]) app.include_router(resources) +app.add_exception_handler(FastAgaveError, fast_agave_exceptions_handler) +app.add_exception_handler(CuencaError, cuenca_errors_handler) @app.get('/') diff --git a/examples/resources/base.py b/examples/resources/base.py index d42a759..9c43f3b 100644 --- a/examples/resources/base.py +++ b/examples/resources/base.py @@ -1,6 +1,9 @@ -from typing import Dict +from typing import Dict, NoReturn + +from cuenca_validations.errors import WrongCredsError from fast_agave.blueprints import RestApiBlueprint +from fast_agave.exc import UnauthorizedError app = RestApiBlueprint() @@ -8,3 +11,13 @@ @app.get('/healthy_auth') def health_auth_check() -> Dict: return dict(greeting="I'm authenticated and healthy !!!") + + +@app.get('/raise_cuenca_errors') +def raise_cuenca_errors() -> NoReturn: + raise WrongCredsError('you are not lucky enough!') + + +@app.get('/raise_fast_agave_errors') +def raise_fast_agave_errors() -> NoReturn: + raise UnauthorizedError('nice try!') diff --git a/fast_agave/exc.py b/fast_agave/exc.py index 38792e4..bb901be 100644 --- a/fast_agave/exc.py +++ b/fast_agave/exc.py @@ -4,22 +4,22 @@ @dataclass -class Error(HTTPException): +class FastAgaveError(HTTPException): def __init__(self, detail=''): super().__init__(status_code=self.status_code, detail=detail) -class BadRequestError(Error): +class BadRequestError(FastAgaveError): status_code = 400 -class UnauthorizedError(Error): +class UnauthorizedError(FastAgaveError): status_code = 401 -class ForbiddenError(Error): +class ForbiddenError(FastAgaveError): status_code = 403 -class NotFoundError(Error): +class NotFoundError(FastAgaveError): status_code = 404 diff --git a/fast_agave/exception_handlers.py b/fast_agave/exception_handlers.py new file mode 100644 index 0000000..70c42a2 --- /dev/null +++ b/fast_agave/exception_handlers.py @@ -0,0 +1,20 @@ +from cuenca_validations.errors import CuencaError +from fastapi import Request +from starlette.responses import JSONResponse + +from fast_agave.exc import FastAgaveError + + +async def fast_agave_exceptions_handler( + _: Request, exc: FastAgaveError +) -> JSONResponse: + return JSONResponse( + status_code=exc.status_code, content=dict(error=exc.detail) + ) + + +async def cuenca_errors_handler(_: Request, exc: CuencaError) -> JSONResponse: + return JSONResponse( + status_code=exc.status_code, + content=dict(error=str(exc), code=exc.code), + ) diff --git a/fast_agave/version.py b/fast_agave/version.py index cc73f19..0388aa8 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.0.4.dev1' +__version__ = '0.0.4.dev2' diff --git a/tests/test_app.py b/tests/test_app.py index 10167e2..71dd68a 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -5,3 +5,21 @@ def test_iam_healthy(client: TestClient) -> None: resp = client.get('/') assert resp.status_code == 200 assert resp.json() == dict(greeting="I'm healthy!!!") + + +def test_cuenca_error_handler(client: TestClient) -> None: + resp = client.get('/raise_cuenca_errors') + assert resp.status_code == 401 + assert resp.json() == dict(error='you are not lucky enough!', code=101) + + +def test_cuenca_error_handler(client: TestClient) -> None: + resp = client.get('/raise_cuenca_errors') + assert resp.status_code == 401 + assert resp.json() == dict(error='you are not lucky enough!', code=101) + + +def test_fast_agave_error_handler(client: TestClient) -> None: + resp = client.get('/raise_fast_agave_errors') + assert resp.status_code == 401 + assert resp.json() == dict(error='nice try!') From b4a52cda95cb9033261d390d283b40d0cb81ba41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Mon, 20 Sep 2021 17:29:20 -0500 Subject: [PATCH 04/11] fix --- tests/test_app.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index 71dd68a..77a7bc2 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -13,12 +13,6 @@ def test_cuenca_error_handler(client: TestClient) -> None: assert resp.json() == dict(error='you are not lucky enough!', code=101) -def test_cuenca_error_handler(client: TestClient) -> None: - resp = client.get('/raise_cuenca_errors') - assert resp.status_code == 401 - assert resp.json() == dict(error='you are not lucky enough!', code=101) - - def test_fast_agave_error_handler(client: TestClient) -> None: resp = client.get('/raise_fast_agave_errors') assert resp.status_code == 401 From 882d065f851dff87fb3235f3774ce583fbd5327c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Mon, 20 Sep 2021 18:02:44 -0500 Subject: [PATCH 05/11] FastAgaveViewError --- fast_agave/exc.py | 4 ++++ fast_agave/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fast_agave/exc.py b/fast_agave/exc.py index bb901be..613d109 100644 --- a/fast_agave/exc.py +++ b/fast_agave/exc.py @@ -23,3 +23,7 @@ class ForbiddenError(FastAgaveError): class NotFoundError(FastAgaveError): status_code = 404 + + +class FastAgaveViewError(FastAgaveError): + status_code = 500 diff --git a/fast_agave/version.py b/fast_agave/version.py index 0388aa8..e5d57d6 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.0.4.dev2' +__version__ = '0.0.4.dev3' From e2521123debb6c20537383c67a178ed32c35f07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Mon, 20 Sep 2021 18:13:14 -0500 Subject: [PATCH 06/11] rename handler --- examples/app.py | 10 ++++++---- fast_agave/exception_handlers.py | 2 +- fast_agave/version.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/app.py b/examples/app.py index c0163f9..5789189 100644 --- a/examples/app.py +++ b/examples/app.py @@ -3,11 +3,10 @@ from cuenca_validations.errors import CuencaError from mongoengine import connect from fastapi import FastAPI -from starlette.middleware import Middleware from fast_agave.exc import FastAgaveError from fast_agave.exception_handlers import ( - fast_agave_exceptions_handler, + fast_agave_errors_handler, cuenca_errors_handler, ) from .resources import app as resources @@ -15,9 +14,12 @@ connect(host='mongomock://localhost:27017/db') -app = FastAPI(middleware=[Middleware(AuthedMiddleware)]) +app = FastAPI(title='example') app.include_router(resources) -app.add_exception_handler(FastAgaveError, fast_agave_exceptions_handler) + +app.add_middleware(AuthedMiddleware) + +app.add_exception_handler(FastAgaveError, fast_agave_errors_handler) app.add_exception_handler(CuencaError, cuenca_errors_handler) diff --git a/fast_agave/exception_handlers.py b/fast_agave/exception_handlers.py index 70c42a2..66eaf12 100644 --- a/fast_agave/exception_handlers.py +++ b/fast_agave/exception_handlers.py @@ -5,7 +5,7 @@ from fast_agave.exc import FastAgaveError -async def fast_agave_exceptions_handler( +async def fast_agave_errors_handler( _: Request, exc: FastAgaveError ) -> JSONResponse: return JSONResponse( diff --git a/fast_agave/version.py b/fast_agave/version.py index e5d57d6..fb1632c 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.0.4.dev3' +__version__ = '0.0.4.dev4' From 3deaab6857ccbb3c36f41da985bdff67bd348081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Wed, 22 Sep 2021 17:27:37 -0500 Subject: [PATCH 07/11] fix --- fast_agave/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fast_agave/version.py b/fast_agave/version.py index fb1632c..b794fd4 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.0.4.dev4' +__version__ = '0.1.0' diff --git a/setup.py b/setup.py index dbb8ebe..fa0191a 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ install_requires=[ 'cuenca-validations>=0.9.4,<1.0.0', 'fastapi>=0.63.0,<1.0.0', - 'mongoengine-plus>=0.0.2,<0.1.0', + 'mongoengine-plus>=0.0.2,<1.0.0', 'starlette-context>=0.3.2,<0.4.0', ], classifiers=[ From 47f1cd2772080ef51b03fa786d04bc5f0fbd0b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Wed, 22 Sep 2021 17:29:52 -0500 Subject: [PATCH 08/11] remove unnecesary files --- fast_agave/models/__init__.py | 3 --- fast_agave/models/base.py | 23 ----------------------- tests/models/__init__.py | 0 tests/models/test_base.py | 26 -------------------------- 4 files changed, 52 deletions(-) delete mode 100644 fast_agave/models/__init__.py delete mode 100644 fast_agave/models/base.py delete mode 100644 tests/models/__init__.py delete mode 100644 tests/models/test_base.py diff --git a/fast_agave/models/__init__.py b/fast_agave/models/__init__.py deleted file mode 100644 index 3692f95..0000000 --- a/fast_agave/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .base import BaseModel - -__all__ = ['BaseModel'] diff --git a/fast_agave/models/base.py b/fast_agave/models/base.py deleted file mode 100644 index 866994d..0000000 --- a/fast_agave/models/base.py +++ /dev/null @@ -1,23 +0,0 @@ -from typing import ClassVar, Dict - -from mongoengine_plus.models.helpers import mongo_to_dict - - -class BaseModel: - _excluded: ClassVar = [] - _hidden: ClassVar = [] - - def __init__(self, *args, **values): - return super().__init__(*args, **values) - - def to_dict(self) -> Dict: - private_fields = [f for f in dir(self) if f.startswith('_')] - excluded = self._excluded + private_fields - mongo_dict: dict = mongo_to_dict(self, excluded) - - for field in self._hidden: - mongo_dict[field] = '********' - return mongo_dict - - def __repr__(self) -> str: - return str(self.to_dict()) # pragma: no cover diff --git a/tests/models/__init__.py b/tests/models/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/models/test_base.py b/tests/models/test_base.py deleted file mode 100644 index aa1f735..0000000 --- a/tests/models/test_base.py +++ /dev/null @@ -1,26 +0,0 @@ -from enum import Enum - -from mongoengine import Document, StringField -from mongoengine_plus.types import EnumField - -from fast_agave.models import BaseModel - - -class ModelType(Enum): - test = 'test' - - -class TestModel(BaseModel, Document): - id = StringField() - secret_field = StringField() - type = EnumField(ModelType) - __test__ = False - _hidden = ['secret_field'] - - -def test_hide_field(): - model = TestModel(id='12345', secret_field='secret', type=ModelType.test) - model_dict = model.to_dict() - assert model_dict['secret_field'] == '********' - assert model_dict['id'] == '12345' - assert model_dict['type'] == 'test' From c6765c069c972c27afc3f1cc400858461ced8ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Wed, 6 Oct 2021 12:55:39 -0500 Subject: [PATCH 09/11] exeption handler middleware returns --- examples/app.py | 11 ++------- examples/middlewares/authed.py | 4 +++- examples/resources/base.py | 8 +++++++ fast_agave/exc.py | 23 +++++++++++-------- fast_agave/exception_handlers.py | 20 ---------------- fast_agave/middlewares/__init__.py | 3 +++ fast_agave/middlewares/error_handlers.py | 29 ++++++++++++++++++++++++ tests/test_app.py | 19 ++++++++++++++++ 8 files changed, 77 insertions(+), 40 deletions(-) delete mode 100644 fast_agave/exception_handlers.py create mode 100644 fast_agave/middlewares/__init__.py create mode 100644 fast_agave/middlewares/error_handlers.py diff --git a/examples/app.py b/examples/app.py index 5789189..9d912db 100644 --- a/examples/app.py +++ b/examples/app.py @@ -1,14 +1,9 @@ from typing import Dict -from cuenca_validations.errors import CuencaError from mongoengine import connect from fastapi import FastAPI -from fast_agave.exc import FastAgaveError -from fast_agave.exception_handlers import ( - fast_agave_errors_handler, - cuenca_errors_handler, -) +from fast_agave.middlewares import FastAgaveErrorHandler from .resources import app as resources from .middlewares import AuthedMiddleware @@ -18,9 +13,7 @@ app.include_router(resources) app.add_middleware(AuthedMiddleware) - -app.add_exception_handler(FastAgaveError, fast_agave_errors_handler) -app.add_exception_handler(CuencaError, cuenca_errors_handler) +app.add_middleware(FastAgaveErrorHandler) @app.get('/') diff --git a/examples/middlewares/authed.py b/examples/middlewares/authed.py index 94cc629..1ee423a 100644 --- a/examples/middlewares/authed.py +++ b/examples/middlewares/authed.py @@ -1,4 +1,6 @@ -from starlette.middleware.base import RequestResponseEndpoint +from starlette.middleware.base import ( + RequestResponseEndpoint, +) from starlette.responses import Response from starlette_context.middleware import ContextMiddleware from starlette_context import _request_scope_context_storage diff --git a/examples/resources/base.py b/examples/resources/base.py index 9c43f3b..ad8f541 100644 --- a/examples/resources/base.py +++ b/examples/resources/base.py @@ -21,3 +21,11 @@ def raise_cuenca_errors() -> NoReturn: @app.get('/raise_fast_agave_errors') def raise_fast_agave_errors() -> NoReturn: raise UnauthorizedError('nice try!') + + +@app.get('/you_shall_not_pass') +def you_shall_not_pass() -> None: + # Este endpoint nunca serĂ¡ ejecutado + # La prueba de este endpoint hace un mock a nivel middleware + # para responder con un `UnauthorizedError` + ... diff --git a/fast_agave/exc.py b/fast_agave/exc.py index 613d109..4abe553 100644 --- a/fast_agave/exc.py +++ b/fast_agave/exc.py @@ -1,29 +1,32 @@ from dataclasses import dataclass -from fastapi import HTTPException - @dataclass -class FastAgaveError(HTTPException): - def __init__(self, detail=''): - super().__init__(status_code=self.status_code, detail=detail) +class FastAgaveError(Exception): + error: str + status_code: int +@dataclass class BadRequestError(FastAgaveError): - status_code = 400 + status_code: int = 400 +@dataclass class UnauthorizedError(FastAgaveError): - status_code = 401 + status_code: int = 401 +@dataclass class ForbiddenError(FastAgaveError): - status_code = 403 + status_code: int = 403 +@dataclass class NotFoundError(FastAgaveError): - status_code = 404 + status_code: int = 404 +@dataclass class FastAgaveViewError(FastAgaveError): - status_code = 500 + status_code: int = 500 diff --git a/fast_agave/exception_handlers.py b/fast_agave/exception_handlers.py deleted file mode 100644 index 66eaf12..0000000 --- a/fast_agave/exception_handlers.py +++ /dev/null @@ -1,20 +0,0 @@ -from cuenca_validations.errors import CuencaError -from fastapi import Request -from starlette.responses import JSONResponse - -from fast_agave.exc import FastAgaveError - - -async def fast_agave_errors_handler( - _: Request, exc: FastAgaveError -) -> JSONResponse: - return JSONResponse( - status_code=exc.status_code, content=dict(error=exc.detail) - ) - - -async def cuenca_errors_handler(_: Request, exc: CuencaError) -> JSONResponse: - return JSONResponse( - status_code=exc.status_code, - content=dict(error=str(exc), code=exc.code), - ) diff --git a/fast_agave/middlewares/__init__.py b/fast_agave/middlewares/__init__.py new file mode 100644 index 0000000..d8037a9 --- /dev/null +++ b/fast_agave/middlewares/__init__.py @@ -0,0 +1,3 @@ +from .error_handlers import FastAgaveErrorHandler + +__all__ = ['FastAgaveErrorHandler'] diff --git a/fast_agave/middlewares/error_handlers.py b/fast_agave/middlewares/error_handlers.py new file mode 100644 index 0000000..a1c2f1c --- /dev/null +++ b/fast_agave/middlewares/error_handlers.py @@ -0,0 +1,29 @@ +from cuenca_validations.errors import CuencaError +from fastapi import Request, Response +from fastapi.responses import JSONResponse +from starlette.middleware.base import ( + BaseHTTPMiddleware, + RequestResponseEndpoint, +) + +from fast_agave.exc import FastAgaveError + + +class FastAgaveErrorHandler(BaseHTTPMiddleware): + async def dispatch( + self, request: Request, call_next: RequestResponseEndpoint + ) -> Response: + try: + return await call_next(request) + except CuencaError as exc: + return JSONResponse( + status_code=exc.status_code, + content=dict( + code=exc.code, + error=str(exc), + ), + ) + except FastAgaveError as exc: + return JSONResponse( + status_code=exc.status_code, content=dict(error=exc.error) + ) diff --git a/tests/test_app.py b/tests/test_app.py index 77a7bc2..261bb5b 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,5 +1,11 @@ +from unittest.mock import AsyncMock + +from _pytest.monkeypatch import MonkeyPatch from fastapi.testclient import TestClient +from examples.middlewares.authed import AuthedMiddleware +from fast_agave.exc import UnauthorizedError + def test_iam_healthy(client: TestClient) -> None: resp = client.get('/') @@ -17,3 +23,16 @@ def test_fast_agave_error_handler(client: TestClient) -> None: resp = client.get('/raise_fast_agave_errors') assert resp.status_code == 401 assert resp.json() == dict(error='nice try!') + + +def test_fast_agave_error_handler_from_middleware( + client: TestClient, monkeypatch: MonkeyPatch +) -> None: + monkeypatch.setattr( + AuthedMiddleware, + 'authorize', + AsyncMock(side_effect=UnauthorizedError('come back to the shadows!')), + ) + resp = client.get('/you_shall_not_pass') + assert resp.status_code == 401 + assert resp.json() == dict(error='come back to the shadows!') From e8a3d070a40be470c903549fb965548760555af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Wed, 6 Oct 2021 13:11:49 -0500 Subject: [PATCH 10/11] bump --- fast_agave/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_agave/version.py b/fast_agave/version.py index b794fd4..7d24cef 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.1.0' +__version__ = '0.1.0.dev0' From 8a83b4d06819505507555d400dbcf63887c193a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Wed, 6 Oct 2021 13:39:53 -0500 Subject: [PATCH 11/11] bump --- fast_agave/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_agave/version.py b/fast_agave/version.py index 7d24cef..b794fd4 100644 --- a/fast_agave/version.py +++ b/fast_agave/version.py @@ -1 +1 @@ -__version__ = '0.1.0.dev0' +__version__ = '0.1.0'