Sha256: 03d117a6bed5d8831fcc1834a16c3f81faef6bd7ad0a15c34d4a92b0fc830801

Contents?: true

Size: 909 Bytes

Versions: 12

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

module ForemanSalt
  module Concerns
    # Keys to allow as parameters in the SaltVariable controller
    module SaltOverrideValue
      extend ActiveSupport::Concern

      class_methods do
        def lookup_value_params_filter
          Foreman::ParameterFilter.new(::LookupValue).tap do |filter|
            filter.permit :salt_variable_id, override_value: {}

            filter.permit_by_context :hidden_value, :host_or_hostgroup, :lookup_key, :lookup_key_id,
              :match, :omit, :value, nested: true

            filter.permit_by_context :id, :_destroy, ui: false,
                                                     api: false, nested: true
          end
        end
      end

      def lookup_value_params
        self.class.lookup_value_params_filter.filter_params(params, parameter_filter_context, 'foreman_salt_salt_variable')
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman_salt-17.0.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-16.0.3 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-16.0.2 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-16.0.1 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-16.0.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-15.2.3 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-15.2.2 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-15.2.1 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-15.2.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-15.1.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-15.0.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-14.1.0 app/controllers/foreman_salt/concerns/salt_override_value.rb