@@ -375,10 +375,16 @@ def stac_check(
375375 method : Method = Method .GET ,
376376 open_assets_urls : bool = True ,
377377 headers : Optional [dict ] = None ,
378+ config_file : Optional [str ] = None ,
378379) -> None :
379380 try :
380381 logger .debug (f"stac-check validation: { url } " )
381- linter = Linter (url , assets_open_urls = open_assets_urls , headers = headers or {})
382+ linter = Linter (
383+ url ,
384+ config_file = config_file ,
385+ assets_open_urls = open_assets_urls ,
386+ headers = headers or {},
387+ )
382388 if not linter .valid_stac :
383389 errors += f"[{ context } ] : { method } { url } is not a valid STAC object: { linter .error_msg } "
384390 if msgs := linter .best_practices_msg [1 :]: # first msg is a header, so skip
@@ -560,6 +566,7 @@ def validate_api(
560566 transaction_collection : Optional [str ],
561567 headers : Optional [Dict [str , str ]],
562568 open_assets_urls : bool = True ,
569+ stac_check_config : Optional [str ] = None ,
563570) -> Tuple [Warnings , Errors ]:
564571 warnings = Warnings ()
565572 errors = Errors ()
@@ -611,15 +618,27 @@ def validate_api(
611618 if "collections" in ccs_to_validate :
612619 logger .info ("Validating STAC API - Collections conformance class." )
613620 validate_collections (
614- landing_page_body , collection , errors , warnings , r_session , open_assets_urls
621+ landing_page_body ,
622+ collection ,
623+ errors ,
624+ warnings ,
625+ r_session ,
626+ open_assets_urls ,
627+ stac_check_config ,
615628 )
616629
617630 conforms_to = landing_page_body .get ("conformsTo" , [])
618631
619632 if "features" in ccs_to_validate :
620633 logger .info ("Validating STAC API - Features conformance class." )
621634 validate_collections (
622- landing_page_body , collection , errors , warnings , r_session , open_assets_urls
635+ landing_page_body ,
636+ collection ,
637+ errors ,
638+ warnings ,
639+ r_session ,
640+ open_assets_urls ,
641+ stac_check_config ,
623642 )
624643 validate_features (
625644 landing_page_body ,
@@ -631,6 +650,7 @@ def validate_api(
631650 r_session ,
632651 validate_pagination ,
633652 open_assets_urls ,
653+ stac_check_config ,
634654 )
635655
636656 if "transaction" in ccs_to_validate :
@@ -982,6 +1002,7 @@ def validate_collections(
9821002 warnings : Warnings ,
9831003 r_session : Session ,
9841004 open_assets_urls : bool = True ,
1005+ stac_check_config : Optional [str ] = None ,
9851006) -> None :
9861007 if not (data_link := link_by_rel (root_body ["links" ], "data" )):
9871008 errors += f"[{ Context .COLLECTIONS } ] /: Link[rel=data] must href /collections"
@@ -1091,6 +1112,7 @@ def validate_collections(
10911112 Method .GET ,
10921113 open_assets_urls ,
10931114 r_session .headers ,
1115+ stac_check_config ,
10941116 )
10951117
10961118 # todo: collection pagination
@@ -1106,6 +1128,7 @@ def validate_features(
11061128 r_session : Session ,
11071129 validate_pagination : bool ,
11081130 open_assets_urls : bool = True ,
1131+ stac_check_config : Optional [str ] = None ,
11091132) -> None :
11101133 if not geometry :
11111134 errors += f"[{ Context .FEATURES } ] Geometry parameter required for running Features validations."
@@ -1216,6 +1239,7 @@ def validate_features(
12161239 Method .GET ,
12171240 open_assets_urls ,
12181241 r_session .headers ,
1242+ stac_check_config ,
12191243 )
12201244
12211245 # Validate Features non-existent item
@@ -1326,6 +1350,7 @@ def validate_features(
13261350 Method .GET ,
13271351 open_assets_urls ,
13281352 r_session .headers ,
1353+ stac_check_config ,
13291354 )
13301355
13311356 if validate_pagination :
0 commit comments