
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Muffin‑OAuth adds OAuth 1 and 2 support to the Muffin_ framework, enabling both client-side and server-side authentication flows.
asyncio
, Trio
, and Curio
Install via pip:
pip install muffin-oauth
Here's a basic example using OAuth2:
from muffin import Application
from muffin_oauth import OAuthPlugin
app = Application("auth-example")
oauth = OAuthPlugin()
oauth.setup(app, providers={
"github": {
"client_id": "...",
"client_secret": "...",
"authorize_url": "https://github.com/login/oauth/authorize",
"access_token_url": "https://github.com/login/oauth/access_token",
"api_base_url": "https://api.github.com"
}
})
@app.route("/")
async def login(request):
return await oauth.authorize_redirect(request, "github", redirect_uri="http://localhost:8000/callback")
@app.route("/callback")
async def callback(request):
token = await oauth.authorize_access_token(request, "github")
request.session["token"] = token
return "Logged in"
@app.route("/user")
async def user(request):
client = oauth.client("github", token=request.session.get("token"))
resp = await client.get("/user")
return resp.json()
Run the example app:
$ make example
http://localhost:5000
Client-side usage:
client = oauth.client("github", access_token="...")
resp = await client.request("GET", "/user")
user_info = resp.json()
This supports both OAuth1 and OAuth2 flows, with automatic token handling and resource access via configured providers.
tests.py
.Found an issue or have an idea? Report it at: https://github.com/klen/muffin-oauth/issues
Contributions welcome! Fork the repo and submit a PR.
Licensed under the MIT license.
FAQs
Support OAuth authentication for Muffin Framework.
We found that muffin-oauth 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.