Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

ModelSEED Auth Factory

Scott Devoid edited this page Jun 29, 2012 · 1 revision

ModelSEED::Auth::Factory

Generate a ModelSEED::Auth from varous sources.

Abstract

This is a factory which returns a ModelSEED::Auth object.

Methods

from_http_request

$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.

from_dancer_request

$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.

from_config

$auth = $factory->from_config()

Returns an auth from the ModelSEED::Configuration information.

Notes

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 >