Live data from Hacker News

We tried to make billing backendless

useautumn.com

11–20 of 43 posts

Re: We tried to make billing backendless

#11
I find this "backendless billing" approach fascinating because it highlights the tension between DX and security. As someone who's built payment systems, I understand the appeal of reducing backend boilerplate, but there's always a security tax to pay.

The real issue seems to be that they're trying to make billing "feel frontendish" when it's inherently a backend concern. The encryption approach in Part 3 is essentially recreating auth tokens but with extra steps, as others have noted - they're basically reinventing JWTs.

What struck me most was the security vulnerability they discovered with server actions. If you can make calls with any customer_id without verification, that's a textbook IDOR vulnerability. A simple curl request with a different customer_id would let you upgrade/downgrade other accounts! No amount of client-side magic can fix fundamentally flawed authorization.

Their conclusion is telling, sometimes the "boring" approach (proper backend routes with auth) exists for good reasons. I appreciate their transparency about the journey though, we learn more from these explorations than from pretending everything works perfectly from day one.

Re: We tried to make billing backendless

#12
post #5

I don't get it. If someone gets a hold of the encrypted customer ID, can't they impersonate the customer? Is it just that the customer ID is guessable?

That's true for now -- we definitely don't recommend using the encrypted customer ID as a fully secure method for auth, but implemented it more as a way for users to quick start without friction

1. This is also why we've built plugins for popular auth providers like Clerk, Better Auth and Supabase, which are called on the backend to fetch the user / org ID.

2. The encrypted customer ID is more of an experiment atm, and down the line if we continue working on it we might even build an auth system involving JWTs -- though that'd be reinventing the wheel and not something we're keen on

3. We are actually now working more on a framework agnostic pattern where users register a middleware on their backend which will spin up routes for Autumn, and the frontend provider contains a client which simply calls these routes

Re: We tried to make billing backendless

#13
post #3

I'm rather confused by this article - I've made products and pricing services, and just on the first line its said that billing requires webhooks and state syncing.. but why? Is it a way to utilize payments in an otherwise static site? Whats the benefit? You can absolutely accept payments without webhooks. Please help, I really don't understand the niche! I'm left with the sense that this is a sort of solution that's…

Yes you're right -- payments can definitely be done without webhooks, but it is typically all controlled server-side. Especially things like upgrade and downgrade flows, as they involve automatically charging a user's card.

What we were exploring is whether there's a way to do this securely from the frontend (eg on a pricing page) without needing to open up backend routes.

You're also correct that our niche is trying to control feature permissions, so that we can decouple pricing logic from an application (which makes it easier to handle pricing changes, custom plans etc). We are moving more towards a solution that just uses the JWTs to handle this instead of a customer_id.

Re: We tried to make billing backendless

#15

I find everything about web technology nowadays to be extremely obtuse. I am mostly an embedded/Linux driver engineer, but I think I know the basics of HTTP, REST APIs, Docker containers, how the web works overall etc. But, like. What are we doing? What do you mean make the billing backendless? Obviously there has to be a backend to process the payment. What are you even saying? You are presumably not building a dist…

Give yourself some credit here, I'm a web developer who works on billing systems and I also have no idea what it is that they mean. My best guess is that they're making a marketing message that they do not have a very particularly annoying workflow of a very particular billing integration (Stripe webhooks maybe?).

My problem is when you know that workflow, and that integration... you actually don't need it, its just nice to have. Its just a way for Stripe to send you updates to an endpoint with the status, like if say a card has declined as the charge is closing. But you can just poll.

Re: We tried to make billing backendless

#16

Like others, quite confused here. If it requires server actions, then it's not backendless? Just say you are simplifying the backend and how you interact with it, if that's what you are doing.

I intended to use backendless more as a figure of speech here. We wanted to make billing "feel" backendless.

Re: We tried to make billing backendless

#17
post #9

> Server actions are public, unauthenticated routes Why can't they be authenticated? That seems like the obvious fix. Otherwise how you are handing out the correct customer_id unless you authenticate somehow? This scheme also complicates API key rotation, although you can work around it by trying to decrypt with both the old and new key if you use e.g. authenticated encryption. This also has no mechanism for expirati…

Maybe we didn't phrase it as well as we should've. We meant to say API routes in general are public, and so the server actions could be called by anyone.

Authentication is definitely possible, but we were trying to brainstorm a way where users could have protected routes with as little set up as possible, the ideal being they just pass in customerId into a Provider component

We also did think about things like registering an auth function but felt that being able to just pass in customerId would be a magical experience!

Definitely acknowledge that the current mechanism has flaws though -- it's really more of an experiment at the moment, and if it does indeed become very popular with users we would implement auth mechanisms like JWT and what not -- though that would kinda be reinventing the wheel

Re: We tried to make billing backendless

#18
Reading the blog it seems the engineers there lack basic knowledge about safety (see their multiple different approaches where they learned "after the fact" that their approach wasn't secure)... this doesn't inspire a lot of safety

Re: We tried to make billing backendless

#19

Like others, quite confused here. If it requires server actions, then it's not backendless? Just say you are simplifying the backend and how you interact with it, if that's what you are doing.

I intended to use backendless more as a figure of speech here. We wanted to make billing "feel" backendless.

The title is lying then, hope the mods change it because I only clicked thinking it would be about something backendless and then it talks about one of the crappiest server frameworks available.

Re: We tried to make billing backendless

#20

Interesting how YC funds similar companies. useautumn looks a close competitor to another YC company getlago.

From a high level yes, but we are taking a very different route. They're very deep into usage-based billing and high throughput events, whereas we're more for early stage founders and "pricing in a box"
Post reply on HN