
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Basic framework to handle authentication and authorization in asynchronous Python applications.
Features:
This library is freely inspired by authorization in ASP.NET Core; although its implementation is extremely different.
pip install guardpost
To install with support for JSON Web Tokens (JWTs)
validation:
pip install guardpost[jwt]
For examples, refer to the examples folder.
GuardPost includes functions to validate JSON Web Tokens (JWTs) and handle JSON Web Keys Sets (JWKS).
The built-in validator class can retrieve automatically JWKS from identity providers and handle automatically caching and keys rotation. Caching is useful to not incur in useless performance fees (e.g. downloading JWKS at each web request), and keys rotation is important because identity providers can periodically change the keys they use to sign JWTs.
To use these features, install to include additional dependencies:
pip install guardpost[jwt]
The following example shows how to use guardpost to validate tokens:
import asyncio
from guardpost.jwts import JWTValidator
async def main():
validator = JWTValidator(
authority="YOUR_AUTHORITY",
valid_issuers=["YOUR_ISSUER_VALUE"],
valid_audiences=["YOUR_AUDIENCE"],
)
# keys are fetched when necessary
data = await validator.validate_jwt("YOUR_TOKEN")
print(data)
asyncio.run(main())
An example value for authority
, to validate access tokens issued by
Azure Active Directory could be: https://sts.windows.net/YOUR_TENANT_ID/
.
GuardPost is used in BlackSheep and has been tested with:
Authentication
answers the question: Who is the user who is initiating the
action?, or more in general: Who is the user, or what is the service, that is
initiating the action?.
Authorization
answers the question: Is the user, or service, authorized to
do something?.
Usually, to implement authorization, is necessary to have the context of the entity that is executing the action.
guardpost
is used in the BlackSheep
web framework, to implement authentication and authorization
strategies for request
handlers.
To see how guardpost
is used in blacksheep
web framework, read:
Under construction. 🚧
FAQs
Framework to handle authentication and authorization.
We found that guardpost 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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.