@@ -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
@@ -559,6 +565,7 @@ def validate_api(
559565 transaction_collection : Optional [str ],
560566 headers : Optional [Dict [str , str ]],
561567 open_assets_urls : bool = True ,
568+ stac_check_config : Optional [str ] = None ,
562569) -> Tuple [Warnings , Errors ]:
563570 warnings = Warnings ()
564571 errors = Errors ()
@@ -610,15 +617,27 @@ def validate_api(
610617 if "collections" in ccs_to_validate :
611618 logger .info ("Validating STAC API - Collections conformance class." )
612619 validate_collections (
613- landing_page_body , collection , errors , warnings , r_session , open_assets_urls
620+ landing_page_body ,
621+ collection ,
622+ errors ,
623+ warnings ,
624+ r_session ,
625+ open_assets_urls ,
626+ stac_check_config ,
614627 )
615628
616629 conforms_to = landing_page_body .get ("conformsTo" , [])
617630
618631 if "features" in ccs_to_validate :
619632 logger .info ("Validating STAC API - Features conformance class." )
620633 validate_collections (
621- landing_page_body , collection , errors , warnings , r_session , open_assets_urls
634+ landing_page_body ,
635+ collection ,
636+ errors ,
637+ warnings ,
638+ r_session ,
639+ open_assets_urls ,
640+ stac_check_config ,
622641 )
623642 validate_features (
624643 landing_page_body ,
@@ -630,6 +649,7 @@ def validate_api(
630649 r_session ,
631650 validate_pagination ,
632651 open_assets_urls ,
652+ stac_check_config ,
633653 )
634654
635655 if "transaction" in ccs_to_validate :
@@ -981,6 +1001,7 @@ def validate_collections(
9811001 warnings : Warnings ,
9821002 r_session : Session ,
9831003 open_assets_urls : bool = True ,
1004+ stac_check_config : Optional [str ] = None ,
9841005) -> None :
9851006 if not (data_link := link_by_rel (root_body ["links" ], "data" )):
9861007 errors += f"[{ Context .COLLECTIONS } ] /: Link[rel=data] must href /collections"
@@ -1090,6 +1111,7 @@ def validate_collections(
10901111 Method .GET ,
10911112 open_assets_urls ,
10921113 r_session .headers ,
1114+ stac_check_config ,
10931115 )
10941116
10951117 # todo: collection pagination
@@ -1105,6 +1127,7 @@ def validate_features(
11051127 r_session : Session ,
11061128 validate_pagination : bool ,
11071129 open_assets_urls : bool = True ,
1130+ stac_check_config : Optional [str ] = None ,
11081131) -> None :
11091132 if not collection :
11101133 errors += f"[{ Context .FEATURES } ] Collection parameter required for running Features validations."
@@ -1211,6 +1234,7 @@ def validate_features(
12111234 Method .GET ,
12121235 open_assets_urls ,
12131236 r_session .headers ,
1237+ stac_check_config ,
12141238 )
12151239
12161240 # Validate Features non-existent item
@@ -1321,6 +1345,7 @@ def validate_features(
13211345 Method .GET ,
13221346 open_assets_urls ,
13231347 r_session .headers ,
1348+ stac_check_config ,
13241349 )
13251350
13261351 if validate_pagination :
0 commit comments