Sha256: 4beed2a6ea3f1a58ce96724ef3c8896c95c9f2af81dcffa546fe0292bc22e43c

Contents?: true

Size: 637 Bytes

Versions: 137

Compression:

Stored size: 637 Bytes

Contents

module Kontena::Cli::Stacks::YAML::Validations::CustomValidators
  class SecretsValidator < HashValidator::Validator::Base
    def initialize
      super('stacks_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

137 entries across 137 versions & 2 rubygems

Version Path
kontena-cli-1.2.2.rc1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.1.rc1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.rc3 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.rc2 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.rc1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.pre3 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.pre2 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.6 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.pre1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.5 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.5.rc3 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.5.rc2 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.5.rc1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.4 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.2.0.dev1 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.3 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.2 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb
kontena-cli-1.1.2.rc2 lib/kontena/cli/stacks/yaml/custom_validators/secrets_validator.rb