Class: SamlIdp::ServiceProvider
- Inherits:
-
Object
- Object
- SamlIdp::ServiceProvider
show all
- Includes:
- Attributeable
- Defined in:
- lib/saml_idp/service_provider.rb
Instance Method Summary
collapse
#attributes, #attributes=, #initialize
Instance Method Details
#acceptable_response_hosts ⇒ Object
46
47
48
49
50
51
|
# File 'lib/saml_idp/service_provider.rb', line 46
def acceptable_response_hosts
hosts = Array(self.response_hosts)
hosts.push(metadata_url_host) if metadata_url_host
hosts
end
|
42
43
44
|
# File 'lib/saml_idp/service_provider.rb', line 42
def current_metadata
@current_metadata ||= get_current_or_build
end
|
53
54
55
56
57
|
# File 'lib/saml_idp/service_provider.rb', line 53
def metadata_url_host
if metadata_url.present?
URI(metadata_url).host
end
end
|
33
34
35
36
37
38
39
40
|
# File 'lib/saml_idp/service_provider.rb', line 33
def refresh_metadata
fresh = fresh_incoming_metadata
if valid_signature?(fresh.document)
metadata_persister[identifier, fresh]
@current_metadata = nil
fresh
end
end
|
#valid? ⇒ Boolean
21
22
23
|
# File 'lib/saml_idp/service_provider.rb', line 21
def valid?
attributes.present?
end
|
#valid_signature?(doc, require_signature = false) ⇒ Boolean
25
26
27
28
29
30
31
|
# File 'lib/saml_idp/service_provider.rb', line 25
def valid_signature?(doc, require_signature = false)
if require_signature || attributes[:validate_signature]
doc.valid_signature?(fingerprint)
else
true
end
end
|