pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
dehli 2020-10-16T15:50:44.108200Z

Is there a standardized way to handle access control with pathom? i have an upstream resolver that checks for access but I’d like to prevent downstream resolvers from resolving for cases where access is restricted. I can do a runtime check in each resolver to see if the upstream resolved value is something like :access-denied but I’m curious if there’s something more baked into pathom (I couldn’t find anything when looking through the docs)

souenzzo 2020-10-16T15:57:02.108400Z

https://github.com/souenzzo/eql-style-guide/issues/4

1🎉
dehli 2020-10-16T15:57:19.108700Z

thanks!

souenzzo 2020-10-16T15:59:01.109Z

short answer: no, but we can build one 🙂

dehli 2020-10-16T16:01:19.109200Z

ya, that discussion helps a lot! appreciate it!

dehli 2020-10-16T18:45:23.112300Z

When I pass identity as {::pc/transform identity} to my defresolver I’m getting identity - failed: fn? Has anyone seen something similar? (I’m using alpha15) Edit: I think it’s a bug. I’ll get a test pushed up and see if I can trace it. Here’s the failing test: https://github.com/wilkerlucio/pathom/pull/176 and a potential fix.

wilkerlucio 2020-10-18T23:11:33.125600Z

thanks, I’ll check on it asap

1
dehli 2020-10-20T15:59:44.137900Z

My PR didn’t fully address the issue so I went ahead and closed it and will reopen when I get a better solution.

dehli 2020-10-20T16:01:37.138200Z

I believe the problem is that the spec is checking at compilation time rather than run time so to the compiler it’s just seeing transform as a symbol, persistentlist, etc.

wilkerlucio 2020-10-20T16:29:05.139Z

gotcha, makes sense, I'm doing a few tests here, I guess the solution is to move the validation into resolver instead of defresolver for the options map, this way validate on the realised values (instead of the macro stuff)

wilkerlucio 2020-10-20T16:33:11.139200Z

@dehli can you try alpha16-SNAPSHOT and see if that works as expected for you?

dehli 2020-10-20T16:36:43.139400Z

awesome! i’ll give that a shot!

dehli 2020-10-20T16:41:30.139600Z

Just confirmed that the bug is gone 👍 thanks for the help!

wilkerlucio 2020-10-20T16:42:31.139800Z

this was the change in case someone is curious: https://github.com/wilkerlucio/pathom/commit/c9292962b54c2ad2820a626a8c82522798fa40bf

dehli 2020-10-20T16:54:33.140Z

thanks! with it now being a runtime check should we wrap it with (when p.misc/INCLUDE_SPECS ?

wilkerlucio 2020-10-20T16:56:16.140200Z

I have a little concern with performance, but not much, unless someone is doing resolver generation on the fly all the time, this shouldn't be an issue, and for those cases the user can create the resolver without going though pc/resolver

wilkerlucio 2020-10-20T16:56:32.140400Z

the specs on connect are using guardrails to define, they don't check for p.misc/INCLUDE_SPECS

dehli 2020-10-20T17:11:21.140900Z

gotcha; thanks for the explanation!

wilkerlucio 2020-10-20T17:35:28.141100Z

no worries, and thanks for updating the issue

1👍