Repository: CS-SI/eodag
Pull request #1213 (2024-06-14 13:37:31)

feat(server): add blacklist config for assets alt URLs
Add a config to be able to hide from clients assets alternate origin URLs. Useful to hide backend URLs from EODAG server.

github-actions[bot]: ## Test Results
  2 files   -     2    2 suites   - 2   2m 2s :stopwatch: - 3m 36s
525 tests  -    18  417 :white_check_mark:  -   123   3 :zzz: ± 0  22 :x: +22   83 :fire: + 83 
804 runs   - 1 368  632 :white_check_mark:  - 1 442  46 :zzz:  - 52  22 :x: +22  104 :fire: +104 

For more details on these failures and errors, see [this check](https://github.com/CS-SI/eodag/runs/26234957495).

Results for commit cbd671ef. ± Comparison against base commit e73c12e9.

<details>
  <summary>This pull request <b>removes</b> 19 and <b>adds</b> 1 tests. <i>Note that renamed tests count towards both.</i></summary>

```
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_attribute
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_combination
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_contains
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_interval
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_predicate
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_spatial
tests.units.test_stac_utils.TestEodagCql2jsonEvaluator ‑ test_temporal
tests.units.test_stac_utils.TestRfc3339 ‑ test_rfc3339_str_to_datetime
tests.units.test_stac_utils.TestRfc3339 ‑ test_str_to_interval
tests.units.test_stac_utils.TestStacUtils ‑ test_fetch_external_stac_collections
…
```

```
tests.units.test_stac_utils
```
</details>

[test-results]:data:application/gzip;base64,H4sIAHtIbGYC/03MQQ6DIBCF4asY1l3IIIz0MgYRElKVBmFleveCLbTL983kP4l1qznIvYNbR47kYhtLCio6v+dJoUA+xXLkwOuajqR1poHijx7umYk1sMqtpdkakwnBh0xjeQppL9WxH76jRgWDJp/mICr8Ny+oSXpltN82F/Mkel4EUmNHyVEb5KiskcZKgZpxZQHmWVLAnrzexJD6bAsBAAA=

github-actions[bot]: ![badge](https://raw.githubusercontent.com/CS-SI/eodag/_xml_coverage_reports/data/feat%2Fserver-url-blacklist/./badge.svg)


## Code Coverage (Ubuntu)

<details>


```
Filename                                     Stmts    Miss  Cover    Missing
-----------------------------------------  -------  ------  -------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
__init__.py                                     10       0  100.00%
cli.py                                         302      51  83.11%   60, 644-690, 792-843, 847
config.py                                      350      27  92.29%   81-83, 92, 100, 104-106, 183, 195, 459-461, 525-528, 575-576, 585-586, 665, 734-739, 741
crunch.py                                        5       5  0.00%    20-24
api/__init__.py                                  0       0  100.00%
api/core.py                                    762      84  88.98%   89-98, 372, 597, 641-644, 682, 719, 792, 796-801, 827, 923, 1000, 1113, 1203-1215, 1255, 1257, 1261, 1284, 1288-1299, 1312-1318, 1408-1411, 1440-1460, 1517, 1534-1537, 1549-1552, 1569-1576, 1944, 1977-1983, 2248, 2252-2255, 2269-2271, 2306
api/search_result.py                            50       6  88.00%   33-35, 70, 79, 86, 100
api/product/__init__.py                          5       0  100.00%
api/product/_assets.py                          44       6  86.36%   27-29, 79, 119, 129
api/product/_product.py                        188      27  85.64%   56-63, 67-69, 239-240, 322, 351, 412, 426-429, 442, 466-469, 512-518
api/product/metadata_mapping.py                678      83  87.76%   67-69, 131-133, 234, 266-267, 313-314, 324-336, 338, 349, 355-367, 412-413, 450, 471-474, 497, 505-506, 582-583, 607-608, 614-617, 632-633, 782, 828, 1002-1007, 1138, 1152-1172, 1192, 1197, 1307, 1329, 1343, 1356-1375, 1414, 1466, 1504-1508, 1527
api/product/drivers/__init__.py                  5       0  100.00%
api/product/drivers/base.py                      8       2  75.00%   23, 41
plugins/__init__.py                              0       0  100.00%
plugins/base.py                                 23       3  86.96%   25, 48, 55
plugins/manager.py                             133      15  88.72%   49-51, 105-110, 156, 197, 219, 223, 248, 287-288
plugins/apis/__init__.py                         0       0  100.00%
plugins/apis/base.py                             4       0  100.00%
plugins/apis/ecmwf.py                           99      15  84.85%   46-54, 150-152, 199-200, 226-228
plugins/apis/usgs.py                           175      36  79.43%   60-65, 132, 205, 239, 274-276, 281, 307-308, 313, 343-350, 361-366, 388-394, 396-402, 425
plugins/authentication/__init__.py               6       1  83.33%   31
plugins/authentication/aws_auth.py              20       2  90.00%   25-27
plugins/authentication/base.py                  19       3  84.21%   26, 34, 47
plugins/authentication/generic.py               16       3  81.25%   28, 40, 50
plugins/authentication/header.py                17       1  94.12%   27
plugins/authentication/keycloak.py              49       6  87.76%   33-35, 132, 156-161
plugins/authentication/oauth.py                 15       8  46.67%   25, 32-34, 38-41
plugins/authentication/openid_connect.py       186      19  89.78%   41-43, 121, 135-160, 168, 322-325, 349
plugins/authentication/qsauth.py                36       2  94.44%   32, 83
plugins/authentication/sas_auth.py              49       2  95.92%   32, 76
plugins/authentication/token.py                 90      17  81.11%   35-37, 79, 107, 109, 131-143, 198-201
plugins/authentication/token_exchange.py        35      19  45.71%   74-80, 92-120
plugins/crunch/__init__.py                       0       0  100.00%
plugins/crunch/base.py                          10       2  80.00%   25, 38
plugins/crunch/filter_date.py                   62      15  75.81%   30, 53-58, 72, 81, 90, 93, 105-107, 116-118, 125
plugins/crunch/filter_latest_intersect.py       50      10  80.00%   32-34, 51-52, 71, 80-83, 85, 92-95
plugins/crunch/filter_latest_tpl_name.py        33       2  93.94%   28, 86
plugins/crunch/filter_overlap.py                68      19  72.06%   28-30, 33, 72-75, 82-85, 91, 99, 110-126
plugins/crunch/filter_property.py               33       8  75.76%   29, 60-65, 68-69, 85-89
plugins/download/__init__.py                     0       0  100.00%
plugins/download/aws.py                        492     165  66.46%   77-83, 272, 285, 352-355, 369-373, 419-421, 425, 459-460, 466-470, 503, 538, 542, 549, 579-587, 591, 629-637, 644-646, 687-761, 779-840, 851-856, 872-885, 914, 929-931, 934, 944-952, 960-973, 983-1002, 1009-1021, 1062, 1088, 1133-1135, 1355
plugins/download/base.py                       260      57  78.08%   58-64, 145, 180, 319-320, 340-346, 377-381, 387-388, 432, 435-449, 461, 465, 538-542, 572-573, 581-598, 605-613, 615-619, 666, 688, 710, 718
plugins/download/creodias_s3.py                 17       9  47.06%   44-58
plugins/download/http.py                       531     133  74.95%   85-91, 124, 203-213, 215-216, 251-254, 318-321, 323-324, 331-336, 354-369, 386-388, 400, 448, 455-461, 479, 493, 507, 515-517, 533-538, 549, 567, 609-613, 635, 675, 720, 734-740, 776-840, 858, 891-900, 926-927, 954-959, 965, 968, 984, 1001-1002, 1029-1030, 1037, 1099-1105, 1160-1161, 1167, 1177, 1243, 1247, 1261-1277
plugins/download/s3rest.py                     118      27  77.12%   55-58, 121, 162, 197, 227-234, 237-239, 243, 256-262, 270-271, 274-278, 301, 322-325
plugins/search/__init__.py                      26       3  88.46%   27-31
plugins/search/base.py                         133      13  90.23%   48-53, 104, 108, 121, 271, 291, 350-351, 371, 380
plugins/search/build_search_result.py          183      24  86.89%   62, 97, 141-142, 148, 159, 295-298, 327, 384-401, 463, 466, 476, 493, 521, 523
plugins/search/cop_marine.py                   179      40  77.65%   43-44, 55, 65-66, 109-111, 123-124, 164-173, 177, 182, 197, 233, 237, 252, 256, 260, 264, 268-272, 278-281, 284-297, 314, 337, 344
plugins/search/creodias_s3.py                   55       3  94.55%   56, 74, 108
plugins/search/csw.py                          108      83  23.15%   44-46, 58-59, 63-64, 72-120, 126-139, 147-179, 197-238
plugins/search/data_request_search.py          198      65  67.17%   53, 90-93, 109, 121, 125-126, 137, 142, 147, 154, 167-170, 224-225, 229, 239-245, 250, 276-279, 287-298, 315, 317, 324-325, 327-328, 346-350, 383, 390, 401, 414, 420-432, 437
plugins/search/qssearch.py                     646      69  89.32%   102, 386, 390-396, 404-405, 511-517, 567, 583, 593, 620, 622, 665-668, 743-744, 787, 806, 821, 879, 900, 903-904, 913, 924, 933, 956, 1020-1025, 1029-1030, 1063, 1137, 1186, 1260-1264, 1330-1331, 1352, 1380-1392, 1399, 1431-1433, 1443-1449, 1493, 1508, 1528, 1631-1641
plugins/search/static_stac_search.py            73      12  83.56%   37-38, 95-122, 138, 151
rest/__init__.py                                 4       2  50.00%   21-22
rest/cache.py                                   33       7  78.79%   35-37, 53-55, 59, 68
rest/config.py                                  22       1  95.45%   35
rest/constants.py                                7       0  100.00%
rest/core.py                                   237      30  87.34%   83-87, 279, 363, 478, 705, 712-760
rest/server.py                                 286      55  80.77%   81-82, 108, 131-133, 246-248, 304-305, 317-333, 425-430, 458, 625-632, 661, 705-706, 729, 802-804, 821-826, 855, 857, 861-862, 866-867
rest/stac.py                                   465     123  73.55%   64-66, 319, 341, 389-392, 416-442, 447-453, 476-478, 501, 536-537, 565, 578, 623-663, 691-707, 786-799, 806, 859-860, 924, 992-994, 1213, 1223-1235, 1248-1270, 1284-1329, 1483-1484
rest/types/__init__.py                           0       0  100.00%
rest/types/collections_search.py                13      13  0.00%    18-44
rest/types/eodag_search.py                     184       9  95.11%   52-55, 235-239, 292, 295, 363
rest/types/queryables.py                        58       2  96.55%   38, 172
rest/types/stac_search.py                      127      11  91.34%   50-53, 132, 178, 193-195, 203, 207
rest/utils/__init__.py                          95      13  86.32%   51, 108-109, 128-130, 182, 192-206
rest/utils/cql_evaluate.py                      48       5  89.58%   69, 76, 90, 97, 105
rest/utils/rfc3339.py                           31       3  90.32%   78, 90, 92
types/__init__.py                              110      11  90.00%   53, 70, 129-132, 199, 214-218, 245, 258
types/bbox.py                                   43      19  55.81%   46-61, 72-74, 85-87, 99-101, 113-115, 123
types/download_args.py                           9       0  100.00%
types/queryables.py                             81       0  100.00%
types/search_args.py                            70      18  74.29%   60-64, 71-88, 104
types/whoosh.py                                 15       0  100.00%
utils/__init__.py                              501      39  92.22%   84, 89, 110-112, 193-194, 203-230, 233, 247, 329-333, 409-413, 434-436, 518, 533, 571-572, 968-971, 979-980, 1021-1022, 1204
utils/constraints.py                           119      37  68.91%   94-103, 144, 149, 153, 164, 190-192, 202, 216-232, 241-252
utils/exceptions.py                             37       2  94.59%   23, 93
utils/import_system.py                          30      20  33.33%   27, 67-81, 93-103
utils/logging.py                                29       1  96.55%   123
utils/notebook.py                               44      23  47.73%   25-29, 36-41, 58-62, 72-78, 83-87
utils/requests.py                               55      11  80.00%   69, 96, 98, 100, 102, 104, 123, 128-130, 138
utils/rest.py                                   27       1  96.30%   49
utils/stac_reader.py                           111      45  59.46%   56-57, 63-85, 95-97, 101, 143, 159-162, 215-224, 234-264
TOTAL                                         9545    1703  82.16%
```

</details>


### Diff against develop

```
Filename          Stmts    Miss  Cover
--------------  -------  ------  --------
rest/config.py       +8      +1  -4.55%
rest/stac.py         +6      +2  -0.09%
TOTAL               +14      +3  +100.00%
```


Results for commit: 2b08ab15ce94646fbda031f3e49481aca6d9b2af


_Minimum allowed coverage is `70%`_


:recycle: This comment has been updated with latest results


<!-- Sticky Pull Request Commentartifacts/unit-test-results-python3.12-ubuntu-latest/coverage.xml -->
github-actions[bot]: ![badge](https://raw.githubusercontent.com/CS-SI/eodag/_xml_coverage_reports_win/data/feat%2Fserver-url-blacklist/./badge.svg)


## Code Coverage (Windows)

<details>


```
Filename                                     Stmts    Miss  Cover    Missing
-----------------------------------------  -------  ------  -------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
__init__.py                                     10       0  100.00%
cli.py                                         302     203  32.78%   60, 92-98, 111-113, 119, 260-381, 407-469, 485-500, 524-583, 644-690, 792-843, 847
config.py                                      350      69  80.29%   81-83, 92, 100, 104-106, 177, 179, 183, 195, 211, 413, 459-461, 525, 527-528, 562-592, 597, 628-635, 647-669, 699, 728-739, 741, 746
crunch.py                                        5       5  0.00%    20-24
api/__init__.py                                  0       0  100.00%
api/core.py                                    762     170  77.69%   89-98, 132-145, 318, 353-357, 372, 416-420, 443-451, 470-477, 597, 641-644, 682, 719, 747-766, 789, 792, 796-801, 827, 854, 882, 895-899, 923, 946-949, 1000, 1113, 1138, 1146, 1203-1215, 1255, 1257, 1261, 1284, 1288-1299, 1312-1318, 1408-1411, 1440-1460, 1517, 1534-1537, 1549-1552, 1562-1581, 1698, 1914-1915, 1944, 1977-1983, 1996-2005, 2050-2068, 2083-2085, 2096-2097, 2108-2117, 2240-2248, 2251-2255, 2269-2271, 2306
api/search_result.py                            50      11  78.00%   33-35, 70, 79, 86, 100, 126, 146, 153, 162, 170
api/product/__init__.py                          5       0  100.00%
api/product/_assets.py                          44       6  86.36%   27-29, 79, 119, 129
api/product/_product.py                        188      27  85.64%   56-63, 67-69, 239-240, 322, 351, 412, 426-429, 442, 466-469, 512-518
api/product/metadata_mapping.py                678     137  79.79%   67-69, 131-133, 234, 266-267, 284-285, 313-314, 324-336, 338, 349, 355-367, 373, 379, 410-413, 450, 471-474, 490, 497, 505-510, 547, 582-583, 607-608, 614-617, 632-633, 782, 828, 958-959, 966, 981-982, 986, 1002-1007, 1101, 1133-1172, 1192, 1197, 1205-1216, 1262, 1280, 1307, 1316-1319, 1329, 1343, 1356-1375, 1414, 1441-1466, 1485-1489, 1504-1508, 1526-1537
api/product/drivers/__init__.py                  5       0  100.00%
api/product/drivers/base.py                      8       2  75.00%   23, 41
plugins/__init__.py                              0       0  100.00%
plugins/base.py                                 23       4  82.61%   25, 48, 55, 68
plugins/manager.py                             133      27  79.70%   49-51, 99-104, 106-110, 116-128, 147-152, 156, 197, 219, 223, 244-248, 287-288
plugins/apis/__init__.py                         0       0  100.00%
plugins/apis/base.py                             4       0  100.00%
plugins/apis/ecmwf.py                           99      70  29.29%   46-54, 88, 99-125, 135-154, 166-243, 258, 270
plugins/apis/usgs.py                           175     116  33.71%   60-65, 103-112, 132, 145, 156-160, 182-217, 232-241, 254-410, 425
plugins/authentication/__init__.py               6       1  83.33%   31
plugins/authentication/aws_auth.py              20       2  90.00%   25-27
plugins/authentication/base.py                  19       4  78.95%   26, 34, 47, 57
plugins/authentication/generic.py               16       3  81.25%   28, 40, 50
plugins/authentication/header.py                17       7  58.82%   27, 65-70, 77, 81-82
plugins/authentication/keycloak.py              49      31  36.73%   33-35, 86, 90-94, 103-106, 113-135, 138-162
plugins/authentication/oauth.py                 15       8  46.67%   25, 32-34, 38-41
plugins/authentication/openid_connect.py       186      32  82.80%   41-43, 121, 127-160, 168, 322-325, 349, 516-533
plugins/authentication/qsauth.py                36      21  41.67%   32, 65-87, 94, 98-104
plugins/authentication/sas_auth.py              49      32  34.69%   32, 48-52, 58-84, 93, 97-108
plugins/authentication/token.py                 90      68  24.44%   35-37, 47-49, 53-65, 71-111, 119-169, 187-190, 194-215
plugins/authentication/token_exchange.py        35      19  45.71%   74-80, 92-120
plugins/crunch/__init__.py                       0       0  100.00%
plugins/crunch/base.py                          10       2  80.00%   25, 38
plugins/crunch/filter_date.py                   62      15  75.81%   30, 53-58, 72, 81, 90, 93, 105-107, 116-118, 125
plugins/crunch/filter_latest_intersect.py       50      35  30.00%   32-34, 48-53, 69-114
plugins/crunch/filter_latest_tpl_name.py        33       2  93.94%   28, 86
plugins/crunch/filter_overlap.py                68      28  58.82%   28-30, 33, 72-75, 82-85, 91, 95, 99, 110-126, 141-167
plugins/crunch/filter_property.py               33       8  75.76%   29, 60-65, 68-69, 85-89
plugins/download/__init__.py                     0       0  100.00%
plugins/download/aws.py                        492     420  14.63%   77-83, 269-393, 415-429, 439-470, 492-520, 537-592, 617-640, 644-646, 687-761, 779-840, 851-856, 872-885, 904-934, 944-952, 959-975, 983-1002, 1009-1021, 1035-1051, 1055-1075, 1079-1135, 1145-1340, 1355
plugins/download/base.py                       260     114  56.15%   58-64, 145, 180, 211-214, 235, 250-252, 319-320, 340-346, 377-381, 387-388, 432, 435-449, 461, 465, 515-623, 666, 673-693, 706-710, 716-725
plugins/download/creodias_s3.py                 17      10  41.18%   34, 44-58
plugins/download/http.py                       531     148  72.13%   85-91, 124, 203-213, 215-216, 251-254, 318-321, 323-324, 331-336, 354-369, 386-388, 400, 448, 455-461, 479, 493, 507, 515-517, 533-538, 549, 567, 609-613, 635, 675, 706, 720, 734-740, 776-840, 847-858, 870-900, 926-927, 954-959, 965, 968, 983-988, 1001-1002, 1029-1030, 1037, 1099-1105, 1160-1161, 1167, 1177, 1243, 1247, 1261-1277, 1360
plugins/download/s3rest.py                     118      98  16.95%   55-58, 88-89, 120-342
plugins/search/__init__.py                      26       3  88.46%   27-31
plugins/search/base.py                         133      24  81.95%   48-53, 104, 108, 121, 136-142, 271, 291, 350-351, 371, 374-382, 384
plugins/search/build_search_result.py          183     125  31.69%   62, 97, 120, 134-236, 295-298, 312, 321-323, 327, 334-345, 365-368, 381-448, 461-551
plugins/search/cop_marine.py                   179     146  18.44%   43-44, 50-56, 65-66, 91-126, 137-142, 154-207, 228-356
plugins/search/creodias_s3.py                   55      34  38.18%   51-56, 60-111, 127-137
plugins/search/csw.py                          108      83  23.15%   44-46, 58-59, 63-64, 72-120, 126-139, 147-179, 197-238
plugins/search/data_request_search.py          198     170  14.14%   53, 69-113, 121, 125-126, 136-253, 260-284, 287-298, 301-331, 336-350, 360-407, 410-415, 420-432, 436-439
plugins/search/qssearch.py                     646     252  60.99%   102, 365-522, 534-549, 565-650, 665-668, 743-744, 787, 805-811, 821, 867-904, 913, 924, 933, 944-945, 947, 956, 964, 1019-1033, 1063, 1092, 1115-1116, 1129, 1131, 1137, 1145, 1171-1198, 1204, 1216-1237, 1260-1264, 1275, 1303-1338, 1352, 1378-1392, 1399, 1431-1433, 1443-1449, 1493, 1506, 1508, 1518, 1528, 1535, 1538, 1540, 1590-1661
plugins/search/static_stac_search.py            73      12  83.56%   37-38, 95-122, 138, 151
rest/__init__.py                                 4       2  50.00%   21-22
rest/cache.py                                   33      22  33.33%   35-37, 44-70
rest/config.py                                  22       4  81.82%   33-35, 63
rest/constants.py                                7       0  100.00%
rest/core.py                                   237     152  35.86%   83-87, 167-246, 270-324, 337-373, 409-447, 467-483, 506-517, 526-562, 581, 627-666, 705, 712-760
rest/server.py                                 286     286  0.00%    18-878
rest/stac.py                                   465     394  15.27%   64-66, 127-133, 141-164, 195-200, 232, 252-375, 385-454, 472-511, 527-580, 590-613, 623-663, 691-707, 717, 733-736, 755-825, 842-873, 902-927, 935-951, 959-964, 974-1001, 1011-1013, 1021-1023, 1036-1038, 1052-1069, 1079-1100, 1110-1132, 1140-1157, 1180-1203, 1213, 1223-1235, 1248-1270, 1284-1329, 1337-1354, 1365-1514
rest/types/__init__.py                           0       0  100.00%
rest/types/collections_search.py                13      13  0.00%    18-44
rest/types/eodag_search.py                     184     104  43.48%   52-55, 124-126, 131-133, 139-154, 160-162, 171-181, 190-248, 257-307, 313-315, 326-330, 345-347, 352-363, 368-370, 375-378
rest/types/queryables.py                        58      14  75.86%   38, 51-52, 58-59, 65-66, 95-100, 109-110, 172
rest/types/stac_search.py                      127      69  45.67%   50-53, 130-132, 137-143, 149-151, 156-157, 162-163, 169-171, 177-183, 190-209, 215-240, 250-255, 264-272
rest/utils/__init__.py                          95      62  34.74%   51, 79-85, 90-92, 97-99, 104-109, 114-120, 125-130, 140-168, 175-183, 190-211
rest/utils/cql_evaluate.py                      48      27  43.75%   36, 41, 46, 51, 68-105, 110-114, 119
rest/utils/rfc3339.py                           31      24  22.58%   43-50, 69-94
types/__init__.py                              110      85  22.73%   52-57, 66-70, 81-93, 109-132, 158-177, 198-270
types/bbox.py                                   43      19  55.81%   46-61, 72-74, 85-87, 99-101, 113-115, 123
types/download_args.py                           9       0  100.00%
types/queryables.py                             81       2  97.53%   46-51
types/search_args.py                            70      33  52.86%   60-64, 71-88, 103-134
types/whoosh.py                                 15       0  100.00%
utils/__init__.py                              501      50  90.02%   84, 89, 110-112, 193-194, 203-230, 233, 247, 329-333, 371, 409-413, 434-436, 518, 533, 571-572, 907, 968-971, 979-980, 1021-1022, 1055, 1075-1076, 1128-1131, 1145, 1163, 1204, 1380
utils/constraints.py                           119     104  12.61%   54-168, 183-205, 214-233, 241-252
utils/exceptions.py                             37       5  86.49%   23, 91-94
utils/import_system.py                          30      20  33.33%   27, 67-81, 93-103
utils/logging.py                                29      12  58.62%   43, 58-123, 152, 154-158
utils/notebook.py                               44      23  47.73%   25-29, 36-41, 58-62, 72-78, 83-87
utils/requests.py                               55      11  80.00%   69, 96, 98, 100, 102, 104, 123, 128-130, 138
utils/rest.py                                   27      20  25.93%   38-57, 63-74
utils/stac_reader.py                           111      49  55.86%   56-59, 63-85, 95-97, 101, 136, 143, 159-162, 166, 215-224, 234-264
TOTAL                                         9545    4410  53.80%
```

</details>


### Diff against develop

```
Filename                                    Stmts    Miss  Cover
----------------------------------------  -------  ------  -------
cli.py                                          0    +152  -50.33%
config.py                                       0     +41  -11.71%
api/core.py                                     0     +86  -11.29%
api/search_result.py                            0      +5  -10.00%
api/product/metadata_mapping.py                 0     +54  -7.97%
plugins/manager.py                              0     +12  -9.02%
plugins/apis/ecmwf.py                           0     +55  -55.56%
plugins/apis/usgs.py                            0     +80  -45.72%
plugins/authentication/base.py                  0      +1  -5.26%
plugins/authentication/header.py                0      +6  -35.30%
plugins/authentication/keycloak.py              0     +25  -51.03%
plugins/authentication/openid_connect.py        0     +13  -6.98%
plugins/authentication/qsauth.py                0     +19  -52.77%
plugins/authentication/sas_auth.py              0     +30  -61.23%
plugins/authentication/token.py                 0     +51  -56.67%
plugins/crunch/filter_overlap.py                0      +9  -13.24%
plugins/download/aws.py                         0    +255  -51.83%
plugins/download/base.py                        0     +55  -21.16%
plugins/download/creodias_s3.py                 0      +1  -5.88%
plugins/download/http.py                        0     +15  -2.82%
plugins/download/s3rest.py                      0     +71  -60.17%
plugins/search/base.py                          0      +6  -4.52%
plugins/search/build_search_result.py           0     +94  -51.37%
plugins/search/cop_marine.py                    0    +106  -59.21%
plugins/search/creodias_s3.py                   0     +31  -56.37%
plugins/search/data_request_search.py           0    +105  -53.03%
plugins/search/qssearch.py                      0    +155  -23.99%
rest/config.py                                 +8      +3  -11.04%
rest/stac.py                                   +6      +5  +0.02%
rest/types/eodag_search.py                      0     +85  -46.19%
rest/types/stac_search.py                       0     +47  -37.01%
rest/utils/__init__.py                          0     +31  -32.63%
rest/utils/cql_evaluate.py                      0     +22  -45.83%
rest/utils/rfc3339.py                           0     +18  -58.07%
types/__init__.py                               0     +49  -44.54%
types/queryables.py                             0      +2  -2.47%
types/search_args.py                            0     +15  -21.43%
utils/__init__.py                               0      +9  -1.80%
utils/constraints.py                            0     +67  -56.30%
utils/exceptions.py                             0      +3  -8.10%
utils/logging.py                                0     +11  -37.93%
utils/rest.py                                   0     +19  -70.37%
utils/stac_reader.py                            0      +4  -3.60%
TOTAL                                         +14   +1923  -20.11%
```


Results for commit: 2b08ab15ce94646fbda031f3e49481aca6d9b2af


_Minimum allowed coverage is `70%`_


:recycle: This comment has been updated with latest results


<!-- Sticky Pull Request Commentartifacts/unit-test-results-python3.12-windows-latest/coverage.xml -->

Patch:
diff --git a/eodag/rest/config.py b/eodag/rest/config.py
index 1f2d3330..e191f815 100644
--- a/eodag/rest/config.py
+++ b/eodag/rest/config.py
@@ -18,11 +18,22 @@
 from __future__ import annotations
 
 from functools import lru_cache
+from typing import List, Union
 
 from pydantic import Field
+from pydantic.functional_validators import BeforeValidator
 from pydantic_settings import BaseSettings, SettingsConfigDict
+from typing_extensions import Doc
 
 from eodag.rest.constants import DEFAULT_MAXSIZE, DEFAULT_TTL
+from eodag.utils import Annotated
+
+
+def str2liststr(raw: Union[str, List[str]]) -> List[str]:
+    """Convert str to list[str]"""
+    if isinstance(raw, list):
+        return raw
+    return raw.split(",")
 
 
 class Settings(BaseSettings):
@@ -34,6 +45,14 @@ class Settings(BaseSettings):
 
     debug: bool = False
 
+    origin_url_blacklist: Annotated[
+        Union[str, List[str]],
+        BeforeValidator(str2liststr),
+        Doc(
+            "Hide from clients items assets' alternative URLs starting with URLs from the list"
+        ),
+    ] = Field(default=[])
+
     model_config = SettingsConfigDict(
         env_prefix="EODAG_", extra="ignore", env_nested_delimiter="__"
     )
diff --git a/eodag/rest/stac.py b/eodag/rest/stac.py
index 24126c8d..fa4e96b5 100644
--- a/eodag/rest/stac.py
+++ b/eodag/rest/stac.py
@@ -39,6 +39,7 @@ from eodag.api.product.metadata_mapping import (
     format_metadata,
     get_metadata_path,
 )
+from eodag.rest.config import Settings
 from eodag.utils import (
     DEFAULT_MISSION_START_DATE,
     deepcopy,
@@ -382,6 +383,7 @@ class StacItem(StacCommon):
         _dc_qs: Optional[str] = None,
     ) -> Dict[str, Any]:
         assets: Dict[str, Any] = {}
+        settings = Settings.from_environment()
 
         if _dc_qs:
             parsed = urlparse(product.remote_location)
@@ -396,13 +398,16 @@ class StacItem(StacCommon):
             "title": "Download link",
             "href": downloadlink_href,
             "type": "application/zip",
-            "alternate": {
+        }
+
+        if not origin_href.startswith(tuple(settings.origin_url_blacklist)):
+            assets["downloadLink"]["alternate"] = {
                 "origin": {
                     "title": "Origin asset link",
                     "href": origin_href,
                 }
-            },
-        }
+            }
+
         if "storageStatus" in product.properties:
             assets["downloadLink"]["storage:tier"] = product.properties["storageStatus"]
 
@@ -414,12 +419,15 @@ class StacItem(StacCommon):
                 # use origin asset as default
                 assets[asset_key] = asset_value
                 # origin assets as alternate link
-                assets[asset_key]["alternate"] = {
-                    "origin": {
-                        "title": "Origin asset link",
-                        "href": asset_value["href"],
+                if not asset_value["href"].startswith(
+                    tuple(settings.origin_url_blacklist)
+                ):
+                    assets[asset_key]["alternate"] = {
+                        "origin": {
+                            "title": "Origin asset link",
+                            "href": asset_value["href"],
+                        }
                     }
-                }
                 # use server-mode assets download links
                 asset_value["href"] = without_arg_url
                 if query_dict:
@@ -430,7 +438,8 @@ class StacItem(StacCommon):
                     assets[asset_key]["href"] += f"/{asset_key}"
                 if asset_type := asset_value.get("type", None):
                     assets[asset_key]["type"] = asset_type
-                    assets[asset_key]["alternate"]["type"] = asset_type
+                    if origin := assets[asset_key].get("alternate", {}).get("origin"):
+                        origin["type"] = asset_type
 
         if thumbnail_url := product.properties.get(
             "quicklook", product.properties.get("thumbnail", None)


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
index 59ce5692..c947c90f 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -16,6 +16,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import contextlib
 import io
 import os
 import random
@@ -355,3 +356,19 @@ class EODagTestCase(unittest.TestCase):
                 pass
 
         return Response()
+
+
+@contextlib.contextmanager
+def temporary_environment(**env_vars):
+    # Save the original environment variables
+    original_env = os.environ.copy()
+
+    # Set the new temporary environment variables
+    os.environ.update(env_vars)
+
+    try:
+        yield
+    finally:
+        # Restore the original environment variables
+        os.environ.clear()
+        os.environ.update(original_env)
diff --git a/tests/units/test_http_server.py b/tests/units/test_http_server.py
index 3fd5f0b3..2a31c1fe 100644
--- a/tests/units/test_http_server.py
+++ b/tests/units/test_http_server.py
@@ -36,10 +36,11 @@ from shapely.geometry import box
 from eodag.config import PluginConfig
 from eodag.plugins.authentication.base import Authentication
 from eodag.plugins.download.base import Download
+from eodag.rest.config import Settings
 from eodag.rest.types.queryables import StacQueryables
 from eodag.utils import USER_AGENT, MockResponse, StreamResponse
 from eodag.utils.exceptions import NotAvailableError, TimeOutError
-from tests import mock
+from tests import mock, temporary_environment
 from tests.context import (
     DEFAULT_ITEMS_PER_PAGE,
     HTTP_REQ_TIMEOUT,
@@ -1044,6 +1045,38 @@ class RequestTestCase(unittest.TestCase):
             )
         )
 
+    def test_assets_alt_url_blacklist(self):
+        """Search through eodag server must not have alternate link if in blacklist"""
+        # no blacklist
+        response = self._request_valid(f"search?collections={self.tested_product_type}")
+        response_items = [f for f in response["features"]]
+        self.assertTrue(
+            all(["alternate" in i["assets"]["downloadLink"] for i in response_items]),
+            "alternate links are missing",
+        )
+
+        # with blacklist
+        try:
+            Settings.from_environment.cache_clear()
+            with temporary_environment(
+                EODAG_ORIGIN_URL_BLACKLIST="https://peps.cnes.fr"
+            ):
+                response = self._request_valid(
+                    f"search?collections={self.tested_product_type}"
+                )
+                response_items = [f for f in response["features"]]
+                self.assertTrue(
+                    all(
+                        [
+                            "alternate" not in i["assets"]["downloadLink"]
+                            for i in response_items
+                        ]
+                    ),
+                    "alternate links were not removed",
+                )
+        finally:
+            Settings.from_environment.cache_clear()
+
     @mock.patch(
         "eodag.rest.core.eodag_api.guess_product_type", autospec=True, return_value=[]
     )