Class: SamlIdp::ServiceProvider

Inherits:
Object
  • Object
show all
Includes:
Attributeable
Defined in:
lib/saml_idp/service_provider.rb

Instance Method Summary collapse

Methods included from Attributeable

#attributes, #attributes=, #initialize

Instance Method Details

#acceptable_response_hostsObject



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() if 

  hosts
end

#current_metadataObject



42
43
44
# File 'lib/saml_idp/service_provider.rb', line 42

def 
  @current_metadata ||= get_current_or_build
end

#metadata_url_hostObject



53
54
55
56
57
# File 'lib/saml_idp/service_provider.rb', line 53

def 
  if .present?
    URI().host
  end
end

#refresh_metadataObject



33
34
35
36
37
38
39
40
# File 'lib/saml_idp/service_provider.rb', line 33

def 
  fresh = 
  if valid_signature?(fresh.document)
    [identifier, fresh]
    @current_metadata = nil
    fresh
  end
end

#valid?Boolean

Returns:

  • (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

Returns:

  • (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