-
Notifications
You must be signed in to change notification settings - Fork 2
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
Validate input against Org / Space Name Spec #92
Comments
The solution is described in https://developer.hashicorp.com/terraform/plugin/framework/validation, we need to implement an attribute validation: // Typically within the schema.Schema returned by Schema() for a provider,
// resource, or data source.
schema.StringAttribute{
// ... other Attribute configuration ...
Validators: []validator.String{
// These are example validators from terraform-plugin-framework-validators
stringvalidator.LengthBetween(10, 256),
stringvalidator.RegexMatches(
regexp.MustCompile(`^[a-z0-9]+$`),
"must contain only lowercase alphanumeric characters",
),
},
} |
We should use the following regex: IDs: |
@chris-rock Another question that we are unsure of, if there should be a validation of other fields (e.g. Name of an integration), since no validation applies in the UI? |
For instance, we tried to exceed 256 characters in the name string, which resulted in the error: |
The space Ressource needs some input validation to meet the platform requirements
To Reproduce
with
Expected behavior
validate against:
Org / Space Name: name: letters, numbers, single quotes, hyphens, spaces or exclamation points, more then 4 chars
Regex:
^([a-zA-Z \-'_]|\d){2,30}$
The text was updated successfully, but these errors were encountered: