I have a server which makes some interface available through engines. The entire server sits behind an nginx which secures it with basic Authentication. Now I trye to make a pengine_rpc call over the public internet – of course this fails with
pengine_rpc/3 passes its options to pengine_create/1, which passes its options to http_open/3. That has an authorization option that supports basic, digest and bearer authentication.
Thanks Jan for the quick answer! It would be a clever solution, but it doesn’t seem to work, because the authorization isn’t passed to pengines:probe. Trace with a spy point on pengines:remote_post_rec/5:
What version are you using? Here, pengines:probe has 3 arguments and passes the options. git blame tells me this is fixed in 437a17c98dc47ed0a4e51c777c0536bd742010b7 by Pieter Van den Abeele on Aug 21 00:25:05 2024. Seems you need 9.2.7 or 9.3.10 or later for that.
Oh you are right. I was on 9.0.4, you are way ahead of me, thanks again!
Side note: The 64bit Windows installer did not add swipl to the PATH (for all users) on either of two machines I used it, even though I checked the checkbox. I am confident that this worked with earlier versions.
Can I make my pengines app handle requests on <server>/services/pengine/create instead of <server>/pengine/create? The client can handle this, but I don’t know how to configure it in the server – I only do :- use_module(library(pengines)) in a normal HTTP server.
Ok, that doesn’t work in my case because I have multiple prefixes in this server. I could restructure it, but it doesn’t matter, I’ll just accept /pengine in nginx. All working fine now, thanks!
I pushed a patch that allows changing the HTTP path alias pengine. Should be in tomorrows daily build of the development version. 9.0.4 to 9.3.18+ is a jump