Tighten MSP workspace tier limits

This commit is contained in:
rcourtman 2026-06-01 16:55:23 +01:00
parent e450c6a4da
commit 914465e67f
8 changed files with 36 additions and 12 deletions

View file

@ -186,9 +186,9 @@ var CloudPlanWorkspaceLimits = map[string]int{
"cloud_founding": 1,
// MSP tiers — client caps from pricing spec
"msp_starter": 10, // MSP Starter: up to 10 clients
"msp_growth": 25, // MSP Growth: up to 25 clients
"msp_scale": 50, // MSP Scale: up to 50 clients
"msp_starter": 5, // MSP Starter: up to 5 clients
"msp_growth": 15, // MSP Growth: up to 15 clients
"msp_scale": 40, // MSP Scale: up to 40 clients
}
// UnknownPlanDefaultWorkspaceLimit is the safe-default workspace limit applied

View file

@ -584,10 +584,10 @@ func TestWorkspaceLimitForPlan_KnownPlans(t *testing.T) {
{"cloud_power", 1},
{"cloud_max", 1},
{"cloud_founding", 1},
{"msp_starter", 10},
{"msp_hosted_v1", 10},
{"msp_growth", 25},
{"msp_scale", 50},
{"msp_starter", 5},
{"msp_hosted_v1", 5},
{"msp_growth", 15},
{"msp_scale", 40},
}
for _, tt := range tests {

View file

@ -43,8 +43,8 @@ func TestMSPPlanAliasCanonicalizationContract(t *testing.T) {
if got := CanonicalizePlanVersion("msp_hosted_v1"); got != "msp_starter" {
t.Fatalf("CanonicalizePlanVersion(msp_hosted_v1) = %q, want %q", got, "msp_starter")
}
if limit, known := WorkspaceLimitForPlan("msp_hosted_v1"); !known || limit != 10 {
t.Fatalf("WorkspaceLimitForPlan(msp_hosted_v1) = (%d, %v), want (10, true)", limit, known)
if limit, known := WorkspaceLimitForPlan("msp_hosted_v1"); !known || limit != 5 {
t.Fatalf("WorkspaceLimitForPlan(msp_hosted_v1) = (%d, %v), want (5, true)", limit, known)
}
}