Class: Rails::Auth::X509::Matcher
- Inherits:
-
Object
- Object
- Rails::Auth::X509::Matcher
- Defined in:
- lib/rails/auth/x509/matcher.rb
Overview
Predicate matcher for making assertions about X.509 certificates
Instance Method Summary collapse
-
#attributes ⇒ Hash
Generates inspectable attributes for debugging.
-
#initialize(options) ⇒ Matcher
constructor
A new instance of Matcher.
- #match(env) ⇒ Object
Constructor Details
#initialize(options) ⇒ Matcher
Returns a new instance of Matcher.
8 9 10 |
# File 'lib/rails/auth/x509/matcher.rb', line 8 def initialize() @options = .freeze end |
Instance Method Details
#attributes ⇒ Hash
Generates inspectable attributes for debugging
23 24 25 |
# File 'lib/rails/auth/x509/matcher.rb', line 23 def attributes @options end |
#match(env) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/rails/auth/x509/matcher.rb', line 13 def match(env) certificate = Rails::Auth.credentials(env)["x509"] return false unless certificate @options.all? { |name, value| certificate[name] == value } end |