[Domains] Edit DNS Provider#1051
Merged
saeedvaziry merged 2 commits intovitodeploy:3.xfrom Mar 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an extensible DNS-provider “edit credentials” system so providers can optionally expose editable (non-sensitive) fields, validate optional edits, and merge updated credentials without leaking existing secrets to the client.
Changes:
- Backend: extend DNS provider contract with optional edit/merge/validation hooks; update edit action to validate provider-specific fields and reconnect when credentials change.
- Frontend: render provider-specific
edit_formfields in the DNS provider edit dialog and send updates without pre-filling sensitive values. - Tests: add/adjust feature + API coverage for “keep credentials when empty”, “update when provided”, and “reject invalid credentials”.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/DNSProvidersTest.php | Adds web UI feature tests for optional credential edits and validation failures. |
| tests/Feature/API/DNSProvidersTest.php | Adds API tests for optional credential edits, successful updates, and invalid credential rejection. |
| resources/js/types/index.d.ts | Extends DNS provider config typing with optional edit_form. |
| resources/js/types/dns-provider.d.ts | Adds editable_data to the DNSProvider type for edit form prefill. |
| resources/js/pages/dns-providers/components/columns.tsx | Updates edit dialog to dynamically render provider edit_form fields and submit edits. |
| app/Providers/DNSProviderServiceProvider.php | Registers Cloudflare edit form (token update) via editForm(). |
| app/Plugins/RegisterDNSProvider.php | Extends plugin registration to support optional provider edit_form. |
| app/Http/Resources/DNSProviderResource.php | Exposes editable_data from provider for frontend consumption. |
| app/DNSProviders/DNSProvider.php | Extends provider interface with editableData, mergeEditData, and editValidationRules. |
| app/DNSProviders/AbstractDNSProvider.php | Provides default no-op implementations for edit-related methods. |
| app/DNSProviders/Cloudflare.php | Implements Cloudflare-specific edit validation + credential merge for token updates. |
| app/Actions/DNSProvider/EditDNSProvider.php | Uses provider edit validation/merge and reconnects when credentials change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a robust and extensible optional system for editing DNS provider credentials, including support for custom edit forms, validation rules, and credential merging. The changes enable providers like Cloudflare to allow credential updates (such as API tokens) in a secure and user-friendly way, with proper validation and error handling. The frontend now dynamically renders editable fields based on provider configuration, and the backend ensures credentials are only updated when valid and provided, however the current credentials are NOT leaked back to the client and instead appear empty and are only updated when the details are populated.
Where new providers have been registered via plugins, the edit form is completely optional, and where no edit form has been provided, the current functionality of only being able to edit the name remains.
Comprehensive tests are added to verify the new edit behavior.
Backend: DNS Provider Edit System
DNSProviderinterface and base class (editableData,editValidationRules,mergeEditData) to support exposing, validating, and merging editable credential data for provider updates. [1] [2]EditDNSProvideraction to use provider-specific edit validation rules and credential merging logic, including reconnecting and error handling if credentials change.Frontend: Dynamic Edit Form Rendering
edit_formconfiguration and pre-fill non-sensitive data. [1] [2]editable_datain the DNSProvider API resource for use in the frontend.Testing: Credential Edit Behavior