File tree Expand file tree Collapse file tree
tests/apigw_manager/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -713,6 +713,22 @@ def build_bk_access_token_source(
713713 }
714714
715715
716+ def build_bk_username_required () -> Dict [str , str ]:
717+ """generate bk-username-required plugin config
718+
719+ Returns:
720+ {
721+ "type": "bk-username-required",
722+ "yaml": ""
723+ }
724+ """
725+
726+ return {
727+ "type" : "bk-username-required" ,
728+ "yaml" : "" ,
729+ }
730+
731+
716732def _check_percentage (percentage : int , location : str ):
717733 if percentage and not (0 < percentage <= 100 ):
718734 raise ValueError (f"The percentage of { location } must be greater than 0 and less than or equal to 100" )
Original file line number Diff line number Diff line change 2121 build_response_rewrite ,
2222 build_redirect ,
2323 build_bk_access_token_source ,
24+ build_bk_username_required ,
2425 build_stage_plugin_config_for_definition_yaml ,
2526 UnhealthyConfig ,
2627 HealthyConfig ,
@@ -632,7 +633,7 @@ def test_build_redirect(
632633 ),
633634 ]
634635 )
635- def test_build_redirect (
636+ def test_build_bk_access_token_source (
636637 self , source , will_error , expected
637638 ):
638639 if will_error :
@@ -642,6 +643,20 @@ def test_build_redirect(
642643
643644 assert build_bk_access_token_source (source ) == expected
644645
646+ @pytest .mark .parametrize (
647+ "expected" ,
648+ [
649+ {
650+ "type" : "bk-username-required" ,
651+ "yaml" : ""
652+ },
653+ ]
654+ )
655+ def test_build_bk_username_required (
656+ self , expected
657+ ):
658+ assert build_bk_username_required () == expected
659+
645660
646661class TestBuildStagePluginConfigForDefinitionYaml :
647662 def test_build_stage_plugin_config_for_definition_yaml (self ):
You can’t perform that action at this time.
0 commit comments