Skip to content

Feature/crd validation 366 - #416

Merged
OtowoSamuel merged 4 commits into
OtowoOrg:mainfrom
lettalkdata-cloud:feature/crd-validation-366
Mar 31, 2026
Merged

Feature/crd validation 366#416
OtowoSamuel merged 4 commits into
OtowoOrg:mainfrom
lettalkdata-cloud:feature/crd-validation-366

Conversation

@lettalkdata-cloud

Copy link
Copy Markdown
Contributor

Description
This PR enhances the security and stability of the StellarNetwork resource by implementing strict OpenAPI v3 validation. By enforcing naming constraints at the CRD level, we eliminate the risk of empty strings or malicious injection attacks (e.g., shell characters or SQL-style fragments) from entering the cluster state.

Key Changes
Schema Validation: Added regex pattern matching to enforce DNS-1123 compliance for network names.

Boundary Checks: Implemented minLength and maxLength constraints to ensure data integrity.

Code Generation: Regenerated the CRD manifests using controller-gen to sync the Go annotations with the YAML definitions.

Security Hardening: Provided a "fail-fast" mechanism that rejects malformed manifests at the API server level.

Validation Results
[x] Positive Test: Successfully applied a network with name testnet-v2.

[x] Negative Test (Regex): Verified rejection of network@name and network_name.

[x] Negative Test (Empty): Verified rejection of empty strings.

[x] CI Verified: All make manifests and linting checks passed locally.

PR Checklist
[x] Branch feature/crd-validation-366 created and pushed.

[x] Validation logic implemented in the CRD module.

[x] No breaking changes to existing valid network configurations.

Closes #366

@OtowoSamuel
OtowoSamuel merged commit 8324047 into OtowoOrg:main Mar 31, 2026
3 of 9 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.

Add validation for 'StellarNetwork' custom names

2 participants