
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
fastapi-simple-bearer
Advanced tools
This library provides you with ability to secure your endpoints with preset token (or tokens) in the "Authorization: Bearer" header
[!CAUTION] There are negative potential consequences of using a hard coded token.
You may want to use JWT tokens: https://github.com/sijokun/async-fastapi-jwt-auth
The easiest way to start working with this library is to install it from pip
pip install fastapi-simple-bearer
Basic usage:
from fastapi import Depends, FastAPI
from fastapi_simple_bearer import FSB, FSBToken
app = FastAPI()
fsb = FSB(token="SUPER_SECRET_TOKEN")
@app.get("/secure")
async def secure(auth: FSBToken = Depends(fsb)):
return {"token": auth.token}
Other examples are available in examples folder
FAQs
The simpliest way to secure your API with preset token
We found that fastapi-simple-bearer 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.