Sha256: b7fbd4994704882c4c1640fab91d4d747999ecfa8c365eee22b3176149e57331

Contents?: true

Size: 628 Bytes

Versions: 100

Compression:

Stored size: 628 Bytes

Contents

module Kontena::Cli::Apps::YAML::Validations::CustomValidators
  class SecretsValidator < HashValidator::Validator::Base
    def initialize
      super('valid_secrets')
    end

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

Version data entries

100 entries across 100 versions & 2 rubygems

Version Path
kontena-cli-1.0.5.pre1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.4 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.4.rc2 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.4.rc1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.3 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.3.rc1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.2 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.2.rc2 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.2.rc1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.2.pre1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.1.rc3 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.1.rc2 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.1.rc1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.0 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.0.rc2 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.0.rc1 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.0.pre4 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.0.pre3 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.0.0.pre2 lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb