5 ms·
Here you go, <120 loc: https://github.com/bottledcode/durable-php/blob/v2/cli/auth/user.go https://github.com/bottledcode/durable-php/blob/v2/cli/auth/...
by withinboredom 3y ago
Here you go, <120 loc: https://github.com/bottledcode/durable-php/blob/v2/cli/auth/user.go https://github.com/bottledcode/durable-php/blob/v2/cli/auth/...
- samjs 3y agoThat's a really clean implementation. And the shares are used to resolve authorization here [1], right? Two things that we're solving for at Oso is: making it easier for multiple teams to collaborate on permissions (which we solve by having a declarative language), and solving the list filtering problem (as talked about in the post). If you don't need either of those two things and are happy with a DIY approach, what you've shared would work great IMO. If you packaged that up as a standalone solution, I could see a lot of people getting value from it! There are not enough people sharing authz implementations out there, a blog post on this shares approach would be super cool. [1] https://github.com/bottledcode/durable-php/blob/3ad509fcdbb3feeebd4b2993b1fd959159ff2179/cli/auth/resource.go#L230-L270 https://github.com/bottledcode/durable-php/blob/3ad509fcdbb3...
- withinboredom 3y ago> And the shares are used to resolve authorization here [1], right? That's correct! > making it easier for multiple teams to collaborate on permissions (which we solve by having a declarative language), and solving the list filtering problem (as talked about in the post). Those are pretty hard problems, so it's really cool to see someone solving it in a reusable way! For me, authz is always a chore ... making it something easy to specify in a way that "just works" is worth quite a bit in my mind! > If you packaged that up as a standalone solution, I could see a lot of people getting value from it! I don't really have much desire to get into maintaining an auth library; there's just not enough time in the day! > a blog post on this shares approach would be super cool. It's pending publish, actually! I've got a devlog (more like a book at this point) for something I've been working on for years now, but no posts are going to be published until I hit a milestone. I'm almost there... not much further.
- samjs 3y ago> I don't really have much desire to get into maintaining an auth library; there's just not enough time in the day! Haha, well in some ways I'm glad to hear that. That's why we exist :) > It's pending publish, actually! I've got a devlog (more like a book at this point) for something I've been working on for years now, but no posts are going to be published until I hit a milestone. I'm almost there... not much further. Send it over if you want another pair of eyes, and lmk when publishing so we can share with our community too. I'm sam [at] osohq.com
- sakopov 3y agoJudging by the name of supported operations it looks like this is built around a type of CQRS pattern. Am I reading this right? Is it possible grant granular operations like a specific type of read or write for an entity?
- withinboredom 3y agoIndeed. It is CQRS with some ES in there (for sagas/workflows). Right now, granularity is pretty granular but it could be more granular. For example, there is a concept of serialization scopes that I’m barely using. But it would be possible to (and fairly trivial) to use this to prevent serialization of the entity snapshot for certain properties. This would give the illusion (especially in the graphql projection) that an entity was “missing” fields. From a consumer aspect, it might mean that you can’t call certain methods. Already, the granularity may allow you to call a method and not be able to see its result, for example. It’s pretty neat … but this is also a reminder of sooo much left to document.