Add missing import, remove trailing ":" in middleware example
Minor fixes to the external authentication example given in the documentation. Change-Id: I2bef7da8bf8278349fec80a513095637ea49f19a Closes-Bug: #1308634 Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
This commit is contained in:
parent
e1f6ec31fc
commit
0473e5ab75
|
@ -100,6 +100,7 @@ following the semantics below:
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
from keystone.common import wsgi
|
from keystone.common import wsgi
|
||||||
|
from keystone import exception
|
||||||
|
|
||||||
class MyMiddlewareAuth(wsgi.Middleware):
|
class MyMiddlewareAuth(wsgi.Middleware):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -114,7 +115,7 @@ following the semantics below:
|
||||||
# Not applicable
|
# Not applicable
|
||||||
return self.application
|
return self.application
|
||||||
|
|
||||||
username = self.do_auth(request):
|
username = self.do_auth(request)
|
||||||
if username is not None:
|
if username is not None:
|
||||||
# User is authenticated
|
# User is authenticated
|
||||||
request.environ['REMOTE_USER'] = username
|
request.environ['REMOTE_USER'] = username
|
||||||
|
|
Loading…
Reference in New Issue