@@ -746,12 +746,7 @@ func TestConnectionAuthenticationTypes(t *testing.T) {
746746 destConfig , ok := dest ["config" ].(map [string ]interface {})
747747 require .True (t , ok , "Expected destination config object" )
748748
749- if authMethod , ok := destConfig ["auth_method" ].(map [string ]interface {}); ok {
750- assert .Equal (t , "API_KEY" , authMethod ["type" ], "Auth type should be API_KEY" )
751- assert .Equal (t , "X-API-Key" , authMethod ["key" ], "Auth key should be X-API-Key" )
752- assert .Equal (t , "header" , authMethod ["to" ], "Auth location should be header" )
753- // API key itself should not be returned for security
754- }
749+ assert .Equal (t , "API_KEY" , destConfig ["auth_type" ], "Auth type should be API_KEY" )
755750
756751 // Cleanup
757752 t .Cleanup (func () {
@@ -804,11 +799,7 @@ func TestConnectionAuthenticationTypes(t *testing.T) {
804799 destConfig , ok := dest ["config" ].(map [string ]interface {})
805800 require .True (t , ok , "Expected destination config object" )
806801
807- if authMethod , ok := destConfig ["auth_method" ].(map [string ]interface {}); ok {
808- assert .Equal (t , "API_KEY" , authMethod ["type" ], "Auth type should be API_KEY" )
809- assert .Equal (t , "api_key" , authMethod ["key" ], "Auth key should be api_key" )
810- assert .Equal (t , "query" , authMethod ["to" ], "Auth location should be query" )
811- }
802+ assert .Equal (t , "API_KEY" , destConfig ["auth_type" ], "Auth type should be API_KEY" )
812803
813804 // Cleanup
814805 t .Cleanup (func () {
@@ -859,11 +850,7 @@ func TestConnectionAuthenticationTypes(t *testing.T) {
859850 destConfig , ok := dest ["config" ].(map [string ]interface {})
860851 require .True (t , ok , "Expected destination config object" )
861852
862- if authMethod , ok := destConfig ["auth_method" ].(map [string ]interface {}); ok {
863- assert .Equal (t , "CUSTOM_SIGNATURE" , authMethod ["type" ], "Auth type should be CUSTOM_SIGNATURE" )
864- assert .Equal (t , "X-Signature" , authMethod ["key" ], "Auth key should be X-Signature" )
865- // Signing secret should not be returned for security
866- }
853+ assert .Equal (t , "CUSTOM_SIGNATURE" , destConfig ["auth_type" ], "Auth type should be CUSTOM_SIGNATURE" )
867854
868855 // Cleanup
869856 t .Cleanup (func () {
@@ -913,9 +900,7 @@ func TestConnectionAuthenticationTypes(t *testing.T) {
913900 require .True (t , ok , "Expected destination config object" )
914901
915902 // Hookdeck signature should be set as the auth type
916- if authMethod , ok := destConfig ["auth_method" ].(map [string ]interface {}); ok {
917- assert .Equal (t , "HOOKDECK_SIGNATURE" , authMethod ["type" ], "Auth type should be HOOKDECK_SIGNATURE" )
918- }
903+ assert .Equal (t , "HOOKDECK_SIGNATURE" , destConfig ["auth_type" ], "Auth type should be HOOKDECK_SIGNATURE" )
919904
920905 // Cleanup
921906 t .Cleanup (func () {
@@ -983,10 +968,7 @@ func TestConnectionAuthenticationTypes(t *testing.T) {
983968 updateDestConfig , ok := updateDest ["config" ].(map [string ]interface {})
984969 require .True (t , ok , "Expected destination config object in update response" )
985970
986- if authMethod , ok := updateDestConfig ["auth_method" ].(map [string ]interface {}); ok {
987- assert .Equal (t , "API_KEY" , authMethod ["type" ], "Auth type should be updated to API_KEY" )
988- assert .Equal (t , "X-API-Key" , authMethod ["key" ], "Auth key should be X-API-Key" )
989- }
971+ assert .Equal (t , "API_KEY" , updateDestConfig ["auth_type" ], "Auth type should be updated to API_KEY" )
990972
991973 // Update to Hookdeck signature (reset to default)
992974 stdout , stderr , err = cli .Run ("connection" , "upsert" , connName ,
@@ -1007,9 +989,7 @@ func TestConnectionAuthenticationTypes(t *testing.T) {
1007989 resetDestConfig , ok := resetDest ["config" ].(map [string ]interface {})
1008990 require .True (t , ok , "Expected destination config object in reset response" )
1009991
1010- if authMethod , ok := resetDestConfig ["auth_method" ].(map [string ]interface {}); ok {
1011- assert .Equal (t , "HOOKDECK_SIGNATURE" , authMethod ["type" ], "Auth type should be reset to HOOKDECK_SIGNATURE" )
1012- }
992+ assert .Equal (t , "HOOKDECK_SIGNATURE" , resetDestConfig ["auth_type" ], "Auth type should be reset to HOOKDECK_SIGNATURE" )
1013993
1014994 t .Logf ("Successfully tested changing authentication methods via upsert: %s" , connID )
1015995 })
0 commit comments