Releases: dymmond/esmerald
Releases · dymmond/esmerald
Version 3.1.1
Added
Changed
- Documentation improvements.
Fixed
Version 3.1.0
Added
settings_module
when passed in the instance of Esmerald will take precedence
over the global settings, removing the need of using constantly theESMERALD_SETTINGS_MODULE
.ApplicationSettingsMiddleware
as internal that handles with thesettings_module
provided and maps
the context of the settings.
Example of the way the settings are evaluated
from esmerald import Esmerald, EsmeraldAPISettings, Gateway, Include, JSONResponse, get, settings
@get()
async def home() -> JSONResponse:
return JSONResponse({"title": settings.title})
class NewSettings(EsmeraldAPISettings):
title: str = "Main app"
class NestedAppSettings(EsmeraldAPISettings):
title: str = "Nested app"
app = Esmerald(
settings_module=NewSettings,
routes=[
Gateway("/home", handler=home),
Include(
"/child",
app=Esmerald(
settings_module=NestedAppSettings,
routes=[
Gateway("/home", handler=home),
],
),
),
],
)
In the context of the controller home
, based on the path being called, it should return the
corresponding value of the title
according to the settings of the app that is included.
Changed
createapp
directiveviews.py
file generated renamed tocontrollers.py
.- Make the
EsmeraldAPISettings
hashable. - Remove
settings_config
in favor of thesettings_module
. - Bump Lilya version to 0.3.3.
Fixed
Version 3.0.0
Changed
- Moved from beta v3 version to the official v3 of Esmerald fully supporting Lilya.
Version 3.0.0b2
Added
- Allow the use
from lilya.middleware import Middleware
as alternative toDefineMiddleware
,
Changed
- Cleaned the
ServerErrorMiddleware
from the lilya import.
Version 3.0.0b1
!!! Warning
This is a major release and it will be under the the version 3
of Esmerald.
You should not be affected but in case you are, please report any issues
so we can correct it.
Added
- Support for
Lilya
and dropStarlette
.
Changed
CSRFConfig
cookie_secure
renamed tosecure
.CSRFConfig
httponly
renamed tohttponly
.CSRFConfig
cookie_samesite
renamed tosamesite
.CSRFConfig
cookie_domain
renamed todomain
.CSRFConfig
cookie_secure
renamed tosecure
.- Removed support for the
BasicMiddleware
as this can be imported from any other ASGI application.
Internal
In the past, Middleware
was being used but with the introduction of Lilya, now is DefineMiddleware
that
is applied.
from lilya.middleware import DefineMiddleware
- The
PlainTextResponse
was renamed toPlainText
.
Version 2.7.4
Fixed
WSGIMiddleware
optional was being called in the core middlewares.
Version 2.7.3
Added
- Allowing
app
to load as a string as alternative to an object inside the Include
Changed
- Internal code for lazy objects.
- Make
a2wsgi
optional forWSGIMiddleware
. httpx
is now only a depedency for testing.- Cleared some core dependencies.
Version 2.7.2
Changed
- Security update for python multipart.
- Update minimum Starlette requirement.
Version 2.7.1
Added
settings_module
as replacement forsettings_config
.- Deprecation warning for
settings_config
in favour ofsettings_module
parameter.
Changed
- Added improvements to the scaffold generated by
esmerald createproject
in the tests. - Added extra origin type for when a MsgSpec Struct is passed in the payload of a handler.
Fixed
- OpenAPI Tags not loading from top down if handler had
tags=None
. - TestClient to allow passing pluggables inside
create_client
.
Version 2.7.0
Changed
Token.decode()
is now aclassmethod
. This allows to subclass theToken
and add extra fields into the model
allowing operations likeencode()
with extra claims. This can be useful for situations like claiming arefresh
oraccess
token.- Internal handlers decorators are now wrapped in a function decorator. This does not affect anything but allows more control over the middleware
calls to async ASGI applications.
Fixed
- OpenAPI when overriding the response for the default status codes of the handlers.