frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

A Django rest API key package

https://github.com/koladev32/drf-simple-apikey
1•koladev32•1d ago

Comments

koladev32•1d ago
Hey everyone, I've been working on some projects using Django for about five years now. But when I discovered DRF, I've decided to focus on building backend API applications without dealing much with the frontend. But about a year or two ago, I started to build APIs for some SaaS projects, and I realized I needed a robust API key management system.

I initially used https://github.com/florimondmanca/djangorestframework-api-ke... which is fantastic and has everything you need for API key systems, including great authorization and identification based on Django's password authentication system. I will say this library shines if you only need API keys for permissions and nothing more. However, when I wanted to push the package further, I hit some limitations. I needed features like key rotation, monitoring, and usage analytics to help with billing per request and permissions and better performances as the package use passwords hashing algorithms to create api keys.

So, I decided to create my own package. I've been working on it for about nine months to a year now, and it's come a long way. Here are some of the key features:

- Quick Authentication and Permission System: You can easily implement authentication and permissions, for example, for organizations or businesses.

- Monitoring and Analytics: There's a built-in application to track the usage of API keys per endpoint and the number of requests made, which is great for billing or security measures.

- API Key Rotation: This feature took some time to perfect. Because the package use Fernet to encrypt and decrypt the api keys, you can smoothly rotate API keys. If you have a leak, you can start using a new Fernet key while phasing out the old one without any service interruption. You can choose between automatic and manual rotation. The old Fernet key will be used to decrypt api keys, while the new Fernet key will be used to encrypt new api keys. This gives you time to send messages about an ongoing key migration to your users. https://cryptography.io/en/latest/fernet/#cryptography.ferne...

The package is currently at version 2.2.1. I initially released version at 1.0 in the beginning, but quickly realized I should have started with a lower version number. I'm continuously working on improvements, mostly on versioning. For instance, typing is not yet fully implemented, and I'm working on enhancing the documentation using Nextra in the next few weeks.

I'm looking for feedback to make this package even better. Whether it's about security measures, missing features, or any other suggestions, I'd love to hear from you. You can find the package https://github.com/koladev32/drf-simple-apikey. Thanks for your time and any feedback you can provide!

Fuck Digital Minimalism and Every Sanctimonious Blog Post That Comes with It

https://digitallynick.bearblog.dev/fuck-digital-minimalism-and-every-sanctimonious-blog-post-that-comes-with-it/
1•Tomte•50s ago•0 comments

Restoring Control over the Immigration System: Technical Annex [pdf]

https://assets.publishing.service.gov.uk/media/6821b49bdb6463b14cd8189c/restoring-control-over-the-immigration-system-technical-annex.pdf
1•susam•2m ago•0 comments

Fixing Bad Charts: EV Acceleration as a Function of Battery Charge Level

https://conormclaughlin.net/2025/05/fixing-bad-charts-ev-acceleration-as-a-function-of-battery-charge-level/
1•speckx•2m ago•0 comments

Git GPT Commit

https://github.com/laststance/git-gpt-commit
1•ryotamurakami•3m ago•1 comments

Backblaze Drive Stats for Q1 2025

https://www.backblaze.com/blog/backblaze-drive-stats-for-q1-2025/
1•HieronymusBosch•6m ago•0 comments

Why OpenAI Spent $3B on a VS Code Fork

https://www.youtube.com/watch?v=y__FNi7klwM
1•barelythinking•7m ago•0 comments

Bill Gates's vision for the future of the PC, c1980 – er, Xenix (2002)

https://www.theregister.com/2002/03/20/bills_vision_for_the_future/
1•TMWNN•8m ago•0 comments

UK's Marks and Spencer confirms customer data taken in ransomware attack

https://www.reuters.com/business/retail-consumer/uks-ms-says-customer-information-was-taken-cyber-attack-2025-05-13/
3•bit_qntum•8m ago•0 comments

Fastino raises $17.5M to train small AI models on cheap gaming GPUs

https://techcrunch.com/2025/05/07/fastino-trains-ai-models-on-cheap-gaming-gpus-and-just-raised-17-5m-led-by-khosla/
3•byte-bolter•9m ago•0 comments

Yes, Doctors: AI Will Replace You [video]

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

Can APIs be beautiful?

https://sideko.dev/empathetic-engineer/can-apis-be-beautiful
1•pmkelly4444•14m ago•0 comments

Ezra Klein and Derek Thompson, Strangers in a Land

https://arcmag.org/ezra-klein-and-derek-thompson-strangers-in-a-strange-land/
1•conanxin•16m ago•0 comments

Show HN: Reaktiv – I built Excel-like reactive programming for Python

https://bui.app/when-frontend-reactivity-meets-backend-python-the-story-of-my-first-1-000-download-library/
1•buibuibui•16m ago•0 comments

MS makes another pitch for React Native in confusing world of Windows desktop

https://devclass.com/2025/05/12/microsoft-makes-another-pitch-for-react-native-in-confusing-world-of-windows-desktop-development/
1•rbanffy•17m ago•0 comments

AMD's Zen 5 Threadripper Pro 9000WX flagship CPUs confirmed in official listing

https://hothardware.com/news/amd-ryzen-threadripper-pro-9000wx-zen-5-cpus-confirmed
3•gray_amps•18m ago•0 comments

DJI is skipping the US with its most advanced drone yet

https://www.theverge.com/tech/665418/dji-mavic-4-pro-no-us-launch-specs-price-release-date
2•RobertTheNerd•20m ago•0 comments

Cape opens beta of its privacy-first mobile plan, inks Proton deal, raises $30M

https://techcrunch.com/2025/03/19/cape-opens-99-month-beta-of-its-privacy-first-mobile-plan-inks-proton-deal-raises-30m/
1•nateb2022•21m ago•0 comments

Linux on 8" Mini Laptop

https://www.zdnet.com/article/i-installed-linux-on-this-8-inch-mini-laptop-and-its-my-new-favorite-way-of-computing/
3•ultramann•21m ago•0 comments

Solid oxide electrolysis cell enables super-dry reforming of methane

https://phys.org/news/2025-04-solid-oxide-electrolysis-cell-enables.html
1•PaulHoule•21m ago•0 comments

Gitlab for Open Source Program Agreement

https://handbook.gitlab.com/handbook/legal/opensource-agreement/
1•lolinder•21m ago•1 comments

One of the Good Ones

https://mssv.net/2025/05/13/one-of-the-good-ones/
1•adrianhon•22m ago•0 comments

TheForger's Win32 API Tutorial

https://winprog.org/tutorial/
2•xeonmc•24m ago•0 comments

We Built a 7-Figure AI Consulting Business in Less Than a Year

https://every.to/p/how-we-built-a-7-figure-ai-consulting-business-in-less-than-a-yea
1•rbanffy•25m ago•0 comments

Tether's $150B CIO Proved Himself Getting Cantor Backing

https://www.bloomberg.com/news/articles/2025-05-13/tether-s-150-billion-managed-by-unknown-brit-in-the-bahamas-usdt
2•wslh•28m ago•1 comments

AMD Ryzen to the low-end enterprise: strategy is badge engineering at its best

https://www.theregister.com/2025/05/13/amd_epyc_4005/
1•rntn•28m ago•0 comments

MCP and A2A Form the Invisible Operating System of the Autonomous AI Future

https://www.decodingdiscontinuity.com/p/agentic-era-part-2-how-the-architectural
1•ChrisInFrance•29m ago•0 comments

The fractal nature of scientific revolutions (2005)

https://statmodeling.stat.columbia.edu/2005/05/20/selfsimilarity/
2•Tomte•34m ago•0 comments

"The Great Gatsby" Took over High School

https://www.newyorker.com/books/page-turner/how-the-great-gatsby-took-over-high-school
1•pseudolus•38m ago•1 comments

DJI Mavic 4 Pro review: A new standard for consumer drones

https://www.engadget.com/cameras/dji-mavic-4-pro-review-a-new-standard-for-consumer-drones-120006235.html
2•xnhbx•40m ago•1 comments

Ciguatera Fish Poisoning: Treatment, Prevention and Management

https://www.mdpi.com/1660-3397/6/3/456
1•teleforce•41m ago•0 comments