I've built a lot of applications throughout my career.
And I've built authorization into them time after time.
And I've created half-baked abstractions for authorization way too often trying to refactor
countless if
statements littered throughout my pages, mutations, queries and UI components.
This has made maintenance troublesome, error-prone and time-consuming, when new features are added or especially when the authorization logic requires changing.
Many gray hairs, bugs, and stressful days later, I went looking for a solution.
But there was no solution right for me.
NPM was coming up dry, believe it or not. The few authorization libraries that exist are either too shallow, old, unmaintained or abandoned.
And all the good solutions are paid authorization-as-a-service products intended for much larger applications, not to mention existing authorization systems such as XACML, which are way too much for most web applications.
Kilpi was my solution to the problem.
I was aiming for a good abstraction and a good developer experience to solve my problems.
What started off as just another abstraction eventually became its own package in the monorepo until it evolved into a fully-fledged library.
Turns out, it's a great solution for this! Not only has it made authorization clearer and better in my applications, it has also allowed to change my authentication provider with minimal authorization logic changes.
Kilpi also helps fight security issues listed in the OWASP 2021 Top 10 Security Risks for Web Applications and CWE 2024 Top 25 Most Dangerous Software Weaknesses reports.
Not only was it fun to build and a joy to use to solve my own problems, I also wrote my master's thesis for Aalto University on Kilpi and authorization in the web.