Class: BoltServer::ACL::X509Matcher
- Inherits:
-
Object
- Object
- BoltServer::ACL::X509Matcher
- Defined in:
- lib/bolt_server/acl.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ X509Matcher
constructor
A new instance of X509Matcher.
- #match(env) ⇒ Object
Constructor Details
#initialize(options) ⇒ X509Matcher
Returns a new instance of X509Matcher.
8 9 10 |
# File 'lib/bolt_server/acl.rb', line 8 def initialize() @options = .freeze end |
Instance Method Details
#match(env) ⇒ Object
12 13 14 15 16 |
# File 'lib/bolt_server/acl.rb', line 12 def match(env) certificate = Rails::Auth::X509::Certificate.new(env['puma.peercert']) # This can be extended fairly easily to search OpenSSL::X509::Certificate#extensions for subjectAltNames. @options.all? { |name, value| certificate[name] == value } end |