Sha256: c1a0d3588992bc667f1fb6ade9ee15d495dedc23be3a4172ff7dd30118db5ce2

Contents?: true

Size: 678 Bytes

Versions: 53

Compression:

Stored size: 678 Bytes

Contents

module Kontena::Cli::Stacks::YAML::Validations::CustomValidators
  class CertificatesValidator < HashValidator::Validator::Base
    def initialize
      super('stacks_valid_certificates')
    end

    def validate(key, value, validations, errors)
      unless value.is_a?(Array)
        errors[key] = 'certificates must be array'
        return
      end
      certificate_item_validation = {
        'subject' => 'string',
        'name' => 'string',
        'type' => 'string'
      }
      value.each do |certificate|
        HashValidator.validator_for(certificate_item_validation).validate(key, certificate, certificate_item_validation, errors)
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.10 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.9 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.8 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.7 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.6 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.5 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.4 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.3 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.2 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.1 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.7.0 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.9 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.8 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.7 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.6 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.5 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.4 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.3 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb
krates-1.6.2 lib/kontena/cli/stacks/yaml/custom_validators/certificates_validator.rb