Commit fd1e0aa 1 parent d5da4d9 commit fd1e0aa Copy full SHA for fd1e0aa
File tree 4 files changed +9
-6
lines changed
src/cmr/common_app/services/ingest
test/cmr/common_app/test/services/ingest
metadata-db-app/src/cmr/metadata_db/migrations
4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 8
8
[com.fasterxml.jackson.core/jackson-core " 2.12.1" ]
9
9
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor " 2.12.1" ]
10
10
[compojure " 1.6.1" ]
11
+ [digest " 1.4.8" ]
11
12
[nasa-cmr/cmr-acl-lib " 0.1.0-SNAPSHOT" ]
12
13
[nasa-cmr/cmr-common-lib " 0.1.1-SNAPSHOT" ]
13
14
[nasa-cmr/cmr-elastic-utils-lib " 0.1.0-SNAPSHOT" ]
Original file line number Diff line number Diff line change 2
2
" This contains the code for the scheduled subscription code to be shared
3
3
between metadata-db and ingest."
4
4
(:require
5
- [clojure.string :as string]))
5
+ [clojure.string :as string]
6
+ [digest :as digest]))
6
7
7
8
(defn normalize-parameters
8
9
" Returns a normalized url parameter string by splitting the string of parameters on '&' and
15
16
(string/split #"&" )
16
17
sort
17
18
(as-> $ (string/join " &" $))
18
- (string/trim ))))
19
+ string/trim
20
+ digest/md5)))
Original file line number Diff line number Diff line change 7
7
" Query normalization, should be sorted parameters"
8
8
(testing " With a leading question mark"
9
9
(let [query " provider=PROV1&instrument=1B&instrument=2B"
10
- expected " instrument=1B&instrument=2B&provider=PROV1 "
10
+ expected " bc71e563ac03a05d7c557608f868ce6a "
11
11
actual (sub-common/normalize-parameters query)]
12
12
(is (= expected actual))))
13
13
(testing " Without a leading question mark"
14
14
(let [query " provider=PROV1&instrument=1B&instrument=2B"
15
- expected " instrument=1B&instrument=2B&provider=PROV1 "
15
+ expected " bc71e563ac03a05d7c557608f868ce6a "
16
16
actual (sub-common/normalize-parameters query)]
17
17
(is (= expected actual))))
18
18
(testing " Empty string"
19
19
(let [query " "
20
- expected " "
20
+ expected " d41d8cd98f00b204e9800998ecf8427e "
21
21
actual (sub-common/normalize-parameters query)]
22
22
(is (= expected actual)))))
Original file line number Diff line number Diff line change 41
41
; ; applications can assume the normalized query is the same despite changes
42
42
; ; in query order or other such nominal differences. Simple string compair
43
43
; ; can be used on the normalized query.
44
- (helper/sql " alter table cmr_subscriptions add normalized_query VARCHAR2(4000 )" )
44
+ (helper/sql " alter table cmr_subscriptions add normalized_query VARCHAR2(64 )" )
45
45
(populate-new-column )
46
46
(create-subscription-index ))
47
47
You can’t perform that action at this time.
0 commit comments