Fix/Multiple Reply in Git Provider#37
Conversation
LiveReview Pre-Commit Check: ran (iter:4, coverage:64%)
LiveReview Pre-Commit Check: ran (iter:1, coverage:0%)
Severity: info Implement Conditional Webhook Registry UpdatesOverviewIntroduced a Technical Highlights
Impact
|
| } | ||
|
|
||
| // Validate connector ownership | ||
| if _, err := s.validateConnectorOwnership(c, id); err != nil { |
There was a problem hiding this comment.
Severity: critical
Crucial security check: ensures a user can only delete connectors they own.
Suggestions:
- Verify
validateConnectorOwnershipcovers all necessary authorization checks.
| Provider string `json:"provider"` | ||
| BaseURL string `json:"base_url"` | ||
| PAT string `json:"pat"` | ||
| SkipRegistryUpdate bool `json:"skip_registry_update"` |
There was a problem hiding this comment.
The webhook delete queue function had a DB update dependency.
- Delete webhook from provider
- Update
webhook_registrytable data.
Proposed API for Deleting Git Connector Have this.
- Get webhook from the DB and then create job to delete it.
LiveReview/internal/api/connectors.go
Line 494 in c8725f3
- Delete the integration token.
LiveReview/internal/api/connectors.go
Line 501 in c8725f3
As itwebhook_registryis a child table, it will be also deleted. - Return response to UI
So, as I don't want to update webhook_registrythe table, I will skip it.
let me know if the variable name needs update.
There was a problem hiding this comment.
The variable name SkipRegistryUpdate is clear and accurately reflects its purpose. It's a good choice given the context you've provided about the webhook_registry table being automatically deleted when the parent integration_tokens (connector) is removed.
This PR is for solving this issue: #35
Problem
As the main problem was with the webhook. On deleting any connector, it was not deleting the webhook that was created on initial connection.
Solution
On delete, the controller API is called.