Class: ProcessWanker::ConfigAuth
- Inherits:
-
ConfigNode
- Object
- ConfigNode
- ProcessWanker::ConfigAuth
- Defined in:
- lib/config/config_auth.rb
Instance Attribute Summary collapse
-
#accept_ip ⇒ Object
Returns the value of attribute accept_ip.
-
#accept_peers ⇒ Object
Returns the value of attribute accept_peers.
-
#ca_cert ⇒ Object
Returns the value of attribute ca_cert.
-
#is_default ⇒ Object
Returns the value of attribute is_default.
-
#my_cert ⇒ Object
Returns the value of attribute my_cert.
-
#my_key ⇒ Object
Returns the value of attribute my_key.
-
#reject_ip ⇒ Object
Returns the value of attribute reject_ip.
-
#reject_peers ⇒ Object
Returns the value of attribute reject_peers.
Attributes inherited from ConfigNode
Instance Method Summary collapse
- #allow_ip(ip) ⇒ Object
- #init_default ⇒ Object
-
#initialize ⇒ ConfigAuth
constructor
A new instance of ConfigAuth.
Methods inherited from ConfigNode
Constructor Details
#initialize ⇒ ConfigAuth
Returns a new instance of ConfigAuth.
65 66 67 |
# File 'lib/config/config_auth.rb', line 65 def initialize() init_default() end |
Instance Attribute Details
#accept_ip ⇒ Object
Returns the value of attribute accept_ip.
62 63 64 |
# File 'lib/config/config_auth.rb', line 62 def accept_ip @accept_ip end |
#accept_peers ⇒ Object
Returns the value of attribute accept_peers.
59 60 61 |
# File 'lib/config/config_auth.rb', line 59 def accept_peers @accept_peers end |
#ca_cert ⇒ Object
Returns the value of attribute ca_cert.
56 57 58 |
# File 'lib/config/config_auth.rb', line 56 def ca_cert @ca_cert end |
#is_default ⇒ Object
Returns the value of attribute is_default.
61 62 63 |
# File 'lib/config/config_auth.rb', line 61 def is_default @is_default end |
#my_cert ⇒ Object
Returns the value of attribute my_cert.
57 58 59 |
# File 'lib/config/config_auth.rb', line 57 def my_cert @my_cert end |
#my_key ⇒ Object
Returns the value of attribute my_key.
58 59 60 |
# File 'lib/config/config_auth.rb', line 58 def my_key @my_key end |
#reject_ip ⇒ Object
Returns the value of attribute reject_ip.
63 64 65 |
# File 'lib/config/config_auth.rb', line 63 def reject_ip @reject_ip end |
#reject_peers ⇒ Object
Returns the value of attribute reject_peers.
60 61 62 |
# File 'lib/config/config_auth.rb', line 60 def reject_peers @reject_peers end |
Instance Method Details
#allow_ip(ip) ⇒ Object
76 77 78 79 80 |
# File 'lib/config/config_auth.rb', line 76 def allow_ip(ip) return(false) if(accept_ip && !accept_ip.contains(ip)) return(false) if(reject_ip && reject_ip.contains(ip)) true end |
#init_default ⇒ Object
69 70 71 72 73 74 |
# File 'lib/config/config_auth.rb', line 69 def init_default() @is_default=true @ca_cert=OpenSSL::X509::Certificate.new(DEFAULT_CA_CERT) @my_cert=OpenSSL::X509::Certificate.new(DEFAULT_MY_CERT) @my_key=OpenSSL::PKey::RSA.new(DEFAULT_MY_KEY) end |