diff --git a/README.md b/README.md index 38f283c..d5f979c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Basic authentication example @app.route('/') @auth.login_required def index(): - return "Hello, %s!" % auth.username + return "Hello, %s!" % auth.username() if __name__ == '__main__': app.run() @@ -55,7 +55,7 @@ Digest authentication example @app.route('/') @auth.login_required def index(): - return "Hello, %s!" % auth.username + return "Hello, %s!" % auth.username() if __name__ == '__main__': app.run() @@ -66,34 +66,3 @@ Resources - [Documentation](http://pythonhosted.org/Flask-HTTPAuth) - [pypi](https://pypi.python.org/pypi/Flask-HTTPAuth) -License -------- - -(the BSD license) - -Copyright (c) 2013, Miguel Grinberg -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the Flask-HTTPAuth Project. diff --git a/docs/index.rst b/docs/index.rst index 5652d8b..3e832a9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -33,7 +33,7 @@ The following example application uses HTTP Basic authentication to protect rout @app.route('/') @auth.login_required def index(): - return "Hello, %s!" % auth.username + return "Hello, %s!" % auth.username() if __name__ == '__main__': app.run() @@ -74,7 +74,7 @@ The following example is similar to the previous one, but HTTP Digest authentica @app.route('/') @auth.login_required def index(): - return "Hello, %s!" % auth.username + return "Hello, %s!" % auth.username() if __name__ == '__main__': app.run() @@ -123,18 +123,18 @@ API Documentation def private_page(): return "Only for authorized people!" - .. attribute:: username + .. method:: username() - A view function that is protected with this class can access the logged username through this attribute. Example:: + A view function that is protected with this class can access the logged username through this method. Example:: @app.route('/') @auth.login_required def index(): - return "Hello, %s!" % auth.username + return "Hello, %s!" % auth.username() .. class:: flask.ext.httpauth.HTTPDigestAuth - This class that handles HTTP Digest authentication for Flask routes. The ``SECRET_KEY`` configuration must be set in the Flask application to enable the session to work. Flask by default stores user sessions in the client as secure cookies, so the client must be able to handle cookies. To support clients that are not web browsers or that cannot handle cookies a http://flask.pocoo.org/docs/api/#flask.Flask.session_interface[session interface] that writes sessions in the server must be used. + This class that handles HTTP Digest authentication for Flask routes. The ``SECRET_KEY`` configuration must be set in the Flask application to enable the session to work. Flask by default stores user sessions in the client as secure cookies, so the client must be able to handle cookies. To support clients that are not web browsers or that cannot handle cookies a `session interface `_ that writes sessions in the server must be used. .. method:: get_password(password_callback) @@ -148,7 +148,7 @@ API Documentation *Required*. See basic authentication for documentation and examples. - .. attribute:: username + .. method:: username() See basic authentication for documentation and examples.