# File lib/openid/association.rb, line 197 def self.check_session_type(assoc_type, session_type) if !get_session_types(assoc_type).include?(session_type) raise ProtocolError, "Session type #{session_type.inspect} not " "valid for association type #{assoc_type.inspect}" end end
# File lib/openid/association.rb, line 186 def self.get_session_types(assoc_type) case assoc_type when 'HMAC-SHA1' ['DH-SHA1', 'no-encryption'] when 'HMAC-SHA256' ['DH-SHA256', 'no-encryption'] else raise ProtocolError, "Unknown association type #{assoc_type.inspect}" end end
# File lib/openid/association.rb, line 219 def add_allowed_type(assoc_type, session_type=nil) if session_type.nil? session_types = self.class.get_session_types(assoc_type) else self.class.check_session_type(assoc_type, session_type) session_types = [session_type] end for session_type in session_types do @allowed_types << [assoc_type, session_type] end end
# File lib/openid/association.rb, line 231 def allowed?(assoc_type, session_type) @allowed_types.include?([assoc_type, session_type]) end
# File lib/openid/association.rb, line 212 def allowed_types=(allowed_types) allowed_types.each do |assoc_type, session_type| self.class.check_session_type(assoc_type, session_type) end @allowed_types = allowed_types end
Generated with the Darkfish Rdoc Generator 2.