diff --git a/pkg/plugin/implementation/dediregistry/cmd/plugin.go b/pkg/plugin/implementation/dediregistry/cmd/plugin.go index 3714fb1..a70e3a6 100644 --- a/pkg/plugin/implementation/dediregistry/cmd/plugin.go +++ b/pkg/plugin/implementation/dediregistry/cmd/plugin.go @@ -36,7 +36,7 @@ func (d dediRegistryProvider) New(ctx context.Context, config map[string]string) } } - allowedNetworkIDs, err := resolveAllowedNetworkIDs(ctx, config) + allowedNetworkIDs, err := resolveAllowedNetworkIDs(config) if err != nil { return nil, nil, err } @@ -67,7 +67,7 @@ func parseAllowedNetworkIDs(raw string) []string { return networkIDs } -func resolveAllowedNetworkIDs(ctx context.Context, config map[string]string) ([]string, error) { +func resolveAllowedNetworkIDs(config map[string]string) ([]string, error) { if rawParentNamespaces, exists := config["allowedParentNamespaces"]; exists && rawParentNamespaces != "" { if _, hasAllowedNetworkIDs := config["allowedNetworkIDs"]; !hasAllowedNetworkIDs { return nil, fmt.Errorf("config key 'allowedParentNamespaces' is no longer supported; use 'allowedNetworkIDs' with full network IDs") diff --git a/pkg/plugin/implementation/dediregistry/cmd/plugin_test.go b/pkg/plugin/implementation/dediregistry/cmd/plugin_test.go index 083d30f..4dafe8b 100644 --- a/pkg/plugin/implementation/dediregistry/cmd/plugin_test.go +++ b/pkg/plugin/implementation/dediregistry/cmd/plugin_test.go @@ -108,12 +108,11 @@ func TestParseAllowedNetworkIDs(t *testing.T) { } func TestResolveAllowedNetworkIDs_DeprecatedAllowedParentNamespacesErrorsWithoutAllowedNetworkIDs(t *testing.T) { - ctx := context.Background() config := map[string]string{ "allowedParentNamespaces": "commerce-network.org/prod, local-commerce.org/production", } - got, err := resolveAllowedNetworkIDs(ctx, config) + got, err := resolveAllowedNetworkIDs(config) if err == nil { t.Fatal("expected error when only allowedParentNamespaces is configured") } @@ -123,7 +122,6 @@ func TestResolveAllowedNetworkIDs_DeprecatedAllowedParentNamespacesErrorsWithout } func TestResolveAllowedNetworkIDs_AllowedNetworkIDsTakesPrecedence(t *testing.T) { - ctx := context.Background() config := map[string]string{ "url": "https://test.com/dedi", "registryName": "subscribers.beckn.one", @@ -131,7 +129,7 @@ func TestResolveAllowedNetworkIDs_AllowedNetworkIDsTakesPrecedence(t *testing.T) "allowedNetworkIDs": "commerce-network.org/prod, local-commerce.org/production", } - got, err := resolveAllowedNetworkIDs(ctx, config) + got, err := resolveAllowedNetworkIDs(config) if err != nil { t.Fatalf("expected no error, got %v", err) }