projectatomic / commissaire-http

Commissaire HTTP server
GNU General Public License v3.0
3 stars 7 forks source link

AuthN Plugin Response Handling #32

Closed ashcrow closed 8 years ago

ashcrow commented 8 years ago

Authentication plugins can now directly handle the HTTP response body, headers, and code directly if wanted. To handle the responses within the plugin start_response must be called and a list (the response body) must be returned. If the plugin wants to allow the plugin system to handle the rejection the plugin should continue to return True on success and False on failed authentication.

Example:

def authenticate(self, environ, start_response):
    start_response('200 OK', [('content-type', 'text/plain')])
       return [bytes('example', 'utf8')]

May help for #31

ashcrow commented 8 years ago

(3) [multi-host-mgr-2] Allow authn plugins to provide specific status codes

ashcrow commented 8 years ago

@cooktheryan force pushed the spelling mistake.

ashcrow commented 8 years ago

@cooktheryan rebasing now.

ashcrow commented 8 years ago

@cooktheryan rebased. :arrow_up: