frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

AuthTuna – A modern, async security framework for FastAPI

3•shashstormer•1h ago
https://github.com/shashstormer/authtuna

Hey everyone, creator of AuthTuna here.

For years, I've been building complex, multi-tenant APIs with FastAPI, and I've always found that implementing robust, granular, and truly async security is a huge pain point. You either roll your own and risk vulnerabilities, or you wrestle with frameworks that aren't async-native, causing performance bottlenecks.

I built AuthTuna to solve this. It's the async-first security framework I always wanted:

Truly Async Core: Built on asyncio and SQLAlchemy 2.0. No part of your security logic will block the event loop.

Granular Hierarchical Permissions (RBAC): Go beyond simple roles. You can define permissions like Organization -> Project -> Resource and check them with a simple Depends(PermissionChecker(...)).

Advanced Server-Side Sessions: It provides the security of server-side sessions (with hijack detection) without sacrificing the performance you'd expect from JWTs.

Great Developer Experience: Comes with Pydantic models, pre-built routers for auth flows, and clear dependencies to get you started in minutes.

I use it in my own production systems, so it's been well tested. The goal is to make robust security the easy path, not an afterthought.

I'd love to hear your thoughts and get your feedback. What are you currently using to handle auth in your async Python projects?

Comments

scottydelta•1h ago
So FastAPI is a web framework and AuthTuna is a framework for a framework?

Does FastAPI has a mechanism to add external modules? Like Django calls it an app. People can make open-source Django apps and others can easily include them in their own Django project base.

Good job on launching!

shashstormer•1h ago
Hey scottydelta, thanks for the kind words and the great questions!

That's a great way to put it, and you're right that "framework for a framework" can sound a bit heavy! I think of AuthTuna more as a batteries-included library or an extension for FastAPI. You could compare it to a powerful, reusable Django 'app' that handles all things security-related.

You've hit on a key difference between Django and FastAPI's ecosystems. FastAPI doesn't have a central INSTALLED_APPS setting like Django. Instead, it encourages a more explicit, composable approach using a few key features:

Routers (APIRouter): This is the closest equivalent. A library like AuthTuna can provide a router with all its endpoints (e.g., /login, /logout), and you can mount it in your main app with a single line: app.include_router(auth_router). This is how you "plug in" a set of views.

Middleware: For things that need to run on every request, like our session management, you add it as middleware: app.add_middleware(...).

Dependencies: For protecting specific endpoints, you use FastAPI's powerful dependency injection system: user: User = Depends(get_current_user).

So while it's not a single "app" concept, the combination of these three features allows for creating powerful, reusable components like AuthTuna that can be easily integrated into any FastAPI project.

Taste

https://www.moderndescartes.com/essays/taste/
1•venkii•33s ago•0 comments

Show HN: Beyond – Dynamic Pricing App for Short-Term Rentals

https://www.beyondpricing.com/eu-blog/beyond-launches-first-revenue-management-mobile-app-for-sho...
1•thomcrowe•1m ago•0 comments

Varnish Cache to be renamed Vinyl Cache project

https://varnish-cache.org/#new-release-8-0-0-with-bonus-project-news
1•ibotty•1m ago•0 comments

How to turn Claude Code into a domain specific coding agent

https://blog.langchain.com/how-to-turn-claude-code-into-a-domain-specific-coding-agent/
1•Anon84•2m ago•0 comments

How WASM DB and worker messaging helped me handle 500MB in 2s in browser

2•vinserello•3m ago•0 comments

Repo Wiki Is Amazing

https://qoder.com/blog/repo-wiki-surfacing-implicit-knowledge
1•heyu0328•4m ago•0 comments

Israeli Hacker Bootstrapped Her AI Cyber Company to Profitability

https://www.forbes.com/sites/thomasbrewster/2025/09/15/how-this-israeli-hacker-bootstrapped-her-a...
1•DocFeind•4m ago•0 comments

Kind Engineering: How to Engineer Kindness

https://kind.engineering
2•l2dy•5m ago•0 comments

AI Agent Development Trends 2025: Insights from 542 Projects

https://greenice.net/ai-agent-development-trends/
1•Kateryna_g•5m ago•0 comments

$5M Judgment Against the MyPillow Guy Vacated

https://slate.com/news-and-politics/2025/09/my-pillow-guy-mike-lindell-supreme-court-lawsuit.html
1•jgwil2•7m ago•0 comments

Postwave: An opinionated flat-file based based blog engine in Ruby

https://postwave.blog/
1•dorkrawk•7m ago•1 comments

A string formatting library in 65 lines of C++

https://riki.house/fmt
2•PaulHoule•8m ago•0 comments

Listers: A Glimpse into Extreme Birdwatching [video]

https://www.youtube.com/watch?v=zl-wAqplQAo
1•toomuchtodo•10m ago•0 comments

New Exposé of Johnson and Johnson Indicts a System

https://newrepublic.com/article/194726/johnson-and-johnson-investigation-crimes-health-care-system
1•robtherobber•11m ago•0 comments

Google is shutting down Tables, its Airtable rival

https://techcrunch.com/2025/09/11/google-is-shutting-down-tables-its-airtable-rival/
5•corvad•12m ago•0 comments

SQLite Replication with Beamer [video]

https://www.youtube.com/watch?v=lcved9uEV5U
1•TiredOfLife•12m ago•0 comments

Thought police bill introduced to revoke US passport for criticism of Israel

https://thecradle.co/articles-id/33135
42•slt2021•13m ago•7 comments

Optimizing Go's Garbage Collector for Kubernetes Workloads

https://old.reddit.com/r/RedditEng/comments/1nhkviq/optimizing_gos_garbage_collector_for_kubernetes/
1•scotthew•13m ago•0 comments

Western Digital Announces HDD Price Hikes Effective Immediately

https://www.techpowerup.com/341015/western-digital-announces-hdd-price-hikes-effective-immediately
2•ksec•13m ago•0 comments

Orange Pi RV2 $40 RISC-V SBC: Friendly Gateway to IoT and AI Projects

https://riscv.org/ecosystem-news/2025/09/orange-pi-rv2-40-risc-v-sbc-friendly-gateway-to-iot-and-...
2•warrenm•14m ago•1 comments

I Tried Out GitHub Spec-Kit and All I Got Was This Not Terrible Website

https://robotpaper.ai/i-tried-out-github-spec-kit-and-all-i-got-was-this-not-terrible-website/
1•royosherove•15m ago•0 comments

Boring Work Needs Tension

https://iaziz786.com/blog/boring-work-needs-tension/
3•iaziz786•15m ago•0 comments

RFK Jr.'s CDC may limit Covid shots to 75 and up, claim they killed kids

https://arstechnica.com/health/2025/09/covid-shot-access-could-tighten-rfk-jr-may-claim-they-caus...
12•barbazoo•18m ago•2 comments

Gall's Law

https://en.wikipedia.org/wiki/John_Gall_(author)
1•aleyan•18m ago•0 comments

We turned the whole Bible into a video game, then THIS happened

https://www.youtube.com/watch?v=SqDSiBbtX6c
1•andygeers•19m ago•2 comments

Block Your Exits

https://prickly.oxhe.art/avoidance/
2•warrenm•19m ago•0 comments

USB-A isn't going anywhere, so stop removing the port

https://www.pocket-lint.com/usb-a-isnt-going-anywhere/
5•speckx•19m ago•2 comments

Golden Dome's cost: anywhere from billions to trillions, depending on design

https://spacenews.com/golden-domes-cost-anywhere-from-billions-to-trillions-depending-on-design/
2•vinnyglennon•20m ago•1 comments

ACP

https://sidequery.dev/blog
2•nicoritschel•21m ago•0 comments

Markdown Babel: execute source code blocks in your editor like Emacs org-mode

https://md-babel.org
1•ctietze•21m ago•1 comments