Skip to content

Commit c627649

Browse files
committed
Merge branch 'master' of https://github.com/nasa/Common-Metadata-Repository into CMR-11105
2 parents ca9667b + 031f7b3 commit c627649

27 files changed

Lines changed: 108 additions & 58 deletions

File tree

‎access-control-app/src/cmr/access_control/routes.clj‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
common-routes/pretty-print-response-handler
3838
params/wrap-params
3939
req-log/add-body-hashes
40-
;; Last in line, but really first for request as they process in reverse
4140
req-log/log-ring-request
42-
req-log/add-time-stamp))
41+
req-log/add-time-stamp
42+
;; Last in line, but really first for request as they process in reverse
43+
(common-routes/wrap-disable-read-eval)))

‎common-app-lib/src/cmr/common_app/api/routes.clj‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@
237237
(assoc-in [:headers RESPONSE_X_REQUEST_ID_HEADER] request-id))
238238
((ring-json/wrap-json-response handler) request))))
239239

240+
(defn wrap-disable-read-eval
241+
"Disables *read-eval*"
242+
[handler]
243+
(fn [request]
244+
(binding [*read-eval* false]
245+
(handler request))))
246+
240247
(defn add-security-header-response-handler
241248
"Adds a number of security related response headers."
242249
[handler]

‎common-app-lib/src/cmr/common_app/test/side_api.clj‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
(ns cmr.common-app.test.side-api
22
"A namespace that creates a web server for controlling a system under test. It allows the system to be
33
stopped for easy testing in CI."
4-
(:require [compojure.route :as route]
5-
[compojure.core :refer [POST routes]]
6-
[clj-http.client :as client]
7-
[ring.middleware.json :as ring-json]
8-
[ring.middleware.params :as params]
9-
[ring.middleware.nested-params :as nested-params]
10-
[ring.middleware.keyword-params :as keyword-params]
11-
[cmr.common.log :refer (debug)]
12-
[cmr.common.api.errors :as errors]
13-
[cmr.common.config :refer [defconfig]]
14-
[cmr.common-app.api.routes :as common-routes]
15-
[cmr.common.api.web-server :as web]))
4+
(:require
5+
[compojure.route :as route]
6+
[compojure.core :refer [POST routes]]
7+
[clj-http.client :as client]
8+
[ring.middleware.json :as ring-json]
9+
[ring.middleware.params :as params]
10+
[ring.middleware.nested-params :as nested-params]
11+
[ring.middleware.keyword-params :as keyword-params]
12+
[cmr.common.log :refer (debug)]
13+
[cmr.common.api.errors :as errors]
14+
[cmr.common.config :refer [defconfig]]
15+
[cmr.common-app.api.routes :as common-routes]
16+
[cmr.common.api.web-server :as web]))
1617

1718
(declare side-api-port set-side-api-port!)
1819
(defconfig side-api-port

‎dev-system/dev/refresh_persistent_settings.clj‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns refresh-persistent-settings
22
"A namespace that can contain development time settings that will not be lost during a refresh."
3-
(:require [clojure.tools.namespace.repl :as r]
3+
(:require [clojure.edn :as edn]
4+
[clojure.tools.namespace.repl :as r]
45
[clojure.java.io :as io]))
56

67
;; Disable reloading of this namespace.
@@ -25,7 +26,7 @@
2526
(let [home (System/getProperty "user.dir")
2627
file-path (format "%s/local.edn" home)
2728
exists (.exists (io/file file-path))
28-
local-settings (if exists (read-string (slurp file-path)) {})
29+
local-settings (if exists (edn/read-string (slurp file-path)) {})
2930
settings (get local-settings which default)]
3031
;; Aggressively display that settings are being set from this process
3132
(println (format "🚀 - Using settings %s = %s." which settings))

‎indexer-app/src/cmr/indexer/data/concepts/association_util.clj‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns cmr.indexer.data.concepts.association-util
2-
"Contains functions to parse and convert generic associations to a map structure
2+
"Contains functions to parse and convert generic associations to a map structure
33
for each generic concept type."
44
(:require
5+
[clojure.edn :as edn]
56
[cmr.common.concepts :as cc]
67
[cmr.common.util :as util]))
78

@@ -26,7 +27,7 @@
2627
assoc-revision-id
2728
source-revision-id)
2829
revision-id (if (string? revision-id)
29-
(read-string revision-id)
30+
(edn/read-string revision-id)
3031
revision-id)]
3132
(-> association
3233
(dissoc :source-concept-identifier :source-revision-id

‎ingest-app/src/cmr/ingest/api/variables.clj‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns cmr.ingest.api.variables
22
"Variable ingest functions in support of the ingest API."
33
(:require
4+
[clojure.edn :as edn]
45
[clojure.string :as string]
56
[cmr.acl.core :as acl]
67
[cmr.common-app.api.enabled :as common-enabled]
@@ -54,7 +55,7 @@
5455
(api-core/set-user-id request-context headers)
5556
(assoc :coll-concept-id coll-concept-id
5657
:coll-revision-id (when coll-revision-id
57-
(read-string coll-revision-id)))))
58+
(edn/read-string coll-revision-id)))))
5859
;; Log the ingest attempt
5960
_ (info (format "Ingesting variable %s from client %s"
6061
(api-core/concept->loggable-string concept-with-user-id)

‎ingest-app/src/cmr/ingest/routes.clj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
common-routes/pretty-print-response-handler
5454
params/wrap-params
5555
req-log/add-body-hashes
56-
56+
req-log/add-time-stamp
5757
;; Last in line, but really first for request as they process in reverse
58-
req-log/add-time-stamp))
58+
common-routes/wrap-disable-read-eval))

