feat: added network ID allowlist in DeDi registry plugin

This commit is contained in:
Nirmal N R
2026-03-24 11:33:11 +05:30
parent 6d4f45a632
commit 424dc1c64c
5 changed files with 62 additions and 39 deletions

View File

@@ -90,6 +90,23 @@ func TestDediRegistryProvider_New_InvalidTimeout(t *testing.T) {
}
}
func TestParseAllowedNetworkIDs(t *testing.T) {
got := parseAllowedNetworkIDs("commerce-network/subscriber-references, retail-network/subscriber-references, ,")
want := []string{
"commerce-network/subscriber-references",
"retail-network/subscriber-references",
}
if len(got) != len(want) {
t.Fatalf("expected %d allowed network IDs, got %d", len(want), len(got))
}
for i := range want {
if got[i] != want[i] {
t.Errorf("expected allowedNetworkIDs[%d] = %q, got %q", i, want[i], got[i])
}
}
}
func TestDediRegistryProvider_New_NilContext(t *testing.T) {
provider := dediRegistryProvider{}