123456789_123456789_123456789_123456789_123456789_

Module: ActionController::ContentSecurityPolicy

Do not use. This module is for internal use only.

Constant Summary

::ActiveSupport::Callbacks - Included

CALLBACK_FILTER_TYPES

::AbstractController::Callbacks - Included

DEFAULT_INTERNAL_METHODS, TERMINATOR

::AbstractController::Callbacks - Attributes & Methods

::AbstractController::Helpers - Attributes & Methods

Class Method Summary

::ActiveSupport::DescendantsTracker - self

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

append_features, prepend_features

Instance Attribute Summary

Instance Method Summary

::AbstractController::Callbacks - Included

#process_action

Override AbstractController::Base#process_action to run the process_action callbacks around the normal behavior.

::ActiveSupport::Callbacks - Included

#run_callbacks

Runs the callbacks for the given event.

#halted_callback_hook

A hook invoked every time a before callback is halted.

::AbstractController::Helpers - Included

DSL Calls

included

[ GitHub ]


10
11
12
13
# File 'actionpack/lib/action_controller/metal/content_security_policy.rb', line 10

included do
  helper_method :content_security_policy?
  helper_method :content_security_policy_nonce
end

Class Attribute Details

._helper_methods (rw)

[ GitHub ]

  
# File 'actionpack/lib/abstract_controller/helpers.rb', line 11

class_attribute :_helper_methods, default: [].freeze

._helper_methods? ⇒ Boolean (rw)

[ GitHub ]

  
# File 'actionpack/lib/abstract_controller/helpers.rb', line 11

class_attribute :_helper_methods, default: [].freeze

.raise_on_missing_callback_actions (rw)

[ GitHub ]

  
# File 'actionpack/lib/abstract_controller/callbacks.rb', line 51

class_attribute :raise_on_missing_callback_actions, instance_predicate: false, default: false

Instance Attribute Details

#_helper_methods (rw)

[ GitHub ]

  
# File 'actionpack/lib/abstract_controller/helpers.rb', line 11

class_attribute :_helper_methods, default: [].freeze

#_helper_methods? ⇒ Boolean (rw)

[ GitHub ]

  
# File 'actionpack/lib/abstract_controller/helpers.rb', line 11

class_attribute :_helper_methods, default: [].freeze

#content_security_policy? ⇒ Boolean (readonly, private)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/content_security_policy.rb', line 72

def content_security_policy?
  request.content_security_policy
end

#raise_on_missing_callback_actions (rw)

[ GitHub ]

  
# File 'actionpack/lib/abstract_controller/callbacks.rb', line 51

class_attribute :raise_on_missing_callback_actions, instance_predicate: false, default: false

Instance Method Details

#content_security_policy_nonce (private)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/content_security_policy.rb', line 76

def content_security_policy_nonce
  request.content_security_policy_nonce
end

#current_content_security_policy (private)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/content_security_policy.rb', line 80

def current_content_security_policy
  request.content_security_policy&.clone || ActionDispatch::ContentSecurityPolicy.new
end