|
20 | 20 | (fixtures/grant-all-acl-fixture)) |
21 | 21 | (use-fixtures :once (fixtures/int-test-fixtures)) |
22 | 22 |
|
23 | | -(deftest ^:disruptive ^:serial invalid-search-test |
| 23 | +(deftest ^:serial invalid-search-test |
24 | 24 | (testing "Accept header" |
25 | 25 | (testing "Other than JSON is rejected" |
26 | 26 | (is (= {:status 400 |
|
59 | 59 | [{} 0] |
60 | 60 | (partition 2 group-permissions)))) |
61 | 61 |
|
62 | | -(comment |
63 | | - |
64 | | - (generate-query-map-for-group-permissions |
65 | | - ["guest" "read" "AG10000-PROV1" "create" "registered" "order"]) |
66 | | - |
67 | | - ) |
68 | | - |
69 | | -(deftest ^:disruptive ^:serial acl-search-order-test |
| 62 | +(deftest ^:serial acl-search-order-test |
70 | 63 | ;; Conforms to requirements set out in CMR-3590, alphabetical order regardless of case |
71 | 64 | (let [token (e/login (u/conn-context) "user1") |
72 | 65 | acl1 (u/ingest-acl token {:group_permissions [{:user_type "registered" :permissions ["read"]}] |
|
92 | 85 | "System - GROUP"] |
93 | 86 | (map :name (:items (ac/search-for-acls (merge {:token token} (u/conn-context)) {}))))))) |
94 | 87 |
|
95 | | -(deftest ^:disruptive ^:serial acl-search-permission-test |
| 88 | +(deftest ^:serial acl-search-permission-test |
96 | 89 | (let [_token (e/login (u/conn-context) "user1") |
97 | 90 | admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
98 | 91 | group1 (u/ingest-group admin-token |
|
171 | 164 | (is (= (u/acls->search-response 1 [acl7]) |
172 | 165 | (dissoc response :took))))))) |
173 | 166 |
|
174 | | -(deftest ^:disruptive ^:serial acl-search-test |
| 167 | +(deftest ^:serial acl-search-test |
175 | 168 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
176 | 169 | group1 (u/ingest-group admin-token |
177 | 170 | {:name "group1"} |
|
278 | 271 | {:page_size 3 :page_num 2} |
279 | 272 | {:token admin-token}) :took)))))) |
280 | 273 |
|
281 | | -(deftest ^:disruptive ^:serial acl-search-by-any-id-test |
| 274 | +(deftest ^:serial acl-search-by-any-id-test |
282 | 275 | (let [token (e/login (u/conn-context) "user1") |
283 | 276 | acl1 (u/ingest-acl token (u/catalog-item-acl "All Collections")) |
284 | 277 | acl2 (u/ingest-acl token (u/catalog-item-acl "All Granules")) |
|
304 | 297 | (:concept-id acl2) |
305 | 298 | "acl3-legacy-guid"]}))) |
306 | 299 |
|
307 | | -(deftest ^:disruptive ^:serial acl-search-permitted-group-test |
| 300 | +(deftest ^:serial acl-search-permitted-group-test |
308 | 301 | (declare group-permissions acls query-map) |
309 | 302 | (u/without-publishing-messages |
310 | | - (println "🚀 --------------------------------") |
311 | | - (println "🚀 - here outside of let") |
312 | | - (let [_ (println "🚀 - here inside of let") |
313 | | - token (e/login (u/conn-context) "user1") |
314 | | - _ (println "🚀 - here about to do things") |
| 303 | + (let [token (e/login (u/conn-context) "user1") |
315 | 304 | acl1 (u/ingest-acl token (assoc (u/system-acl "SYSTEM_AUDIT_REPORT") |
316 | 305 | :group_permissions |
317 | 306 | [{:user_type "guest" :permissions ["read"]}])) |
|
349 | 338 | AG10000-acls [acl8] |
350 | 339 | read-acls (into [fixtures/*fixture-system-acl* fixtures/*fixture-provider-acl* acl1 acl2 acl3 acl4 acl8] provider-group-acls) |
351 | 340 | create-acls (into [fixtures/*fixture-system-acl* fixtures/*fixture-provider-acl* acl3 acl5 acl7 acl8] provider-group-acls) |
352 | | - all-acls-no-admin [fixtures/*fixture-system-acl* fixtures/*fixture-provider-acl* acl1 acl2 acl3 acl4 acl5 acl6 acl7 acl8] |
353 | | - _ (println "🚀 - last thing in let")] |
| 341 | + all-acls-no-admin [fixtures/*fixture-system-acl* fixtures/*fixture-provider-acl* acl1 acl2 acl3 acl4 acl5 acl6 acl7 acl8]] |
354 | 342 |
|
355 | 343 | ;; AI note: passes |
356 | 344 | (testing "Search ACLs by permitted group" |
|
384 | 372 | ["GUEST"] {"options[permitted_group][ignore_case]" false} [])) |
385 | 373 |
|
386 | 374 | ;; AI note: not passing |
387 | | - (comment testing "Search ACLs by group permission" |
| 375 | + (testing "Search ACLs by group permission" |
388 | 376 | (are3 [group-permissions acls] |
389 | 377 | (let [query-map (generate-query-map-for-group-permissions group-permissions) |
390 | 378 | response (ac/search-for-acls (u/conn-context) query-map {:token token})] |
|
430 | 418 |
|
431 | 419 | ;; AI note: failing |
432 | 420 | ;; CMR-3154 acceptance criterium 3 |
433 | | - (comment testing "Search ACLs by group permission just group or permission" |
| 421 | + (testing "Search ACLs by group permission just group or permission" |
434 | 422 | (are3 [msg query-map acls] |
435 | 423 | (let [response (ac/search-for-acls (u/conn-context) |
436 | 424 | {:group-permission {:0 query-map} :page_size 20} |
|
464 | 452 |
|
465 | 453 | ;; AI note: failing |
466 | 454 | ;; CMR-3154 acceptance criterium 5 |
467 | | - (comment testing "Search ACLS by group permission with subfield other than permitted_group or permission is an error" |
| 455 | + (testing "Search ACLS by group permission with subfield other than permitted_group or permission is an error" |
468 | 456 | (let [query {:group-permission {:0 {:allowed-group "guest" :permission "read"}}}] |
469 | 457 | (is (= {:status 400 |
470 | 458 | :body {:errors ["Parameter group_permission has invalid subfield [allowed_group]. Only 'permitted_group' and 'permission' are allowed."]} |
471 | 459 | :content-type :json} |
472 | 460 | (ac/search-for-acls (u/conn-context) query {:token token :raw? true}))))) |
473 | 461 |
|
474 | 462 | ;; AI note: failing |
475 | | - (comment testing "Searching ACLS by group permission with permission values other than read, create, update, delete, or order is an error" |
| 463 | + (testing "Searching ACLS by group permission with permission values other than read, create, update, delete, or order is an error" |
476 | 464 | (let [query {:group-permission {:0 {:permitted_group "guest" :permission "foo"}}}] |
477 | 465 | (is (= {:status 400 |
478 | 466 | :body {:errors ["Sub-parameter permission of parameter group_permissions has invalid values [foo]. Only 'read', 'update', 'create', 'delete', or 'order' may be specified."]} |
479 | 467 | :content-type :json} |
480 | 468 | (ac/search-for-acls (u/conn-context) query {:token token :raw? true})))))))) |
481 | 469 |
|
482 | | -(deftest ^:disruptive ^:serial acl-search-by-identity-type-test |
| 470 | +(deftest ^:serial acl-search-by-identity-type-test |
483 | 471 | (declare identity-types expected-acls) |
484 | 472 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
485 | 473 | group1 (u/ingest-group admin-token |
|
528 | 516 | "Identity type searches are always case-insensitive" |
529 | 517 | ["PrOvIdEr"] (concat [fixtures/*fixture-provider-acl*] provider-group-acls))))) |
530 | 518 |
|
531 | | -(deftest ^:disruptive ^:serial acl-search-by-target-test |
| 519 | +(deftest ^:serial acl-search-by-target-test |
532 | 520 | (declare target) |
533 | 521 | (let [token (e/login (u/conn-context) "user1") |
534 | 522 | single-instance-acl (u/ingest-acl token |
|
552 | 540 | "Provider target, case insensitive" |
553 | 541 | ["catalog_item_acl"] [fixtures/*fixture-provider-acl*]))) |
554 | 542 |
|
555 | | -(deftest ^:disruptive ^:serial acl-search-by-permitted-user-test |
| 543 | +(deftest ^:serial acl-search-by-permitted-user-test |
556 | 544 | (declare user users) |
557 | 545 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
558 | 546 | group1 (u/ingest-group admin-token {:name "group1"} ["user1"]) |
|
616 | 604 | "User names are case-insensitive" |
617 | 605 | ["USER1"] [fixtures/*fixture-system-acl* fixtures/*fixture-provider-acl* acl-registered-1 acl-registered-2 acl-group1 acl-group2])))) |
618 | 606 |
|
619 | | -(deftest ^:disruptive ^:serial acl-search-provider-test |
| 607 | +(deftest ^:serial acl-search-provider-test |
620 | 608 | (declare options provider-ids) |
621 | 609 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
622 | 610 | group1 (u/ingest-group admin-token {:name "group1"} ["user1"]) |
|
698 | 686 | "Multiple providers with empty results using ignore_case=false option" |
699 | 687 | ["prov1"] {"options[provider][ignore_case]" false} [])))) |
700 | 688 |
|
701 | | -(deftest ^:disruptive ^:serial acl-search-multiple-criteria |
| 689 | +(deftest ^:serial acl-search-multiple-criteria |
702 | 690 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
703 | 691 | group1 (u/ingest-group admin-token {:name "group1"} ["user1"]) |
704 | 692 | group2 (u/ingest-group admin-token {:name "group2"} ["user2"]) |
|
766 | 754 | :permitted-user "user2"} |
767 | 755 | [acl3 fixtures/*fixture-provider-acl* acl5 acl7])))) |
768 | 756 |
|
769 | | -(deftest ^:disruptive ^:serial acl-search-with-legacy-group-guid-test |
| 757 | +(deftest ^:serial acl-search-with-legacy-group-guid-test |
770 | 758 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
771 | 759 | group1-legacy-guid "group1-legacy-guid" |
772 | 760 | group1 (u/ingest-group admin-token |
|
827 | 815 | (is (= (u/acls->search-response (count expected-acls) expected-acls {:include-full-acl true}) |
828 | 816 | (dissoc response :took))))))) |
829 | 817 |
|
830 | | -(deftest ^:disruptive ^:serial acl-reindexing-test |
| 818 | +(deftest ^:serial acl-reindexing-test |
831 | 819 | (u/without-publishing-messages |
832 | 820 | (let [token (e/login (u/conn-context) "user1") |
833 | 821 | acl1 (u/ingest-acl token (assoc (u/system-acl "METRIC_DATA_POINT_SAMPLE") |
|
873 | 861 | (count expected-acls-after-reindexing) expected-acls-after-reindexing))) |
874 | 862 | (set (:items actual-response)))))))) |
875 | 863 |
|
876 | | -(deftest ^:disruptive ^:serial acl-search-by-target-group-id-test |
| 864 | +(deftest ^:serial acl-search-by-target-group-id-test |
877 | 865 | (let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"]) |
878 | 866 | group1 (u/ingest-group admin-token |
879 | 867 | {:name "group1"} |
|
0 commit comments