Sha256: 9052d5b9dbfb1284235624fbefa592cd0eee940d6b370f34c0e2c5811c009fdf

Contents?: true

Size: 1.49 KB

Versions: 8

Compression:

Stored size: 1.49 KB

Contents

module Lotus
  module Config
    # Security policies are stored here.
    #
    # @since 0.3.0
    class Security
      # @since 0.3.0
      # @api private
      #
      # @see Lotus::Loader#_configure_controller_framework!
      X_FRAME_OPTIONS_HEADER = 'X-Frame-Options'.freeze

      # @since 0.3.0
      # @api private
      #
      # @see Lotus::Loader#_configure_controller_framework!
      CONTENT_SECURITY_POLICY_HEADER = 'Content-Security-Policy'.freeze

      # X-Frame-Options headers' value
      #
      # @overload x_frame_options(value)
      #   Sets the given value
      #   @param value [String] for X-Frame-Options header.
      #
      # @overload x_frame_options
      #   Gets the value
      #   @return [String] X-Frame-Options header's value
      #
      # @since 0.3.0
      def x_frame_options(value = nil)
        if value.nil?
          @x_frame_options
        else
          @x_frame_options = value
        end
      end

      # Content-Policy-Security headers' value
      #
      # @overload content_security_policy(value)
      #   Sets the given value
      #   @param value [String] for Content-Security-Policy header.
      #
      # @overload content_security_policy
      #   Gets the value
      #   @return [String] Content-Security-Policy header's value
      #
      # @since 0.3.0
      def content_security_policy(value = nil)
        if value.nil?
          @content_security_policy
        else
          @content_security_policy = value
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lotusrb-0.6.1 lib/lotus/config/security.rb
lotusrb-0.6.0 lib/lotus/config/security.rb
lotusrb-0.5.0 lib/lotus/config/security.rb
lotusrb-0.4.1 lib/lotus/config/security.rb
lotusrb-0.4.0 lib/lotus/config/security.rb
lotusrb-0.3.2 lib/lotus/config/security.rb
lotusrb-0.3.1 lib/lotus/config/security.rb
lotusrb-0.3.0 lib/lotus/config/security.rb