I'd like to parse some plan JSON into the structures that Jarl provides -- without actually evaluating it. However, it fails:
bb.edn
{:deps {boregby/jarl
{:git/url "https://github.com/borgeby/jarl.git"
:deps/root "core"
:sha "f20a80c599e0a482900ea3889a0b2fa3eab39681"}}}
test
#!/usr/bin/env -S bb
(require '[babashka.process :refer [process shell]]
'[jarl.parser :as parser])
(defn plan []
(-> (apply shell {:out :string} "irdump" "-f" *command-line-args*)
:out))
(let [plan-out (plan)
p0 (parser/parse-json plan-out)]
(prn p0))
I don't know if that script would actually work, because it fails early:
% ./test foo.rego x/p
----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: Unable to resolve classname: java.security.KeyFactory
Location: /Users/stephan/.gitlibs/libs/boregby/jarl/f20a80c599e0a482900ea3889a0b2fa3eab39681/core/src/main/cljc/jarl/builtins/crypto.cljc:9:3
----- Context ------------------------------------------------------------------
5: #?(:clj [clojure.string :as str])
6: #?(:cljs [goog.crypt :as crypt]))
7: #?(:cljs
8: (:import (goog.crypt Md5 Sha1 Sha256 Sha512 Hmac)))
9: #?(:clj
^--- Unable to resolve classname: java.security.KeyFactory
10: (:import (javax.crypto.spec SecretKeySpec)
11: (javax.crypto Mac)
12: (java.security MessageDigest KeyFactory Key)
13: (org.jose4j.jwk JsonWebKey$Factory JsonWebKey$OutputControlLevel)
14: (java.security.spec PKCS8EncodedKeySpec)
----- Stack trace --------------------------------------------------------------
jarl.builtins.crypto - /Users/stephan/.gitlibs/libs/boregby/jarl/f20a80c599e0a482900ea3889a0b2fa3eab39681/core/src/main/cljc/jarl/builtins/crypto.cljc:9:3
jarl.builtins.registry - /Users/stephan/.gitlibs/libs/boregby/jarl/f20a80c599e0a482900ea3889a0b2fa3eab39681/core/src/main/cljc/jarl/builtins/registry.cljc:2:3
jarl.parser - /Users/stephan/.gitlibs/libs/boregby/jarl/f20a80c599e0a482900ea3889a0b2fa3eab39681/core/src/main/cljc/jarl/parser.cljc:2:3
user - /Users/stephan/Scratch/bb-diff/./test:2:1
I'd like to parse some plan JSON into the structures that Jarl provides -- without actually evaluating it. However, it fails:
bb.edn{:deps {boregby/jarl {:git/url "https://github.com/borgeby/jarl.git" :deps/root "core" :sha "f20a80c599e0a482900ea3889a0b2fa3eab39681"}}}testI don't know if that script would actually work, because it fails early: