Skip to content

Commit

Permalink
Ensure (possibly updated) cmd type is assoc'd into final cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
cap10morgan committed Sep 12, 2022
1 parent e49237c commit 324fb5e
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 153 deletions.
154 changes: 77 additions & 77 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}
com.fluree/alphabase {:mvn/version "3.2.2"}
com.fluree/db {:git/url "https://github.com/fluree/db.git"
:sha "6b05ab1cd5ebb7d123bcaf8e903303998bf34474"}
com.fluree/raft {:mvn/version "1.0.0-beta1"}
com.fluree/crypto {:mvn/version "0.3.9"}

;; network comm
net.async/async {:mvn/version "0.1.1"}

;; Lucene
clucie/clucie {:mvn/version "0.4.2"}

;; AWS S3 API
com.cognitect.aws/api {:mvn/version "0.8.561"}
com.cognitect.aws/endpoints {:mvn/version "1.1.12.230"}
com.cognitect.aws/s3 {:mvn/version "822.2.1145.0"}

;; web server
http-kit/http-kit {:mvn/version "2.6.0"}
ring/ring-core {:mvn/version "1.9.5"}
ring-cors/ring-cors {:mvn/version "0.1.13"}
compojure/compojure {:mvn/version "1.7.0"}

;; logging
ch.qos.logback/logback-classic {:mvn/version "1.2.11"}

;; config
environ/environ {:git/url "https://github.com/cap10morgan/environ.git"
:sha "32682e865e8248d9df09643d6321ca4259fdbc19"
:deps/root "environ"}

;; retries
robert/bruce {:mvn/version "0.8.0"}}
{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}
com.fluree/alphabase {:mvn/version "3.2.2"}
com.fluree/db {:git/url "https://github.com/fluree/db.git"
:sha "6b05ab1cd5ebb7d123bcaf8e903303998bf34474"}
com.fluree/raft {:mvn/version "1.0.0-beta1"}
com.fluree/crypto {:mvn/version "0.3.9"}

;; network comm
net.async/async {:mvn/version "0.1.1"}

;; Lucene
clucie/clucie {:mvn/version "0.4.2"}

;; AWS S3 API
com.cognitect.aws/api {:mvn/version "0.8.561"}
com.cognitect.aws/endpoints {:mvn/version "1.1.12.230"}
com.cognitect.aws/s3 {:mvn/version "822.2.1145.0"}

;; web server
http-kit/http-kit {:mvn/version "2.6.0"}
ring/ring-core {:mvn/version "1.9.5"}
ring-cors/ring-cors {:mvn/version "0.1.13"}
compojure/compojure {:mvn/version "1.7.0"}

;; logging
ch.qos.logback/logback-classic {:mvn/version "1.2.11"}

;; config
environ/environ {:git/url "https://github.com/cap10morgan/environ.git"
:sha "32682e865e8248d9df09643d6321ca4259fdbc19"
:deps/root "environ"}

;; retries
robert/bruce {:mvn/version "0.8.0"}}

:paths ["src" "resources"]

:aliases
{:mvn/group-id com.fluree
{:mvn/group-id com.fluree
:mvn/artifact-id ledger
:mvn/version "1.0.4"
:mvn/version "1.0.4"

:dev
{:extra-paths ["dev", "test"]
Expand All @@ -49,52 +49,52 @@
{:extra-paths ["test" "test-resources"]
:extra-deps {com.cognitect/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "a85b3b02765fb68684ab9ee4a8598eacf7e471d2"}}
:sha "a85b3b02765fb68684ab9ee4a8598eacf7e471d2"}}
:exec-fn cognitect.test-runner.api/test}

:jar
{:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}}
:exec-fn hf.depstar/jar
:exec-args {:jar "target/fluree-ledger.jar"
:group-id :mvn/group-id
:artifact-id :mvn/artifact-id
:version :mvn/version
:sync-pom true}}
:exec-fn hf.depstar/jar
:exec-args {:jar "target/fluree-ledger.jar"
:group-id :mvn/group-id
:artifact-id :mvn/artifact-id
:version :mvn/version
:sync-pom true}}

:uberjar
{:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}}
:exec-fn hf.depstar/uberjar
:exec-args {:jar "target/fluree-ledger.standalone.jar"
:aot [fluree.db.server]
:main-class fluree.db.server
:group-id :mvn/group-id
:artifact-id :mvn/artifact-id
:version :mvn/version
:sync-pom true}}
:exec-fn hf.depstar/uberjar
:exec-args {:jar "target/fluree-ledger.standalone.jar"
:aot [fluree.db.server]
:main-class fluree.db.server
:group-id :mvn/group-id
:artifact-id :mvn/artifact-id
:version :mvn/version
:sync-pom true}}

:native-image
{:main-opts ["-m" "clj.native-image" "fluree.db.server"
"-H:Name=fluree-ledger" "--no-fallback"
"-H:+ReportExceptionStackTraces"
;; IncludeResources is pretty finicky. Lots of regexes I've tried don't
;; work and the logging the docs say you can turn on doesn't work.
;; So I'm just including everything for now. - WSM 2021/08/20
"-H:IncludeResources=.*"
"--enable-url-protocols=http,https"
"--enable-all-security-services"
"--report-unsupported-elements-at-runtime"
"--initialize-at-build-time"
"--allow-incomplete-classpath"
"--install-exit-handlers"

;; Most of these initialize-at-run-time classes are from https://github.com/oracle/graal/issues/2050#issuecomment-797689154
"--initialize-at-run-time=org.asynchttpclient.RequestBuilderBase,org.asynchttpclient.ntlm.NtlmEngine,io.netty.channel.kqueue.KQueue,io.netty.channel.kqueue.Native,io.netty.channel.kqueue.KQueueEventLoop,io.netty.channel.kqueue.KQueueEventArray,io.netty.util.internal.logging.Log4JLogger,io.netty.channel.epoll.Epoll,io.netty.channel.epoll.Native,io.netty.channel.epoll.EpollEventLoop,io.netty.channel.epoll.EpollEventArray,io.netty.channel.unix.Errors,io.netty.channel.unix.IovArray,io.netty.channel.unix.Limits,io.netty.channel.DefaultFileRegion,io.netty.handler.ssl.ReferenceCountedOpenSslContext,io.netty.handler.ssl.ReferenceCountedOpenSslEngine,io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator,io.netty.handler.ssl.JettyNpnSslEngine,io.netty.handler.ssl.ConscryptAlpnSslEngine,io.netty.handler.ssl.JettyAlpnSslEngine$ServerEngine,io.netty.handler.ssl.JettyAlpnSslEngine$ClientEngine,org.httpkit.client.ClientSslEngineFactory$SSLHolder,abracad.avro.ClojureData$Vars,org.apache.lucene.analysis.ja.dict.UnknownDictionary$SingletonHolder,org.apache.lucene.analysis.ja.dict.TokenInfoDictionary$SingletonHolder"

;; In theory this shouldn't be necessary w/ sufficient type hinting, but there's a bug in the go macro (I think)
;; that causes type hinting to not always work correctly inside them and you can't access fields of Java
;; types like fluree.db.flake.Flake b/c it will resort to reflection and that has to be configured under
;; graalvm native-images. I haven't figured out a minimal reproduction yet though. In the meantime, this fixes it.
"-H:ReflectionConfigurationFiles=resources/native-image-config/reflect-config.json"]
{:main-opts ["-m" "clj.native-image" "fluree.db.server"
"-H:Name=fluree-ledger" "--no-fallback"
"-H:+ReportExceptionStackTraces"
;; IncludeResources is pretty finicky. Lots of regexes I've tried don't
;; work and the logging the docs say you can turn on doesn't work.
;; So I'm just including everything for now. - WSM 2021/08/20
"-H:IncludeResources=.*"
"--enable-url-protocols=http,https"
"--enable-all-security-services"
"--report-unsupported-elements-at-runtime"
"--initialize-at-build-time"
"--allow-incomplete-classpath"
"--install-exit-handlers"

;; Most of these initialize-at-run-time classes are from https://github.com/oracle/graal/issues/2050#issuecomment-797689154
"--initialize-at-run-time=org.asynchttpclient.RequestBuilderBase,org.asynchttpclient.ntlm.NtlmEngine,io.netty.channel.kqueue.KQueue,io.netty.channel.kqueue.Native,io.netty.channel.kqueue.KQueueEventLoop,io.netty.channel.kqueue.KQueueEventArray,io.netty.util.internal.logging.Log4JLogger,io.netty.channel.epoll.Epoll,io.netty.channel.epoll.Native,io.netty.channel.epoll.EpollEventLoop,io.netty.channel.epoll.EpollEventArray,io.netty.channel.unix.Errors,io.netty.channel.unix.IovArray,io.netty.channel.unix.Limits,io.netty.channel.DefaultFileRegion,io.netty.handler.ssl.ReferenceCountedOpenSslContext,io.netty.handler.ssl.ReferenceCountedOpenSslEngine,io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator,io.netty.handler.ssl.JettyNpnSslEngine,io.netty.handler.ssl.ConscryptAlpnSslEngine,io.netty.handler.ssl.JettyAlpnSslEngine$ServerEngine,io.netty.handler.ssl.JettyAlpnSslEngine$ClientEngine,org.httpkit.client.ClientSslEngineFactory$SSLHolder,abracad.avro.ClojureData$Vars,org.apache.lucene.analysis.ja.dict.UnknownDictionary$SingletonHolder,org.apache.lucene.analysis.ja.dict.TokenInfoDictionary$SingletonHolder"

;; In theory this shouldn't be necessary w/ sufficient type hinting, but there's a bug in the go macro (I think)
;; that causes type hinting to not always work correctly inside them and you can't access fields of Java
;; types like fluree.db.flake.Flake b/c it will resort to reflection and that has to be configured under
;; graalvm native-images. I haven't figured out a minimal reproduction yet though. In the meantime, this fixes it.
"-H:ReflectionConfigurationFiles=resources/native-image-config/reflect-config.json"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
:extra-deps {clj.native-image/clj.native-image
{:git/url "https://github.com/taylorwood/clj.native-image.git"
Expand All @@ -110,12 +110,12 @@

:eastwood
{:extra-deps {jonase/eastwood {:mvn/version "1.2.4"}}
:main-opts ["-m" "eastwood.lint" {:source-paths ["src"] :test-paths ["test"]}]}
:main-opts ["-m" "eastwood.lint" {:source-paths ["src"] :test-paths ["test"]}]}

:ancient
{:extra-deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}
:main-opts ["-m" "antq.core" "--skip=github-action"]}
:main-opts ["-m" "antq.core" "--skip=github-action"]}

:clj-kondo
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "2022.06.22"}}
:main-opts ["-m" "clj-kondo.main" "--lint" "src" "--config" ".clj-kondo/config.edn"]}}}
:main-opts ["-m" "clj-kondo.main" "--lint" "src" "--config" ".clj-kondo/config.edn"]}}}
2 changes: 1 addition & 1 deletion src/fluree/db/peer/messages.clj
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
(async/<!! (pw-auth/fluree-decode-jwt (:conn system) jwt))))
{:keys [expire nonce] :or {nonce (System/currentTimeMillis)}} cmd-data
expire (or expire (+ 60000 nonce))
cmd-data* (assoc cmd-data :expire expire :nonce nonce)]
cmd-data* (assoc cmd-data :type cmd-type, :expire expire, :nonce nonce)]
(when (< expire (System/currentTimeMillis))
(throw-invalid-command (format "Command expired. Expiration: %s. Current time: %s."
expire (System/currentTimeMillis))))
Expand Down
Loading

0 comments on commit 324fb5e

Please sign in to comment.