Exception: OpenID::Server::ProtocolError
- Inherits:
-
Exception
- Object
- Exception
- OpenID::Server::ProtocolError
- Defined in:
- lib/openid/server.rb
Overview
A message did not conform to the OpenID protocol.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#openid_message ⇒ Object
The query that is failing to be a valid OpenID request.
-
#reference ⇒ Object
Returns the value of attribute reference.
Instance Method Summary collapse
- #encode_to_kvform ⇒ Object
-
#encode_to_url ⇒ Object
implements IEncodable.
-
#get_return_to ⇒ Object
Get the return_to argument from the request, if any.
-
#has_return_to ⇒ Object
Did this request have a return_to parameter?.
-
#initialize(message, text = nil, reference = nil, contact = nil) ⇒ ProtocolError
constructor
- text
-
A message about the encountered error.
- #to_form_markup ⇒ Object
- #to_html ⇒ Object
-
#to_message ⇒ Object
Generate a Message object for sending to the relying party, after encoding.
-
#which_encoding ⇒ Object
How should I be encoded?.
Constructor Details
#initialize(message, text = nil, reference = nil, contact = nil) ⇒ ProtocolError
- text
-
A message about the encountered error.
1431 1432 1433 1434 1435 1436 1437 |
# File 'lib/openid/server.rb', line 1431 def initialize(, text = nil, reference = nil, contact = nil) = @reference = reference @contact = contact Util.truthy_assert(!.is_a?(String)) super(text) end |
Instance Attribute Details
#contact ⇒ Object
Returns the value of attribute contact.
1428 1429 1430 |
# File 'lib/openid/server.rb', line 1428 def contact @contact end |
#openid_message ⇒ Object
The query that is failing to be a valid OpenID request.
1427 1428 1429 |
# File 'lib/openid/server.rb', line 1427 def end |
#reference ⇒ Object
Returns the value of attribute reference.
1428 1429 1430 |
# File 'lib/openid/server.rb', line 1428 def reference @reference end |
Instance Method Details
#encode_to_kvform ⇒ Object
1472 1473 1474 |
# File 'lib/openid/server.rb', line 1472 def encode_to_kvform .to_kvform end |
#encode_to_url ⇒ Object
implements IEncodable
1468 1469 1470 |
# File 'lib/openid/server.rb', line 1468 def encode_to_url .to_url(get_return_to) end |
#get_return_to ⇒ Object
Get the return_to argument from the request, if any.
1440 1441 1442 1443 1444 |
# File 'lib/openid/server.rb', line 1440 def get_return_to return if .nil? .get_arg(OPENID_NS, "return_to") end |
#has_return_to ⇒ Object
Did this request have a return_to parameter?
1447 1448 1449 |
# File 'lib/openid/server.rb', line 1447 def has_return_to !get_return_to.nil? end |
#to_form_markup ⇒ Object
1476 1477 1478 |
# File 'lib/openid/server.rb', line 1476 def to_form_markup .to_form_markup(get_return_to) end |
#to_html ⇒ Object
1480 1481 1482 |
# File 'lib/openid/server.rb', line 1480 def to_html Util.auto_submit_html(to_form_markup) end |
#to_message ⇒ Object
Generate a Message object for sending to the relying party, after encoding.
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 |
# File 'lib/openid/server.rb', line 1453 def namespace = .get_openid_namespace reply = Message.new(namespace) reply.set_arg(OPENID_NS, "mode", "error") reply.set_arg(OPENID_NS, "error", to_s) reply.set_arg(OPENID_NS, "contact", @contact.to_s) if @contact reply.set_arg(OPENID_NS, "reference", @reference.to_s) if @reference reply end |
#which_encoding ⇒ Object
How should I be encoded?
Returns one of ENCODE_URL, ENCODE_KVFORM, or None. If None, I cannot be encoded as a protocol message and should be displayed to the user.
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 |
# File 'lib/openid/server.rb', line 1489 def which_encoding if has_return_to if .is_openid2 and encode_to_url.length > OPENID1_URL_LIMIT return ENCODE_HTML_FORM else return ENCODE_URL end end return if .nil? mode = .get_arg(OPENID_NS, "mode") return ENCODE_KVFORM if mode && !BROWSER_REQUEST_MODES.member?(mode) # If your request was so broken that you didn't manage to # include an openid.mode, I'm not going to worry too much # about returning you something you can't parse. nil end |