Skip to content

Commit

Permalink
Merge pull request #682 from matheuscscp/fix-address-validation
Browse files Browse the repository at this point in the history
Remove URL syntax validation for provider address entirely
  • Loading branch information
stefanprodan authored Dec 13, 2023
2 parents e48be82 + 143a0b3 commit 73e1965
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions internal/server/event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@ func createNotifier(ctx context.Context, kubeClient client.Client, provider apiv
return nil, "", fmt.Errorf("invalid address in secret: address exceeds maximum length of %d bytes", 2048)
}
webhook = string(address)
_, err := url.Parse(webhook)
if err != nil {
return nil, "", fmt.Errorf("invalid address in secret '%s': %w", webhook, err)
}
}

if p, ok := secret.Data["password"]; ok {
Expand Down
11 changes: 0 additions & 11 deletions internal/server/event_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,17 +570,6 @@ func TestCreateNotifier(t *testing.T) {
"headers": []byte(`foo: bar`),
},
},
{
name: "reference to secret with invalid address",
providerSpec: &apiv1beta3.ProviderSpec{
Type: "slack",
SecretRef: &meta.LocalObjectReference{Name: secretName},
},
secretData: map[string][]byte{
"address": []byte("https://example.com|"),
},
wantErr: true,
},
{
name: "reference to secret with invalid proxy",
providerSpec: &apiv1beta3.ProviderSpec{
Expand Down

0 comments on commit 73e1965

Please sign in to comment.