Skip to content

[management] unify domain validation into single package used #4304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pascal-fischer
Copy link
Collaborator

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 13:25
Copy link
Contributor

@Copilot 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 consolidates domain validation logic across the codebase by introducing unified validation functions in the shared domain package and replacing scattered validation implementations throughout the management server.

  • Introduces IsValidDomain and ToValidDomain functions in the shared domain package
  • Removes duplicate domain validation regex patterns from multiple files
  • Updates all domain validation calls to use the centralized validation functions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
shared/management/domain/validate.go Adds new unified domain validation functions and refactors existing validation logic
management/server/networks/resources/types/resource.go Replaces local domain regex with shared validation function
management/server/nameserver.go Removes local domain validation implementation in favor of shared function
management/server/account.go Replaces local domain validation regex with shared validation function

Copy link

sonarqubecloud bot commented Aug 8, 2025

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.

1 participant