From 4d5ab14d78fbe9305f56bead350405846a888757 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 13 Sep 2024 23:12:05 +0100 Subject: bin: Support SLURM_JWT=token format in JWT files. * bin/ravanan: Import (srfi srfi-26) and (ravanan utils). (read-jwt): Support SLURM_JWT=token format. --- bin/ravanan | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/ravanan b/bin/ravanan index da7c625..1d08dc6 100755 --- a/bin/ravanan +++ b/bin/ravanan @@ -21,12 +21,14 @@ exec guile --no-auto-compile -e main -s "$0" "$@" ;;; along with ravanan. If not, see . (use-modules (rnrs io ports) + (srfi srfi-26) (srfi srfi-37) (ice-9 filesystem) (ice-9 match) (web uri) (json) (ravanan reader) + (ravanan utils) (ravanan workflow) ;; required to load manifest files @@ -90,9 +92,12 @@ Slurm API batch system options: program)) (define (read-jwt file) - "Read JWT token from @var{file}." + "Read JWT token from @var{file}. Support both files that only have the token and +files that have the token in the @verbatim{SLURM_JWT=token} format." (call-with-input-file file - get-string-all)) + (compose (cut string-trim-prefix "SLURM_JWT=" <>) + string-trim-both + get-string-all))) (define main (match-lambda -- cgit v1.2.3