‎ingest-app/src/cmr/ingest/validation/validation.clj‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
(:require
44
[cheshire.core :as json]
55
[clojure.data :as data]
6+
[clojure.edn :as edn]
67
[clojure.string :as string]
78
[cmr.common.util :as util :refer [defn-timed]]
89
[cmr.common-app.services.kms-lookup :as kms-lookup]
@@ -545,7 +546,7 @@
545546
(if (seq revision-info)
546547
(when coll-revision-id
547548
(if-let [revision (->> revision-info
548-
(filter #(= (read-string coll-revision-id)
549+
(filter #(= (edn/read-string coll-revision-id)
549550
(:revision-id %)))
550551
first)]
551552
(when (:deleted revision)

‎metadata-db-app/int-test/cmr/metadata_db/int_test/concepts/variable_association_save_test.clj‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
configurations including checking for proper error handling."
44
(:require
55
[cheshire.core :as json]
6+
[clojure.edn :as edn]
67
[clojure.test :refer :all]
78
[cmr.metadata-db.int-test.concepts.concept-save-spec :as c-spec]
89
[cmr.metadata-db.int-test.concepts.utils.interface :as concepts]
@@ -77,7 +78,7 @@
7778
(assoc :provider-id "CMR"))
7879
expected-payload {"XYZ" "XYZ" "allow-regridding" true}
7980
;; pull out data we need latter
80-
metadata (read-string (:metadata variable-association))
81+
metadata (edn/read-string (:metadata variable-association))
8182
metadata-withpayload (str (assoc metadata :data expected-payload))
8283
var-concept-id (:variable-concept-id metadata)
8384
;; put it back together
@@ -99,7 +100,7 @@
99100
stored-concept (:concept stored-response)
100101
stored-payload (-> stored-concept
101102
:metadata
102-
read-string
103+
edn/read-string
103104
:data)]
104105
(is (= 200 (:status stored-response)) "HTTP Status is wrong, expected 200")
105106
(is (= expected-payload stored-payload) "Payload missmatch")))))

‎metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"Provides implementations of the cmr.metadata-db.data.concepts/ConceptStore methods for OracleStore"
33
(:require
44
[clj-time.coerce :as cr]
5+
[clojure.edn :as edn]
56
[clojure.java.jdbc :as j]
67
[clojure.string :as string]
78
[cmr.common.concepts :as common-concepts]
@@ -700,13 +701,13 @@
700701
;; find a full list of types (param 2) in common-lib/src/cmr/common/concepts.clj
701702
(let [c (get-concept db :service-association "PROV1" "SA1200000040-CMR")
702703
raw_meta_edn (:metadata c)
703-
meta (read-string raw_meta_edn)]
704+
meta (edn/read-string raw_meta_edn)]
704705
meta)
705706

706707
;; or here is a variable-association example:
707708
(let [c (get-concept db :variable-association "PROV1" "VA1200000061-CMR")
708709
_ (println c)
709710
raw-meta-edn (:metadata c)
710711
_ (println "raw meta:\n" raw-meta-edn)
711-
meta (read-string raw-meta-edn)]
712+
meta (edn/read-string raw-meta-edn)]
712713
meta))

0 commit comments

Comments
 (0)