Merge pull request #58 from passbolt/fix-password-string-validation

Fix resource type password-string validation
This commit is contained in:
Samuel Lorch 2025-08-11 15:37:47 +02:00 committed by GitHub
commit 9c9e2334dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,6 +11,15 @@ import (
)
func validateSecretData(rType *api.ResourceType, secretData string) error {
// TODO Remove when v4 Resources are unsupported
// with the Resource Type password-string the Secret is not json and can't be properly validated, so skip the check here
if rType.Slug == "password-string" {
if len(secretData) > 4096 {
return fmt.Errorf("password is longer than 4096")
}
return nil
}
var schemaDefinition api.ResourceTypeSchema
definition := rType.Definition