meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
Alex Whitt 2021-06-16T15:57:50.050100Z

Hey guys. How do you think Meander would fare as the core of an authentication system? To my understanding, you're basically trying to match against a pattern when deciding whether or not access to something is authorized: "if the user's domain and the target domain are the same, AND the user's permissions level is this or that, OR the user ID is present in a database of special conditions and those conditions match what's trying to be accessed, THEN return true." Do you think matching is the right tool for this domain?

noprompt 2021-06-17T17:21:49.051400Z

@alex.joseph.whitt If you’re comfortable looping others in for feedback/support, drop a gist, etc. πŸ‘

markaddleman 2021-06-17T17:26:05.051600Z

One additional bit: Most of my "over matching" problems are due to inappropriate use of m/$ . I start out thinking, recursively matching will save me a bunch of typing. I end up thinking, why did I ever think that was a good idea!

πŸ˜‚ 2
noprompt 2021-06-17T17:36:03.051900Z

I love m/$ for rummaging through data I’m unfamiliar with.

markaddleman 2021-06-17T17:40:15.052100Z

I've thought about an extension to m/$ that indicates a "recurse no deeper" pattern

markaddleman 2021-06-17T17:40:30.052300Z

something like the top-down-until strategy

πŸ‘ 1
noprompt 2021-06-17T17:43:45.052600Z

Yes!

markaddleman 2021-06-16T16:37:33.050200Z

I can't speak directly to the authentication domain but I have used meander very successfully for complex pattern matching such as rewriting SQL (in honey format)

markaddleman 2021-06-16T16:38:38.050400Z

I'd be careful of ordering meander match clauses to ensure that you don't end up inadvertently matching and thus granting access with you shouldn't.

πŸ‘ 1
markaddleman 2021-06-16T16:39:34.050600Z

If your data structure is complex, this can be a bit hard to get exactly right. However, if the data structure is straightforward (even if it is recursive), meander is good fit

Alex Whitt 2021-06-16T16:47:05.050800Z

I'll try a POC and see how it looks

Alex Whitt 2021-06-16T16:47:14.051Z

I think our data is on the simple end of the spectrum