Sha256: 202c963058864197258b1e93c37a7803c042c9096b3a00e47204fc90ef557a63

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module ForemanWebhooks
  module Controller
    module Parameters
      module Webhook
        extend ActiveSupport::Concern

        class_methods do
          def webhook_params_filter
            Foreman::ParameterFilter.new(::Webhook).tap do |filter|
              filter.permit :name,
                            :target_url,
                            :webhook_template_id,
                            :event,
                            :http_method,
                            :http_content_type,
                            :enabled,
                            :verify_ssl,
                            :ssl_ca_certs,
                            :user,
                            :password,
                            :http_headers,
                            :proxy_authorization
            end
          end
        end

        def webhook_params
          params['webhook']['event'] = params['event'] unless params['event'].blank?
          self.class.webhook_params_filter.filter_params(params, parameter_filter_context)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
foreman_webhooks-4.0.0 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.2.3 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.2.2 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.1.1 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.2.1 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.2.0 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.1.0 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.0.5 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-2.0.3 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.0.4 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-2.0.2 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.0.3 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.0.2 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.0.1 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-2.0.1 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-3.0.0 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-2.0.0 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb
foreman_webhooks-1.1.0 app/controllers/concerns/foreman_webhooks/controller/parameters/webhook.rb