clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
2021-01-11T02:23:17.480200Z

The Sun stays at the horizon?

slipset 2021-01-11T06:07:45.480700Z

Morning!

ordnungswidrig 2021-01-11T07:28:57.480900Z

Good morning!

djm 2021-01-11T07:35:09.481200Z

šŸ‘‹

dharrigan 2021-01-11T07:44:50.481400Z

Good Morning!

orestis 2021-01-11T08:05:28.481600Z

Good morning

slipset 2021-01-11T08:14:58.483400Z

Some of the great things about doing my commute to work on a stationary bike is that: 1. I can adjust the length of the commute 2. The weather is quite constant 3. Taking the subway instead is not an option

simongray 2021-01-11T08:15:42.483600Z

morning

slipset 2021-01-11T08:18:39.486300Z

Ah, @simongray. It reminds me that we were discussing SAML/OAuth/stuff on Friday. Hereā€™s some general and unsolicited advice: At Ardoq the authorization code has always been something weā€™ve been scared to touch. Simply because, at the end of the day, itā€™s integration code (which makes it hard to test end to end), and to make things worse, itā€™s integration code which integrates to systems we donā€™t have access to. This means that any change done to this code has been done in the most defensive/intrusive manner, which, in my experience, tends to lead to quite messy code. Which means that over time, this code became scarier and scarier, and harder and harder to understand. So, my advice is, make sure this code is well tested, in a black-box kind of way, eg, understand the oauth/saml protocol, write a mock implementation of an oauth idp (to the best of your knowledge) and write tests that use the mock implementation to drive your oauth tests. Same for SAML. Also, take your time to make this code really pristine and understandable, since it will be with you for a long time, and the consequences of introducing errors in this code leads to customers not being logged in. At best.

1
simongray 2021-01-11T08:42:06.000300Z

@slipset thanks for the advice. I did code the whole thing up against a mock IdP (the same used in this example code: https://github.com/quephird/saml-test), so I guess I could write some kind of integration test involving a web driver and that IdP, if I can find the time. Anyway, to me that auth code isnā€™t all that scary right now, but I get that it definitely can become so if I revisit it after a long time. I definitely wonā€™t have time to make a mock IdP myself this time around. My time is severely limited by budgetary constraints - thatā€™s just how it is in academia. The thing is, in this job Iā€™m kind of expected to be a one-man army working on several projects at multiple levels. So I do both ops stuff of existing systems, as well as everything - and by that I mean everything from setting up servers to doing research to system architecture to graphic design to writing all of the code - on new systems. And I work 3 projects at the same time + have my first child coming in a few weeks. It does have the advantage that I get to make all of the decisions and the advantage that I know all of the code intimately (since I wrote all of it). If I feel stressed about my current workload, I just close my eyes and think of what it was like working at my old job (the same huge government project @ordnungswidrig is onā€¦ unless he moved to some other project in the meantime).

slipset 2021-01-11T08:50:15.000800Z

You probably donā€™t have to go all the way to webdrivers and such. Iā€™m assuming you have a rest api, (and probably using ring?) so your top-level handler is just a fn that expects a request-map and returns a response map. And for your saml code, this fn will be called twice. Once as a get (which will return a redirect response (where you can verify that youā€™ve got all the bits and bobs correctish (wrt to all the stuff that should be in such a redirect), and the second time it will be called as a post in which it should return an authenticated user or nil.

2021-01-11T08:56:40.001100Z

morning

thomas 2021-01-11T08:59:41.001300Z

morning

2021-01-11T09:00:34.002Z

is there a clojure tool that will take a rest spec or WSDL and turn it into clojure.spec to do generative testing?

2021-01-11T09:00:49.002400Z

I've seen things that go the other way (spec to JSON schema for example)

simongray 2021-01-11T09:05:24.002500Z

I guess thatā€™s more in the unit test-like area then. Iā€™ll definitely try to test the pedestal interceptors independently šŸ™‚

2021-01-11T09:59:57.004Z

Do you want specs that you can reuse in clojure for some other purpose, or do you just want to generate test cases for a given WSDL? I'm certain I've seen tools for the latter in the java/GUIs world

borkdude 2021-01-11T10:05:46.004400Z

@otfrom Maybe there are tools for JSON schema for generative testing already?

borkdude 2021-01-11T10:07:17.004800Z

(a quick google confirms the hypothesis)

2021-01-11T10:48:16.005500Z

I'm mostly thinking about things like the SAML problem above and how to do the best testing on that. spec is supposed to be solving some of those problems

2021-01-11T10:48:26.005800Z

(so not an immediate requirement for me)

orestis 2021-01-11T11:30:29.008200Z

A major issue with all these SAML stuff is that itā€™s an open http endpoint with relatively complex payloads. So thereā€™s a big chance of things going wrong/DDOS/buffer overflows etc. A private advice I received from a well-respected, security-oriented member of the Clojure community is to try and outsource all that stack entirely to a 3rd-party vendor, but not Auth0. Cognito is a safe choice.

djm 2021-01-11T11:39:42.009200Z

Why not auth0? (At work we use Keycloak, fwiw)

pez 2021-01-11T11:48:30.009800Z

Iā€™d also like to hear about why not auth0.

borkdude 2021-01-11T11:49:44.010200Z

Made a thing yesterday: https://github.com/borkdude/plsci šŸ˜Ž

šŸŽ‰ 1
orestis 2021-01-11T12:01:25.011500Z

I donā€™t recall much details, as far as I understood something is fundamentally ā€œoffā€ in the way Auth0 implement their ā€œflowā€, with respect to security.

orestis 2021-01-11T12:02:07.012200Z

But Iā€™ve never used it nor do I have any context, but the advice was very emphatic šŸ™‚

orestis 2021-01-11T12:02:33.012500Z

@borkdude thatā€™s crazy šŸ™‚

raymcdermott 2021-01-11T16:00:47.013Z

morning

kardan 2021-01-11T17:58:23.015800Z

At work we used to do openid connect using Keycloak but migrated to auth0 to not have to host the Keycloak servers

kardan 2021-01-11T17:58:31.016100Z

Works fine for us

orestis 2021-01-11T18:25:03.017700Z

Is keycloak onerous to administer? Itā€™s one of the contenders together with CAS for a ā€œservice-likeā€ approach.

javahippie 2021-01-11T19:19:02.019700Z

Have started building an app on Keycloak, but am migrating to Auth0 in an early stadium now. Iā€™d need to host and maintain my own keycloak including databases, redundant and failover-safe. This is obviously the most sensitive part of the infrastructure, and I canā€™t risk it going down or being insecure.

javahippie 2021-01-11T19:20:50.020600Z

Might not be all rational, but running this myself scares me, there are so many connections and internet-facing-things

javahippie 2021-01-11T19:22:36.021600Z

Itā€™s based on Wildfly, so itā€™s heavy weight (although they are working on a lighter Quarkus alternative), but configuration is mainly based in a single, some-hundred-line json file, so infrastructure-as-code works quite well