Repository: rails/rails
File: railties/lib/rails/application/configuration.rb (Ruby)

Code before:
      end

      def colorize_logging=(val)
        ActiveSupport::LogSubscriber.colorize_logging = val
        generators.colorize_logging = val
      end

      def secret_key_base
        @secret_key_base || begin
          self.secret_key_base = if generate_local_secret?
            generate_local_secret
          else
            ENV["SECRET_KEY_BASE"] || Rails.application.credentials.secret_key_base
          end
        end
      end

      def secret_key_base=(new_secret_key_base)
        if new_secret_key_base.nil? && Rails.env.local?
          @secret_key_base = generate_local_secret
        elsif new_secret_key_base.is_a?(String) && new_secret_key_base.present?
          @secret_key_base = new_secret_key_base
        elsif new_secret_key_base
          raise ArgumentError, "`secret_key_base` for #{Rails.env} environment must be a type of String`"
        else
          raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
        end
      end

      # Specifies what class to use to store the session. Possible values
      # are +:cache_store+, +:cookie_store+, +:mem_cache_store+, a custom
      # store, or +:disabled+. +:disabled+ tells \Rails not to deal with
      # sessions.
      #
      # Additional options will be set as +session_options+:
      #
      #   config.session_store :cookie_store, key: "_your_app_session"
      #   config.session_options # => {key: "_your_app_session"}
      #
      # If a custom store is specified as a symbol, it will be resolved to
      # the +ActionDispatch::Session+ namespace:
      #
      #   # use ActionDispatch::Session::MyCustomStore as the session store
      #   config.session_store :my_custom_store
      def session_store(new_session_store = nil, **options)
        if new_session_store
          @session_store = new_session_store
          @session_options = options || {}
        else
          case @session_store
          when :disabled

Review comment (security):
Does this still work if an app does `secret_key_base = nil` and has `ENV["SECRET_KEY_BASE_DUMMY"]` set?

Code after:
        Rails.autoloaders.once.ignore(ignored_abspaths)
      end

      def colorize_logging
        ActiveSupport::LogSubscriber.colorize_logging
      end

      def colorize_logging=(val)
        ActiveSupport::LogSubscriber.colorize_logging = val
        generators.colorize_logging = val
      end

      def secret_key_base
        @secret_key_base || begin
          self.secret_key_base = if ENV["SECRET_KEY_BASE_DUMMY"]
            generate_local_secret
          else
            ENV["SECRET_KEY_BASE"] ||
              Rails.application.credentials.secret_key_base ||
              (Rails.env.local? && generate_local_secret)
          end
        end
      end

      def secret_key_base=(new_secret_key_base)
        if new_secret_key_base.nil? && Rails.env.local?
          @secret_key_base = generate_local_secret
        elsif new_secret_key_base.is_a?(String) && new_secret_key_base.present?
          @secret_key_base = new_secret_key_base
        elsif new_secret_key_base
          raise ArgumentError, "`secret_key_base` for #{Rails.env} environment must be a type of String`"
        else
          raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
        end
      end

      # Specifies what class to use to store the session. Possible values
      # are +:cache_store+, +:cookie_store+, +:mem_cache_store+, a custom
      # store, or +:disabled+. +:disabled+ tells \Rails not to deal with
      # sessions.
      #
      # Additional options will be set as +session_options+:
      #
      #   config.session_store :cookie_store, key: "_your_app_session"
      #   config.session_options # => {key: "_your_app_session"}
      #
      # If a custom store is specified as a symbol, it will be resolved to
      # the +ActionDispatch::Session+ namespace:
      #
      #   # use ActionDispatch::Session::MyCustomStore as the session store
      #   config.session_store :my_custom_store