Skip to content

[Domains] Edit DNS Provider#1051

Merged
saeedvaziry merged 2 commits intovitodeploy:3.xfrom
RichardAnderson:feat/dnsproviders/edit
Mar 17, 2026
Merged

[Domains] Edit DNS Provider#1051
saeedvaziry merged 2 commits intovitodeploy:3.xfrom
RichardAnderson:feat/dnsproviders/edit

Conversation

@RichardAnderson
Copy link
Member

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.

CleanShot 2026-03-17 at 09 17 32

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

  • Added new methods to the DNSProvider interface and base class (editableData, editValidationRules, mergeEditData) to support exposing, validating, and merging editable credential data for provider updates. [1] [2]
  • Updated the EditDNSProvider action to use provider-specific edit validation rules and credential merging logic, including reconnecting and error handling if credentials change.
  • Implemented Cloudflare-specific edit validation and credential merging, allowing the API token to be updated securely.

Frontend: Dynamic Edit Form Rendering

  • Enhanced the edit dialog in the DNS Providers UI to dynamically render editable credential fields using provider-specific edit_form configuration and pre-fill non-sensitive data. [1] [2]
  • Added support for registering custom edit forms for providers, including Cloudflare, via the plugin system. [1] [2] [3] [4]
  • Exposed editable_data in the DNSProvider API resource for use in the frontend.

Testing: Credential Edit Behavior

  • Added tests to verify that credentials are only updated when new values are provided, remain unchanged when fields are empty, and that invalid credentials are rejected with proper error handling. [1] [2] [3] [4]

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_form fields 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.

@saeedvaziry saeedvaziry merged commit 4a3dfa6 into vitodeploy:3.x Mar 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants