cozystack/pkg
Aleksei Sviridkin be40ac55c6
fix(api): tighten tenant name regex and add regression guards
Two follow-ups from review:

1. The original tenantNameRegex ^[a-z0-9]+$ let leading-digit names like 123foo slip past the tenant check and receive a generic DNS-1035 error, which defeated the goal of surfacing a tenant-specific message. Require a leading lowercase letter so every tenant-invalid name returns the tenant-contract error.

2. Add a BATS regression test in hack/e2e-install-cozystack.bats that exercises the aggregated API end-to-end. Unit tests construct REST{kindName: "Tenant"} by hand, so a future change to ApplicationDefinition kind registration could break real behavior without breaking the unit tests.

Also pin the error-message contract with a new TestValidateApplicationName_TenantErrorMessage that asserts every tenant-invalid input returns a message containing 'tenant names must' (not the generic DNS-1035 text).

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-04-12 14:16:41 +03:00
..
apis fix(api): tighten tenant name regex and add regression guards 2026-04-12 14:16:41 +03:00
apiserver [docs] Added openapi generation tool 2026-03-25 15:57:25 +05:00
cmd/server [docs] Updated app go types 2026-03-25 15:57:25 +05:00
config refactor(api): remove rootHost-based name length validation 2026-02-12 13:52:37 +03:00
generated fix(codegen): add gen_client to update-codegen.sh and regenerate applyconfiguration 2026-02-16 23:01:38 +03:00
lineage feat(api): add chartRef to CozystackResourceDefinition 2026-01-14 16:09:43 +01:00
ovnstatus [kubeovn] Implement the KubeOVN plunger 2025-09-11 02:11:58 +03:00
registry fix(api): reject tenant names with dashes at Create time 2026-04-12 14:16:40 +03:00
version refactor(telemetry): split telemetry between operator and controller 2026-01-19 13:52:15 +01:00