aws_s3: improve validation