Magicarp-api

Latest version: v1.7.1

Safety actively analyzes 682457 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

1.7.1

~~~~~~~~~~~~~~~~~~

Version bump to override mistake with package building.

1.7.0

~~~~~~~~~~~~~~~~~~

New Features:

* Default server factory (magicarp/server_factory.py) loads config for flask
(magicarp/settings/flask_defaults.py), those defaults are nowadays overridden
by settings from magicarp.settings.base and those are loaded by
simple_settings, in effect it's trivial to change any flask settings
without overriding server factory, to achieve this
magicapr/settings/base.py hold all the Flask settings with standard Flask
defaults
* Add start-app.sh script to be pip-installable, improve mentioned script to
be more verbose (it makes easier to start framework after fresh pip install)

Under-the-hood Features:

* Improvement to setup.py (so it's easier to modify requirements for example)
* Replace nose with pytest + tox
* Move to twine when publishing package

1.6.0

~~~~~~~~~~~~~~~~~~

New Features:

* New field `DocumentField`, behaves like a Mongo-like document, any key and
any value will do, as long as they can be json serialised. (Note: there is
already a mechanism to define how to serialise complex objects). Helps if
response is document without fixed structure. Previously developer was
forced to use raw response and had no support of framework with validation.
* New methods to override on endpoints pre_action and post_action, pre_action
allows to manipulate endpoint before anything happens, post_action
allows to manipulate result before it's being send to the end user, typical
use case is optional header that alters how endpoint works (ie
authentication) or adding custom headers to the response
* Auth models have new method is_authorised that return true/false
* New exception AccessForbiden and default handling of it, simplest use case
is to import it in your project and raise, to do http status code 403

Removed Features:

* Auth and storage was removed from framework. As many projects out there, as
many methods of authenticating. Magicarp mission is help with problems that
are more or less always solved one way, not to have myriad of settings
options, that each of them almost work but not really for this typical use
case. Current go-to solution is providing `register_auth` function to
create_app and providing endpoint that will work with it. For that reason
redis and dummy storage was removed as not every app will require
persistence and it was introduced to handle user authentication.
* As Auth ceased to exist so did AuthorizedTestUser, feature that can be
implemented number of ways and is like auth dependent on developers taste
and need
* Due to auth no longer being part of magicarp, setting ROUTING_ADD_AUTH was
dropped

Bug Fixes:

* When ROUTING_ADD_COMMON and ROUTING_ADD_AUTH was False, bug prevented
registering any other version-less endpoint
* When attempting to register second endpoint with same name as the first one,
magicarp was attempting to raise exception DuplicateRouteException, this
exception was reimplemented + clarified a bit text message
* endpoint that was added to blueprint not as an instance was incorrectly
displaying help (taken on default from docstring), instantiate all endpoints
prior to be added to routing (developer can add endpoint as either class or
instance)

Breaking Compatibility:

* default map endpoint started to use new schema Map (behaves the same)
* add ROUTING_ADD_SHUTDOWN_ROUTE as an explicit way to add endpoint that
allows remotely to shtudown a server, helpful if we want to stop server
execution programatically via test runners or bots, it's niche requirements
and potentially dangerous and thus should be on default False

1.5.0

~~~~~~~~~~~~~~~~~~

New Features:

* Renamed response to envelope to distinguish it from response as an
interaction of webserver, in other words from now on each request,
there will be a response in form of envelope that may or may not contain
additional payload
* Envelopes are classes, in order to make possible to override http_code they
return.

Breaking Compatibility:

* responses have been changed into envelopes

1.4.1

~~~~~~~~~~~~~~~~~~

Bug Fixes:

* Prevent critical error on initialisation of logging with default settings

1.4.0

~~~~~~~~~~~~~~~~~~

New Features:

* logging module follows implementation provided by flask, there are three
variables on settings LOGGING, LOGGING_ADDITIONAL_HANDLERS and
LOGGING_ADDITIONAL_LOGGERS, first one defines logging for the whole magicarp
(there is `root` and `magicarp` as a base for logging), while
LOGGING_ADDITIONAL_* allows to add loggers and/or handlers on top of that

Breaking Compatibility Changes:

* logging was re-modeled and as such previous configuration won't work and
will be ignored

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.