
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
This Python package provides a captcha implementation for use with the
Pyramid Web Framework <https://docs.pylonsproject.org/projects/pyramid/en/latest/>
.
It is based on the captcha <https://pypi.org/project/captcha/>
library and uses
Pyramid sessions for captcha validation. Please refer to the
documentation <https://geo-bl-ch.gitlab.io/pyramid-captcha>
__ for further information.
.. note:: Development builds of this package can be found at https://test.pypi.org/project/pyramid-captcha/.
To generate a captcha, you have to import the class :code:Captcha
.
.. code-block:: python
from pyramid_captcha import Captcha
The simplest solution is to use this class directly in your view definition.
.. code-block:: python
config.add_route('captcha_generate', '/captcha')
config.add_view(
Captcha,
attr='generate',
route_name='captcha_generate',
request_method='GET'
)
In this case, the route :code:/captcha
will return a captcha image
with the default length of 6 characters. If you want to adjust the
captcha properties, you have to wrap it into a view callable, for
example to change the number of characters.
.. code-block:: python
def generate(request):
return Captcha(request, length=4).generate()
The generated captcha value is stored in the current session. It
can be checked against a submitted form value using the
:code:validate()
method.
.. code-block:: python
try:
Captcha(request).validate()
except CaptchaError as e:
raise HTTPForbidden(e)
You can check out the code and run a little demo by calling
:code:make serve
.
https://gitlab.com/geo-bl-ch/pyramid-captcha/-/milestones/1
FAQs
Pyramid Captcha
We found that pyramid-captcha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.