-
Notifications
You must be signed in to change notification settings - Fork 10
ModelSEED Auth Factory
Generate a ModelSEED::Auth from varous sources.
This is a factory which returns a ModelSEED::Auth object.
$auth = $factory->from_http_request($req)
Returns an auth from an http request. If Basic Authorization is used, this returns a ModelSEED::Auth::Basic. If no authorization is used, this reutrns a ModelSEED::Auth::Public. In the future, we will include OAuth support.
$auth = $factory->from_dancer_request($req)
Returns an auth from an Dancer::Request. If Basic Authorization is used, this returns a ModelSEED::Auth::Basic. If no authorization is used, this reutrns a ModelSEED::Auth::Public. In the future, we will include OAuth support.
$auth = $factory->from_config()
Returns an auth from the ModelSEED::Configuration information.
It looks like the HTTP::Request "Authorization" header inserts an additional colon while the Dancer::Request respects the HTTP spec and does not. So where Dancer::Request has:
Authorization: Basic <base64 encoded username:password >
HTTP::Request has:
Authorization: Basic: <base64 encoded username:password >