Sha256: 5190914c88c4f7eb37dfde445c6d8b66ad390888dd5aaaae4381b0ac8444348f

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

# Scope lets us disable Contrast for certain code calls. We need to do this so
# that we don't propagate through our own code.
#
# Think logging: If you have
# something like "The source was '" + source + "'", and source is tracked,
# you'll trigger propagation with the + method. This in turn would cause
# propagation if you log there "The target ''" + target + "' was propagated'"
# Which would then cause another propagation with the '+' method, forever.
#
# Instead, we should say "If I'm already doing Contrast things, don't track
# this"
#
# NOTE: DO NOT DO ANYTHING IN THIS CLASS THAT COULD RESULT IN A MONKEY PATCHED
# ACTION. WE CAN'T ENTER SCOPE BEFORE WE HAVE A SCOPE! YOU HAVE BEEN WARNED!!!
module Contrast
  module Agent
    class Scope
      # At first, all scopes are 0, meaning we're not in Contrast land
      # NOTE: DO NOT DO ANYTHING IN THIS CLASS THAT COULD RESULT IN A MONKEY
      # PATCHED ACTION. WE CAN'T ENTER SCOPE BEFORE WE HAVE A SCOPE! YOU HAVE
      # BEEN WARNED!!! (again)
    end
  end
end
cs__scoped_require 'cs__scope/cs__scope'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contrast-agent-3.8.5 lib/contrast/agent/scope.rb
contrast-agent-3.8.4 lib/contrast/agent/scope.rb