From 31c6cd80e45466912836daa9303a4e8c154698c4 Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Tue, 19 Feb 2013 15:25:31 +0100 Subject: [PATCH] Fix example in documentation. The example lacked the import of keystone.common.wsgi that could be misleading for new developers. Change-Id: I20be59f5792507a775d033867a69d31c5216633c --- doc/source/external-auth.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/external-auth.rst b/doc/source/external-auth.rst index dd2a17a199..b7767416d7 100644 --- a/doc/source/external-auth.rst +++ b/doc/source/external-auth.rst @@ -66,6 +66,8 @@ be issued. Your code should set the ``REMOTE_USER`` if the user is properly authenticated, following the semantics below:: + from keystone.common import wsgi + class MyMiddlewareAuth(wsgi.Middleware): def __init__(self, *args, **kwargs): super(MyMiddlewareAuth, self).__init__(*args, **kwargs) @@ -84,7 +86,7 @@ following the semantics below:: # User is authenticated request.environ['REMOTE_USER'] = username else: - # User is not authenticated + # User is not authenticated, render exception raise exception.Unauthorized("Invalid user")