Class: Verikloak::Rails::SkipPathChecker

Inherits:
Object
  • Object
show all
Includes:
SkipPathMatcher
Defined in:
lib/verikloak/rails/skip_path_checker.rb

Overview

Wraps SkipPathMatcher into a standalone object so the controller layer can reuse the same skip-path logic as the Rack middleware.

Examples:

checker = SkipPathChecker.new(['/health', '/public/*'])
checker.skip?('/health')    #=> true
checker.skip?('/api/users') #=> false

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ SkipPathChecker

Returns a new instance of SkipPathChecker.

Parameters:

  • paths (Array<String, Regexp>)

    skip-path patterns



18
19
20
# File 'lib/verikloak/rails/skip_path_checker.rb', line 18

def initialize(paths)
  compile_skip_paths(Array(paths))
end