Class: ProcessWanker::ConfigAuthBuilder
- Defined in:
- lib/config/config_auth.rb
Instance Method Summary collapse
- #accept_ip(v) ⇒ Object
- #accept_peers(*v) ⇒ Object
- #ca_cert(v) ⇒ Object
- #my_cert(v) ⇒ Object
- #my_key(v) ⇒ Object
- #reject_ip(v) ⇒ Object
- #reject_peers(*v) ⇒ Object
Methods inherited from Builder
Instance Method Details
#accept_ip(v) ⇒ Object
119 120 121 122 |
# File 'lib/config/config_auth.rb', line 119 def accept_ip(v) @config.accept_ip ||= IPFilter.new @config.accept_ip.ips << IPAddr.new(v) end |
#accept_peers(*v) ⇒ Object
105 106 107 108 109 110 |
# File 'lib/config/config_auth.rb', line 105 def accept_peers(*v) @config.accept_peers ||= {} v.each do |vv| @config.accept_peers[vv]=true end end |
#ca_cert(v) ⇒ Object
92 93 94 95 |
# File 'lib/config/config_auth.rb', line 92 def ca_cert(v) @config.ca_cert=OpenSSL::X509::Certificate.new(File.read(v)) @config.is_default=false end |
#my_cert(v) ⇒ Object
97 98 99 |
# File 'lib/config/config_auth.rb', line 97 def my_cert(v) @config.my_cert=OpenSSL::X509::Certificate.new(File.read(v)) end |
#my_key(v) ⇒ Object
101 102 103 |
# File 'lib/config/config_auth.rb', line 101 def my_key(v) @config.my_key=OpenSSL::PKey::RSA.new(File.read(v)) end |
#reject_ip(v) ⇒ Object
124 125 126 127 |
# File 'lib/config/config_auth.rb', line 124 def reject_ip(v) @config.reject_ip ||= IPFilter.new @config.reject_ip.ips << IPAddr.new(v) end |
#reject_peers(*v) ⇒ Object
112 113 114 115 116 117 |
# File 'lib/config/config_auth.rb', line 112 def reject_peers(*v) @config.reject_peers ||= {} v.each do |vv| @config.reject_peers[vv]=true end end |