Class: Rails::Auth::X509::Matcher
- Inherits:
-
Object
- Object
- Rails::Auth::X509::Matcher
- Defined in:
- lib/rails/auth/x509/matcher.rb
Overview
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.
10 11 12 |
# File 'lib/rails/auth/x509/matcher.rb', line 10 def initialize() @options = .freeze end |
Instance Method Details
#attributes ⇒ Hash
Generates inspectable attributes for debugging
25 26 27 |
# File 'lib/rails/auth/x509/matcher.rb', line 25 def attributes @options end |
#match(env) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rails/auth/x509/matcher.rb', line 15 def match(env) certificate = Rails::Auth.credentials(env)["x509"] return false unless certificate @options.all? { |name, value| certificate[name] == value } end |