Hi again, I think I managed to make it working with: $ slurmrestd -f /etc/slurm/slurmrestd.conf -a rest_auth/jwt -s openapi/v0.0.36 -vvv 0.0.0.0:6820
Sample request: $ curl -H "X-SLURM-USER-NAME:riggi" -H "X-SLURM-USER-TOKEN:${SLURM_JWT}" http://localhost:6820/slurm/v0.0.36/ping { "meta": { "plugin": { "type": "openapi\/v0.0.36", "name": "REST v0.0.36" }, "Slurm": { "version": { "major": 20, "micro": 5, "minor": 11 }, "release": "20.11.5" } }, "errors": [ ], "pings": [ { "hostname": "XXXX", "ping": "UP", "status": 0, "mode": "primary" } ] where SLURM_JWT was generated with: $ scontrol token lifespan=7200 username=riggi How can I configure and test the other auth method (local)? I am using jwt at the moment. I would like a user to be always authorized to use the rest API. Thanks, Simone **************************************************************** Simone Riggi, PhD INAF, Osservatorio Astrofisico di Catania Via S. Sofia 78 95123, Catania - Italy phone: +39 095 7332 extension 282 (or 310) e-mail: simone.ri...@gmail.com, sri...@inaf.it <sri...@oact.inaf.it>, sri...@pec.it <simone.ri...@ct.infn.it> skype: simone.riggi **************************************************************** On Thu, 8 Apr 2021 at 21:15, Simone Riggi <simone.ri...@gmail.com> wrote: > Ok, > I think I have found the plugins in: > > /root/rpmbuild/BUILD/slurm-20.11.5/src/slurmrestd/plugins/openapi/ > > I did: > > make > make install > > and now I have: > > $ slurmrestd -s list > slurmrestd: Possible OpenAPI plugins: > slurmrestd: openapi/v0.0.35 > slurmrestd: openapi/v0.0.36 > slurmrestd: openapi/dbv0.0.36 > > Last one is not working: > > $ slurmrestd -f /etc/slurm/slurmrestd.conf 0.0.0.0:6820 -a jwt -s > openapi/dbv0.0.36 > slurmrestd: fatal: slurm_openapi_p_init: slurm not configured with slurmdbd > > The second one is apparently running but I do not see any logs: > > $ slurmrestd -f /etc/slurm/slurmrestd.conf 0.0.0.0:6820 -a jwt -s > openapi/v0.0.36 > > Besides I have no idea at the moment of what plugins to choose and what > they do. > How can I test (e.g. an endpoint with curl) if the rest API is working > including authentication? > > Cheers, > > Simone > > > **************************************************************** > Simone Riggi, PhD > INAF, Osservatorio Astrofisico di Catania > Via S. Sofia 78 > 95123, Catania - Italy > phone: +39 095 7332 extension 282 (or 310) > e-mail: simone.ri...@gmail.com, > sri...@inaf.it <sri...@oact.inaf.it>, > sri...@pec.it <simone.ri...@ct.infn.it> > skype: simone.riggi > **************************************************************** > > > On Thu, 8 Apr 2021 at 20:47, Simone Riggi <simone.ri...@gmail.com> wrote: > >> Thanks very much. >> I found both files under: >> >> >> /root/rpmbuild/BUILD/slurm-20.11.5/src/slurmrestd/plugins/auth/jwt/.libs/rest_auth_jwt.so >> >> /root/rpmbuild/BUILD/slurm-20.11.5/src/slurmrestd/plugins/auth/local/.libs/rest_auth_local.so >> >> It seems they weren't installed (any hints why?). By the way I tried to >> copy both in the /usr/lib64 and now slurmrestd returns: >> >> $ slurmrestd -a list >> slurmrestd: Possible REST authentication plugins: >> slurmrestd: rest_auth/local >> slurmrestd: rest_auth/jwt >> >> However when I try to run it (slurmrestd -a rest_auth/local or slurmrestd >> -a rest_auth/local) I get: >> >> slurmrestd: fatal: No OAS plugins to load. Nothing to do >> >> Some other plugins to be built and installed? >> >> Thanks again, >> >> Simone >> >> >> **************************************************************** >> Simone Riggi, PhD >> INAF, Osservatorio Astrofisico di Catania >> Via S. Sofia 78 >> 95123, Catania - Italy >> phone: +39 095 7332 extension 282 (or 310) >> e-mail: simone.ri...@gmail.com, >> sri...@inaf.it <sri...@oact.inaf.it>, >> sri...@pec.it <simone.ri...@ct.infn.it> >> skype: simone.riggi >> **************************************************************** >> >> >> On Thu, 8 Apr 2021 at 17:07, Ward Poelmans <ward.poelm...@vub.be> wrote: >> >>> Hi Simone, >>> >>> On 8/04/2021 15:53, Simone Riggi wrote: >>> >>> > - I see effectively that --with jwt is not listed. I wonder how to >>> build >>> > (using rpmbuild) slurm auth plugins? >>> > In general I didn't understand from the doc what plugins slurmrestd >>> > expects by default and where it searches it. From -a option it seems it >>> > searches libraries inside a directory rest_auth/[PLUGIN_LIB_NAME]. But >>> > it seems these plugins are not built by rpmbuild or are not installed >>> or >>> > are installed in a non-standard directory. >>> >>> I see 'slurmrestd -a list' do stat on all libraries under >>> /usr/lib64/slurm and it opens two files: >>> /usr/lib64/slurm/rest_auth_local.so >>> /usr/lib64/slurm/rest_auth_jwt.so >>> >>> Both of these come from the slurm RPM in my case >>> (slurm-20.11.5-1.el7.x86_64) >>> >>> Ward >>> >>>