@@ -352,7 +352,7 @@ func TestUpsertPlugin_CreatesAndPersists(t *testing.T) {
352352 Flows : []Flow {FlowRequest , FlowResponse },
353353 }
354354
355- result , err := cfg .UpsertPlugin (CategoryAuthentication , entry )
355+ result , err := cfg .UpsertPlugin (CategoryAuthentication . String () , entry )
356356 require .NoError (t , err )
357357 require .Equal (t , "created" , string (result ))
358358
@@ -394,7 +394,7 @@ func TestUpsertPlugin_UpdatesExisting(t *testing.T) {
394394 Flows : []Flow {FlowRequest , FlowResponse },
395395 }
396396
397- result , err := cfg .UpsertPlugin (CategoryAuthentication , entry )
397+ result , err := cfg .UpsertPlugin (CategoryAuthentication . String () , entry )
398398 require .NoError (t , err )
399399 require .Equal (t , "updated" , string (result ))
400400
@@ -426,7 +426,7 @@ func TestDeletePlugin_RemovesAndPersists(t *testing.T) {
426426
427427 require .NoError (t , cfg .saveConfig ())
428428
429- result , err := cfg .DeletePlugin (CategoryAuthentication , "jwt-auth" )
429+ result , err := cfg .DeletePlugin (CategoryAuthentication . String () , "jwt-auth" )
430430 require .NoError (t , err )
431431 require .Equal (t , "deleted" , string (result ))
432432
@@ -473,14 +473,14 @@ flows = ["request"]
473473 require .True (t , ok , "Config should support plugin operations" )
474474
475475 // Verify plugins loaded.
476- authPlugins := pluginCfg .ListPlugins (CategoryAuthentication )
476+ authPlugins := pluginCfg .ListPlugins (CategoryAuthentication . String () )
477477 require .Len (t , authPlugins , 1 )
478478 require .Equal (t , "jwt-auth" , authPlugins [0 ].Name )
479479 require .Equal (t , "abc123" , * authPlugins [0 ].CommitHash )
480480 require .True (t , * authPlugins [0 ].Required )
481481 require .Equal (t , []Flow {FlowRequest , FlowResponse }, authPlugins [0 ].Flows )
482482
483- obsPlugins := pluginCfg .ListPlugins (CategoryObservability )
483+ obsPlugins := pluginCfg .ListPlugins (CategoryObservability . String () )
484484 require .Len (t , obsPlugins , 1 )
485485 require .Equal (t , "metrics" , obsPlugins [0 ].Name )
486486 require .Equal (t , []Flow {FlowRequest }, obsPlugins [0 ].Flows )
@@ -524,7 +524,7 @@ func TestLoad_StaticTestdata_BasicPlugins(t *testing.T) {
524524 pluginCfg , ok := cfg .(* Config )
525525 require .True (t , ok )
526526
527- authPlugins := pluginCfg .ListPlugins (CategoryAuthentication )
527+ authPlugins := pluginCfg .ListPlugins (CategoryAuthentication . String () )
528528 require .Len (t , authPlugins , 1 )
529529 require .Equal (t , "jwt-auth" , authPlugins [0 ].Name )
530530 require .NotNil (t , authPlugins [0 ].CommitHash )
@@ -548,26 +548,26 @@ func TestLoad_StaticTestdata_MultiplePlugins(t *testing.T) {
548548 pluginCfg , ok := cfg .(* Config )
549549 require .True (t , ok )
550550
551- authPlugins := pluginCfg .ListPlugins (CategoryAuthentication )
551+ authPlugins := pluginCfg .ListPlugins (CategoryAuthentication . String () )
552552 require .Len (t , authPlugins , 2 )
553553 require .Equal (t , "jwt-auth" , authPlugins [0 ].Name )
554554 require .Equal (t , "api-key-auth" , authPlugins [1 ].Name )
555555
556- authzPlugins := pluginCfg .ListPlugins (CategoryAuthorization )
556+ authzPlugins := pluginCfg .ListPlugins (CategoryAuthorization . String () )
557557 require .Len (t , authzPlugins , 1 )
558558 require .Equal (t , "rbac" , authzPlugins [0 ].Name )
559559 require .True (t , * authzPlugins [0 ].Required )
560560
561- rateLimitPlugins := pluginCfg .ListPlugins (CategoryRateLimiting )
561+ rateLimitPlugins := pluginCfg .ListPlugins (CategoryRateLimiting . String () )
562562 require .Len (t , rateLimitPlugins , 1 )
563563 require .Equal (t , "token-bucket" , rateLimitPlugins [0 ].Name )
564564
565- obsPlugins := pluginCfg .ListPlugins (CategoryObservability )
565+ obsPlugins := pluginCfg .ListPlugins (CategoryObservability . String () )
566566 require .Len (t , obsPlugins , 1 )
567567 require .Equal (t , "metrics" , obsPlugins [0 ].Name )
568568 require .Equal (t , []Flow {FlowRequest , FlowResponse }, obsPlugins [0 ].Flows )
569569
570- auditPlugins := pluginCfg .ListPlugins (CategoryAudit )
570+ auditPlugins := pluginCfg .ListPlugins (CategoryAudit . String () )
571571 require .Len (t , auditPlugins , 1 )
572572 require .Equal (t , "compliance-logger" , auditPlugins [0 ].Name )
573573 require .Equal (t , []Flow {FlowResponse }, auditPlugins [0 ].Flows )
@@ -587,13 +587,13 @@ func TestLoad_StaticTestdata_MinimalPlugins(t *testing.T) {
587587 pluginCfg , ok := cfg .(* Config )
588588 require .True (t , ok )
589589
590- require .Len (t , pluginCfg .ListPlugins (CategoryAuthentication ), 0 )
591- require .Len (t , pluginCfg .ListPlugins (CategoryAuthorization ), 0 )
592- require .Len (t , pluginCfg .ListPlugins (CategoryRateLimiting ), 0 )
593- require .Len (t , pluginCfg .ListPlugins (CategoryValidation ), 0 )
594- require .Len (t , pluginCfg .ListPlugins (CategoryContent ), 0 )
595- require .Len (t , pluginCfg .ListPlugins (CategoryObservability ), 0 )
596- require .Len (t , pluginCfg .ListPlugins (CategoryAudit ), 0 )
590+ require .Len (t , pluginCfg .ListPlugins (CategoryAuthentication . String () ), 0 )
591+ require .Len (t , pluginCfg .ListPlugins (CategoryAuthorization . String () ), 0 )
592+ require .Len (t , pluginCfg .ListPlugins (CategoryRateLimiting . String () ), 0 )
593+ require .Len (t , pluginCfg .ListPlugins (CategoryValidation . String () ), 0 )
594+ require .Len (t , pluginCfg .ListPlugins (CategoryContent . String () ), 0 )
595+ require .Len (t , pluginCfg .ListPlugins (CategoryObservability . String () ), 0 )
596+ require .Len (t , pluginCfg .ListPlugins (CategoryAudit . String () ), 0 )
597597}
598598
599599func TestLoad_StaticTestdata_InvalidPlugins (t * testing.T ) {
@@ -663,19 +663,19 @@ func TestLoadSaveRoundTrip_Plugins(t *testing.T) {
663663 reloadedConfig , ok := reloaded .(* Config )
664664 require .True (t , ok )
665665
666- authPlugins := reloadedConfig .ListPlugins (CategoryAuthentication )
666+ authPlugins := reloadedConfig .ListPlugins (CategoryAuthentication . String () )
667667 require .Len (t , authPlugins , 2 )
668668
669- authzPlugins := reloadedConfig .ListPlugins (CategoryAuthorization )
669+ authzPlugins := reloadedConfig .ListPlugins (CategoryAuthorization . String () )
670670 require .Len (t , authzPlugins , 1 )
671671
672- rateLimitPlugins := reloadedConfig .ListPlugins (CategoryRateLimiting )
672+ rateLimitPlugins := reloadedConfig .ListPlugins (CategoryRateLimiting . String () )
673673 require .Len (t , rateLimitPlugins , 1 )
674674
675- obsPlugins := reloadedConfig .ListPlugins (CategoryObservability )
675+ obsPlugins := reloadedConfig .ListPlugins (CategoryObservability . String () )
676676 require .Len (t , obsPlugins , 1 )
677677
678- auditPlugins := reloadedConfig .ListPlugins (CategoryAudit )
678+ auditPlugins := reloadedConfig .ListPlugins (CategoryAudit . String () )
679679 require .Len (t , auditPlugins , 1 )
680680
681681 require .Equal (t , "jwt-auth" , authPlugins [0 ].Name )
0 commit comments