Hacker News new | past | comments | ask | show | jobs | submit | more jon_richards's comments login

Not OP, but https://cloud.google.com/blog/products/api-management/restfu...

The problem is that clients generally have a bunch of verbs they need to do. You have to design your objects and permissions just right such that clients can do all their verbs without an attacker being able to PATCH "payment_status" from "Requires Payment" to "Payment Confirmed".

RPC uses verbs, so that could just be the SubmitPayment RPC's job. In REST, the correct design would be to give permission to POST a "Payment" object and base "payment_status" on whether that has been done.


This is the most painful bit of REST for sure.


I've been having fun with connectrpc https://connectrpc.com/

It fixes a lot of the problematic stuff with grpc and I'm excited for webtransport to finally be accepted by safari so connectrpc can develop better streaming.

I initially thought https://buf.build was overkill, but the killer feature was being able to import 3rd party proto files without having to download them individually:

    deps:
      - buf.build/landeed/protopatch
      - buf.build/googleapis/googleapis

The automatic SDK creation is also huge. I was going to grab a screenshot praising it auto-generating SDKs for ~9 languages, but it looks like they updated in the past day or two and now I count 16 languages, plus OpenAPI and some other new stuff.

Edit: I too was swayed by false promises of gRPC streaming. This document exactly mirrored my experiences https://connectrpc.com/docs/go/streaming/


> It fixes a lot of the problematic stuff with grpc and I'm excited for webtransport to finally be accepted by safari so connectrpc can develop better streaming.

We developed a small WebSocket-based wrapper for ConnectRPC streaming, just to make it work with ReactNative. But it also allows us to use bidirectional streaming in the browser.


Awesome! Could you share? I also use react native.


https://gist.github.com/Cyberax/3956c935a7971627e2ce8e2df3fa...

I'll do a proper write-up in a couple of days.


It still uses protocol buffers though, which is where many of the problems I have with gRPC comes from


The auto-generated SDKs are very useful here. An API customer doesn't have to learn protobuf or install any tooling. Plus they can fall back to JSON without any fuss. Connectrpc is much better at that than my envoy transcoder was.

If you're thinking from the API author's point of view, I might agree with you if there was a ubiquitous JSON annotation standard for marking optional/nullable values, but I am sick of working with APIs that document endpoints with a single JSON example and I don't want to inflict that on anyone else.


It doesn't use protocol buffers any more than gRPC does, which is to say it only uses them if you choose to use them. gRPC is payload agnostic by design. Use CSV if you'd rather. It's up to you.


You can also choose to use JSON instead. Works great with curl and browser dev tools.


Is there recent news on safari supporting webtransport?


I think it's become an industry term. This isn't the first article or product I've seen using it to refer to a 3d printed object that reversibly transforms without mechanical input.


Is there any link to “ace” meaning a tennis serve that the defending player fails to make any contact with? I could see the parallel with a “cheese” strategy being an unexpectedly fast attack.


I suspect the link is with playing cards and gambling?


I like the theory of traffic that basically says traffic will always make the best mode of transportation as bad as the second best.

The problem with buses is that car traffic can never be bad enough to make cars worse than buses. Buses are doomed to always be worse than cars unless they have dedicated lanes or parking is unbearable. So cars slow down to equal the metro system, bikes, ferries, etc.

A dedicated bus lane can speed up cars more than another car lane because it pulls traffic off the road until driving convenience equals bus convenience.


I’d say a cherry picked example is backed by random chance (possibly counter to the trend) while a poster child example has an explanation (not necessarily correct) for being the most sensitive to the variable being changed.


Much of Europe seems to do fine orienting their consumption and recycling around glass (including wash+reuse). I was surprised I didn’t even see aluminum recycling because it was so rare to see a can.


Unfortunately our DNA is also in excel. Several genes had to be renamed because they kept being identified as dates.


Excellent


Yeah. A round-trippable comment is just another text field. Leave that to the application.

It’s unfortunate how many APIs are documented with a single json example, but annotating them with comments (and maybe types?) would help immensely.


I believe there was a study that showed a mix of behaviors because populations with cooperative individuals out-compete in plentiful times and selfish individuals out-compete in scarce times. Hard to Google now because of selfish gene theory.


D.S. Wilson did a lot of work in that area.


Yes, especially his A theory of group selection https://pmc.ncbi.nlm.nih.gov/articles/PMC432258/


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: