Authen...esponse(3pm)

πŸ“¦
version 0.08 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie, gather round, because this is Authen::CAS::Client::Response β€” a whole lil set of classes for implementing responses from a CAS server πŸ¦‹βœ¨


🌸 DESCRIPTION 🌸

so basically, Authen::CAS::Client::Response implements a base class that's used to build up a whole hierarchy of response objects, and those get returned from methods in Authen::CAS::Client. πŸ’…

and like… most of these response objects? their whole job is to encapsulate one specific type of response from a CAS server. no more, no less. it's giving "I have one task and I ate." πŸ‘‘


✨ CLASSES AND METHODS ✨

🫢 Authen::CAS::Client::Response

Authen::CAS::Client::Response is the base class, and every other response class inherits from it. so it's very primitive, very "I'm the blueprint bestie," and it is never used directly. periodt. πŸ’€

  • new( %args ) β€” new() creates an instance of an Authen::CAS::Client::Response object and assigns its data members according to the values in %args.
  • is_error() β€” returns true if the response represents an error object.
  • is_failure() β€” returns true if the response represents a failure object.
  • is_success() β€” returns true if the response represents a success object.
  • doc() β€” returns the response document that was used to create the response object. for errors and CAS v1.0 requests, this is gonna be the raw text response from the server. otherwise you get an XML::LibXML object back. lowkey perfect for debugging or for grabbing extra info out of the CAS server's response πŸ”βœ¨

😭 Authen::CAS::Client::Response::Error

Authen::CAS::Client::Response::Error is what shows up when an error happens that stops further processing of a request. and bestie, that includes a LOT of scenarios:

  • not being able to connect to the CAS server πŸ™ˆ
  • receiving an unexpected response from the server
  • not being able to correctly parse the server's response according to the guidelines in the CAS protocol specification πŸ’€
  • new( error => $error, doc => $doc ) β€” creates an instance of an Authen::CAS::Client::Response::Error object. $error is the error string. $doc is the response document.
  • error() β€” returns the error string.

πŸ’… Authen::CAS::Client::Response::Failure

Authen::CAS::Client::Response::Failure is used as a base class for other failure responses. these correspond to the cas:authenticationFailure and cas:proxyFailure server responses outlined in the CAS protocol specification. sad girl hours fr fr πŸ˜”

  • new( code => $code, message => $message, doc => $doc ) β€” creates an instance of an Authen::CAS::Client::Response::Failure object. $code is the failure code. $message is the failure message. $doc is the response document.
  • code() β€” returns the failure code.
  • message() β€” returns the failure message.

πŸŽ€ Authen::CAS::Client::Response::AuthFailure

Authen::CAS::Client::Response::AuthFailure is a subclass of Authen::CAS::Client::Response::Failure, and it's used when a validation attempt fails. not the vibe we wanted, but okay. πŸ₯²

here's the tea on how the fields get set, depending on protocol:

  • when using the CAS v2.0 protocol: $code, $message and $doc are set according to what is parsed from the server response.
  • when using the CAS v1.0 protocol: $code is set to 'V10_AUTH_FAILURE', $message is set to the empty string, and $doc is set to the server's response content.
No additional methods are defined. that's it, that's the whole class 🫢

πŸ¦‹ Authen::CAS::Client::Response::ProxyFailure

Authen::CAS::Client::Response::ProxyFailure is a subclass of Authen::CAS::Client::Response::Failure, and it's used when a cas:proxyFailure response comes back from the CAS server during a proxy attempt. πŸ’€

$code, $message and $doc are set according to what is parsed from the server response.

No additional methods are defined. iconic minimalism ✨

🌈 Authen::CAS::Client::Response::Success

Authen::CAS::Client::Response::Success is used as a base class for other success responses. these correspond to the cas:authenticationSuccess and cas:proxySuccess server responses. we love a win πŸ’–

  • new( doc => $doc ) β€” creates an instance of an Authen::CAS::Client::Response::Success object. $doc is the response document.

πŸ‘‘ Authen::CAS::Client::Response::AuthSuccess

Authen::CAS::Client::Response::AuthSuccess is a subclass of Authen::CAS::Client::Response::Success, and it's used when validation succeeds. main character energy, honestly. 🌟

  • new( user => $user, iou => $iou, proxies => \@proxies, doc => $doc ) β€” creates an instance of an Authen::CAS::Client::Response::AuthSuccess object. $user is the username received in the response. $iou is the proxy granting ticket IOU, if present. \@proxies is the list of proxies used during validation, if present. $doc is the response document.
  • user() β€” returns the user name that was contained in the server response.
  • iou() β€” returns the proxy granting ticket IOU, if it was present in the server response. otherwise it is set to undef. 🫠
  • proxies() β€” returns the list of proxies present in the server response. if no proxies are found, an empty list is returned. and in scalar context, an array reference will be returned instead. context matters, bestie, always 🧚

⭐ Authen::CAS::Client::Response::ProxySuccess

Authen::CAS::Client::Response::ProxySuccess is a subclass of Authen::CAS::Client::Response::Success, and it's used when a cas:proxySuccess response is received from the CAS server during a proxy attempt. slay πŸ”₯

  • new( proxy_ticket => $proxy_ticket, doc => $doc ) β€” creates an instance of an Authen::CAS::Client::Response::ProxySuccess object. $proxy_ticket is the proxy ticket received in the response. $doc is the response document.
  • proxy_ticket() β€” returns the proxy ticket that was contained in the server response. 🎟️

πŸ’€ BUGS πŸ’€

none are known at this time, but if you find one, please feel free to submit a report to the author. bestie, if you find a bug, SAY SOMETHING. don't gatekeep. πŸ™


🫢 AUTHOR 🫢

jason hord <pravus@cpan.org>


🌸 SEE ALSO 🌸

  • Authen::CAS::Client

πŸŽ€ LICENSE πŸŽ€

This software is information. It is subject only to local laws of physics.

literally the most unhinged and most correct license of all time. no cap. πŸ’…βœ¨


and that's the whole page, bestie β€” this one shipped as part of perl v5.36.0, dated 2022-10-13, so go forth and handle those CAS responses like the icon you are. πŸ¦‹πŸ’–πŸ‘‘

πŸ“¦ where this page comes from