Fix example in documentation.
The example lacked the import of keystone.common.wsgi that could be misleading for new developers. Change-Id: I20be59f5792507a775d033867a69d31c5216633c
This commit is contained in:
parent
a2fe23613e
commit
31c6cd80e4
@ -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")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user