Skip to content

Commit

Permalink
validate the description length for tailnet keys
Browse files Browse the repository at this point in the history
Fixes #320
  • Loading branch information
jaxxstorm authored and knyar committed Feb 20, 2024
1 parent dd40894 commit 2a94d34
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tailscale/resource_tailnet_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func resourceTailnetKey() *schema.Resource {
Optional: true,
Description: "A description of the key consisting of alphanumeric characters. Defaults to `\"\"`.",
ForceNew: true,
ValidateDiagFunc: func(i interface{}, p cty.Path) diag.Diagnostics {
if len(i.(string)) > 50 {
return diagnosticsError(nil, "description must be 50 characters or less")
}
return nil
},
},
"invalid": {
Type: schema.TypeBool,
Expand Down

0 comments on commit 2a94d34

Please sign in to comment.