Class: Spid::Configuration
- Inherits:
-
Object
- Object
- Spid::Configuration
- Defined in:
- lib/spid/configuration.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#acs_binding ⇒ Object
Returns the value of attribute acs_binding.
-
#acs_path ⇒ Object
Returns the value of attribute acs_path.
-
#attribute_services ⇒ Object
Returns the value of attribute attribute_services.
-
#certificate_pem ⇒ Object
Returns the value of attribute certificate_pem.
-
#default_relay_state_path ⇒ Object
Returns the value of attribute default_relay_state_path.
-
#digest_method ⇒ Object
Returns the value of attribute digest_method.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#idp_metadata_dir_path ⇒ Object
Returns the value of attribute idp_metadata_dir_path.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#logging_enabled ⇒ Object
Returns the value of attribute logging_enabled.
-
#login_path ⇒ Object
Returns the value of attribute login_path.
-
#logout_path ⇒ Object
Returns the value of attribute logout_path.
-
#metadata_path ⇒ Object
Returns the value of attribute metadata_path.
-
#private_key_pem ⇒ Object
Returns the value of attribute private_key_pem.
-
#signature_method ⇒ Object
Returns the value of attribute signature_method.
-
#slo_binding ⇒ Object
Returns the value of attribute slo_binding.
-
#slo_path ⇒ Object
Returns the value of attribute slo_path.
Instance Method Summary collapse
- #certificate ⇒ Object
- #init_bindings ⇒ Object
- #init_dig_sig_methods ⇒ Object
- #init_endpoint ⇒ Object
- #init_openssl_keys ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #private_key ⇒ Object
- #service_provider ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/spid/configuration.rb', line 25 def initialize @idp_metadata_dir_path = "idp_metadata" @attribute_services = [] @logging_enabled = false @logger = ::Logger.new $stdout init_endpoint init_bindings init_dig_sig_methods init_openssl_keys end |
Instance Attribute Details
#acs_binding ⇒ Object
Returns the value of attribute acs_binding.
17 18 19 |
# File 'lib/spid/configuration.rb', line 17 def acs_binding @acs_binding end |
#acs_path ⇒ Object
Returns the value of attribute acs_path.
12 13 14 |
# File 'lib/spid/configuration.rb', line 12 def acs_path @acs_path end |
#attribute_services ⇒ Object
Returns the value of attribute attribute_services.
19 20 21 |
# File 'lib/spid/configuration.rb', line 19 def attribute_services @attribute_services end |
#certificate_pem ⇒ Object
Returns the value of attribute certificate_pem.
21 22 23 |
# File 'lib/spid/configuration.rb', line 21 def certificate_pem @certificate_pem end |
#default_relay_state_path ⇒ Object
Returns the value of attribute default_relay_state_path.
16 17 18 |
# File 'lib/spid/configuration.rb', line 16 def default_relay_state_path @default_relay_state_path end |
#digest_method ⇒ Object
Returns the value of attribute digest_method.
14 15 16 |
# File 'lib/spid/configuration.rb', line 14 def digest_method @digest_method end |
#hostname ⇒ Object
Returns the value of attribute hostname.
8 9 10 |
# File 'lib/spid/configuration.rb', line 8 def hostname @hostname end |
#idp_metadata_dir_path ⇒ Object
Returns the value of attribute idp_metadata_dir_path.
7 8 9 |
# File 'lib/spid/configuration.rb', line 7 def @idp_metadata_dir_path end |
#logger ⇒ Object
Returns the value of attribute logger.
23 24 25 |
# File 'lib/spid/configuration.rb', line 23 def logger @logger end |
#logging_enabled ⇒ Object
Returns the value of attribute logging_enabled.
22 23 24 |
# File 'lib/spid/configuration.rb', line 22 def logging_enabled @logging_enabled end |
#login_path ⇒ Object
Returns the value of attribute login_path.
10 11 12 |
# File 'lib/spid/configuration.rb', line 10 def login_path @login_path end |
#logout_path ⇒ Object
Returns the value of attribute logout_path.
11 12 13 |
# File 'lib/spid/configuration.rb', line 11 def logout_path @logout_path end |
#metadata_path ⇒ Object
Returns the value of attribute metadata_path.
9 10 11 |
# File 'lib/spid/configuration.rb', line 9 def @metadata_path end |
#private_key_pem ⇒ Object
Returns the value of attribute private_key_pem.
20 21 22 |
# File 'lib/spid/configuration.rb', line 20 def private_key_pem @private_key_pem end |
#signature_method ⇒ Object
Returns the value of attribute signature_method.
15 16 17 |
# File 'lib/spid/configuration.rb', line 15 def signature_method @signature_method end |
#slo_binding ⇒ Object
Returns the value of attribute slo_binding.
18 19 20 |
# File 'lib/spid/configuration.rb', line 18 def slo_binding @slo_binding end |
#slo_path ⇒ Object
Returns the value of attribute slo_path.
13 14 15 |
# File 'lib/spid/configuration.rb', line 13 def slo_path @slo_path end |
Instance Method Details
#certificate ⇒ Object
61 62 63 64 |
# File 'lib/spid/configuration.rb', line 61 def certificate return nil if certificate_pem.nil? @certificate ||= OpenSSL::X509::Certificate.new(certificate_pem) end |
#init_bindings ⇒ Object
46 47 48 49 |
# File 'lib/spid/configuration.rb', line 46 def init_bindings @acs_binding = Spid::BINDINGS_HTTP_POST @slo_binding = Spid::BINDINGS_HTTP_REDIRECT end |
#init_dig_sig_methods ⇒ Object
51 52 53 54 |
# File 'lib/spid/configuration.rb', line 51 def init_dig_sig_methods @digest_method = Spid::SHA256 @signature_method = Spid::RSA_SHA256 end |
#init_endpoint ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/spid/configuration.rb', line 36 def init_endpoint @hostname = nil @metadata_path = "/spid/metadata" @login_path = "/spid/login" @logout_path = "/spid/logout" @acs_path = "/spid/sso" @slo_path = "/spid/slo" @default_relay_state_path = "/" end |
#init_openssl_keys ⇒ Object
56 57 58 59 |
# File 'lib/spid/configuration.rb', line 56 def init_openssl_keys @private_key = nil @certificate = nil end |
#private_key ⇒ Object
66 67 68 69 |
# File 'lib/spid/configuration.rb', line 66 def private_key return nil if private_key_pem.nil? @private_key ||= OpenSSL::PKey::RSA.new(private_key_pem) end |
#service_provider ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/spid/configuration.rb', line 71 def service_provider @service_provider ||= begin Spid::Saml2::ServiceProvider.new( acs_binding: acs_binding, acs_path: acs_path, slo_path: slo_path, slo_binding: slo_binding, metadata_path: , private_key: private_key, certificate: certificate, digest_method: digest_method, signature_method: signature_method, attribute_services: attribute_services, host: hostname ) end end |