Fork me on GitHub
#nrepl
<
2018-09-28
>
dominicm05:09:58

Thinking about it, I strongly agree with you that it should be middleware. However the dependency system poses a problem for that approach. I don't have a good idea that I like though.

bozhidar06:09:23

@dominicm I think if it’s just the root of all deps that should work out pretty well in practice. On server boot we can set some flag that controls the behaviour of the middleware and makes it do something or nothing. But I haven’t thought that much about this either.

dominicm06:09:22

@bozhidar the root of all deps?

bozhidar07:09:51

@dominicm The root of the middleware stack - every middleware would expect the auth middleware to be present.

bozhidar07:09:34

Generally that’s not really needed - I guess we’re mostly concerned about securing eval-type operations.

dominicm08:09:57

That makes sense. But conflates authentication with authorization.

dominicm08:09:23

I guess the auth middleware could evaluate the request statically and determine whether it's safe.

dominicm08:09:01

Is it possible to add dependencies as a user, as opposed to an author of middleware. I think that would be important.

bozhidar13:09:35

> That makes sense. But conflates authentication with authorization. Yep, that’s true. Anyways, that’s why I asked for more people to share some feedback - I certainly don’t know what’s the optimum course of action, but I feel that anything will be an improvement over no security at all. 🙂

dominicm15:09:23

So, if we make this middleware, the world needs to go out and decide whether it's middleware needs to depend on auth. Conditional on being able to extend the dependencies and authorization of an op as a user, that seems fine. Separating authentication and authorization seems like a good pre emptive strike, particularly for us as we would want to inspect responses for particular values and block them under certain conditions (e.g. Breakglass)

bozhidar16:09:35

> So, if we make this middleware, the world needs to go out and decide whether it’s middleware needs to depend on auth.

bozhidar16:09:50

That’s true, but the same applies for some very basic things even now - e.g. sessions.

bozhidar16:09:29

One can argue they should always be present, but since they are middleware it’s up to middleware authors to decide how to leverage them.

bozhidar16:09:49

> Separating authentication and authorization seems like a good pre emptive strike, particularly for us as we would want to inspect responses for particular values and block them under certain conditions (e.g. Breakglass)

bozhidar16:09:02

Btw, what when you talk about authorization you’re mostly talking about making sure people don’t execute some insecure code, right? Because if we go with a simple authentication scheme with no permissions attached to it then there won’t be much to check for when it comes to authorization.

dominicm16:09:10

I would personally probably build something on a claim system that my authorization system would then check.

bozhidar16:09:34

I don’t understand what you mean. Can you elaborate on this?

dominicm22:09:01

You get claims to certain functionality in production. Perhaps evaluations from a predefined set, or just refresh. That would encode into the token along with an expiration and a signature.