module TCellAgent::Instrumentation::Patches

Public Class Methods

block?(request) click to toggle source
# File lib/tcell_agent/patches.rb, line 6
def self.block?(request)
  TCellAgent::Instrumentation.safe_block('Checking patches blocking') do
    patches_policy = TCellAgent.policy(TCellAgent::PolicyTypes::PATCHES)
    return false unless patches_policy.enabled

    meta_data = TCellAgent::MetaData.for_patches(request)
    block_request = patches_policy.block_request?(meta_data)
    request.env[TCellAgent::Instrumentation::TCELL_ID].patches_blocking_triggered = block_request

    return block_request
  end

  false
end