Skip to content

feat(provider.namecom): add Name.com DNS provider support#629

Open
Copilot wants to merge 4 commits into
masterfrom
copilot/add-name-com-support
Open

feat(provider.namecom): add Name.com DNS provider support#629
Copilot wants to merge 4 commits into
masterfrom
copilot/add-name-com-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 20, 2025

  • Create Name.com provider implementation (ddns/provider/namecom.py)
    • Implement NamecomProvider class inheriting from BaseProvider
    • Use HTTP Basic Authentication with username:token
    • Implement _request() method for authenticated API calls
    • Implement _query_zone_id() - use domain name as zone_id
    • Implement _query_record() - list and find DNS records
    • Implement _create_record() - create new DNS records
    • Implement _update_record() - update existing DNS records
  • Register provider in ddns/provider/__init__.py with aliases: namecom, name.com, name_com
  • Create unit tests (tests/test_provider_namecom.py) - 37 tests passing
    • Test initialization and validation
    • Test all CRUD methods with mocked HTTP
    • Test full workflow integration
    • Test TTL edge cases (including TTL=0)
    • Verify TTL field is absent when None is passed
  • Create Chinese documentation (doc/providers/namecom.md)
  • Create English documentation (doc/providers/namecom.en.md)
  • Update provider index (README.md and README.en.md)
  • Format and lint code with ruff
  • Run tests to verify implementation (all tests passing)
  • Run code review and address feedback
    • Move import to top of test file
    • Fix TTL enforcement for TTL=0 case
    • Add test for TTL=0 edge case
    • Remove unused MagicMock import
    • Verify TTL field absence when None passed
  • Run CodeQL security scan (no issues found)
Original prompt

This section details on the original issue you should resolve

<issue_title>[dns] 希望能支持name.com</issue_title>
<issue_description>## DNS 服务商信息

  • 官网 (Website): name.com
  • 中文名称 (Chinese Name): name
  • 英文名称 (English Name): name
  • 标准DNS服务商 (Standard DNS Provider): Yes

DNS 服务商文档链接

请提供以下相关文档的链接(如有):

  • API 认证与签名 (Authorization & Signature):
  • 查询/列出域名 (Query/List Domains):
  • 查询/列出解析记录 (Query/List DNS Records):
  • 创建解析记录 (Create DNS Record):
  • 修改解析记录 (Update DNS Record):
  • 其它配置或使用文档 (Other Configuration/Usage Docs, 可选):
  • 官方或第三方Python SDK (Official or Third-party Python SDK, 可选):

其他补充信息(可选)

请补充任何有助于集成该 DNS 服务商的信息,例如常见问题、注意事项、特殊限制等。
</issue_description>

<agent_instructions>请基于互联网上最新Name.com API 去实现性的provider</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@NewFuture @Seifon 确认一下API对吗?或者补充一下链接

Custom agent used: New Provider Agent
create new DNS provider implementations in the DDNS project


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 20, 2025
Copilot AI and others added 2 commits December 20, 2025 10:49
Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com>
Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for name.com DNS provider feat(provider.namecom): add Name.com DNS provider support Dec 20, 2025
Copilot AI requested a review from NewFuture December 20, 2025 10:56
@NewFuture NewFuture requested a review from Copilot December 20, 2025 11:32
Copy link
Copy Markdown
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

This PR adds comprehensive support for Name.com as a DNS provider, implementing the full CRUD interface through their Core API with HTTP Basic Authentication. The implementation follows established project patterns and includes extensive test coverage and bilingual documentation.

Key changes:

  • New BaseProvider implementation with HTTP Basic Auth using username and API token
  • Enforces Name.com's minimum TTL requirement of 300 seconds
  • 37 comprehensive test cases covering validation, CRUD operations, TTL enforcement, and integration workflows

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ddns/provider/namecom.py Core provider implementation with full CRUD operations and TTL enforcement
ddns/provider/__init__.py Provider registration with three aliases (namecom, name.com, name_com)
tests/test_provider_namecom.py Comprehensive test suite with 37 test cases covering all provider functionality
doc/providers/namecom.md Chinese documentation with configuration guide, examples, and troubleshooting
doc/providers/namecom.en.md English documentation mirroring Chinese version
doc/providers/README.md Added Name.com to provider index table
doc/providers/README.en.md Added Name.com to English provider index table

Comment thread tests/test_provider_namecom.py
Comment thread tests/test_provider_namecom.py
Comment thread tests/test_provider_namecom.py Outdated
@NewFuture
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 20, 2025

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in commit 7fd32f2:

  • Removed unused MagicMock import
  • Added TTL field absence assertions in test_create_record_failure and test_create_record_root_domain

@NewFuture NewFuture requested a review from Copilot December 20, 2025 15:02
@NewFuture NewFuture marked this pull request as ready for review December 20, 2025 15:02
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@NewFuture NewFuture mentioned this pull request Dec 20, 2025
7 tasks
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.

[dns] 希望能支持name.com

3 participants