Small updates in readme and docs (#125)

- add info about installation with extra ([]session])
- add links to examples
- move `Public api` header into related section
This commit is contained in:
Grygorii Yermolenko 2018-01-03 12:09:11 +02:00 committed by Andrew Svetlov
parent 8360095011
commit 5d1195b85d
3 changed files with 30 additions and 24 deletions

View File

@ -9,17 +9,31 @@ aiohttp_security
.. image:: https://img.shields.io/pypi/v/aiohttp-security.svg .. image:: https://img.shields.io/pypi/v/aiohttp-security.svg
:target: https://pypi.python.org/pypi/aiohttp-security :target: https://pypi.python.org/pypi/aiohttp-security
The library provides identity and autorization for `aiohttp.web`__. The library provides identity and authorization for `aiohttp.web`__.
.. _aiohttp_web: http://aiohttp.readthedocs.org/en/latest/web.html .. _aiohttp_web: http://aiohttp.readthedocs.org/en/latest/web.html
__ aiohttp_web_ __ aiohttp_web_
Usage Installation
----- ------------
To install type ``pip install aiohttp_security``. Simplest case (authorization via cookies) ::
Launch ``make doc`` and see examples or look under **demo** directory for a
sample project. $ pip install aiohttp_security
With `aiohttp-session` support ::
$ pip install aiohttp_security[session]
Examples
--------
Take a look at examples:
:ref:`aiohttp-security-example`
:ref:`aiohttp-security-example-db-auth`
and demos at **demo** directory.
Documentation Documentation
------------- -------------

View File

@ -3,16 +3,9 @@ aiohttp_security
The library provides security for :ref:`aiohttp.web<aiohttp-web>`. The library provides security for :ref:`aiohttp.web<aiohttp-web>`.
Usage
-----
Contents
License --------
-------
``aiohttp_security`` is offered under the Apache 2 license.
Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@ -23,7 +16,10 @@ Contents:
example_db_auth example_db_auth
glossary glossary
License
-------
``aiohttp_security`` is offered under the Apache 2 license.
Indices and tables Indices and tables
================== ==================

View File

@ -13,6 +13,10 @@ First of all, what is *aiohttp_security* about?
It is a set of public API functions and standard for implementation details. It is a set of public API functions and standard for implementation details.
Public API
==========
API is implementation agnostic, all client code should not call policy API is implementation agnostic, all client code should not call policy
code (see below) directly but use API only. code (see below) directly but use API only.
@ -27,9 +31,6 @@ base classes for both concepts as well as several implementations
shipped with the library. End user is free to build own implemetations shipped with the library. End user is free to build own implemetations
if needed. if needed.
Public API
==========
Authentication Authentication
============== ==============
@ -43,11 +44,6 @@ knowledge is there the user still registered in DB.
If :class:`aiohttp.web.Request` has an :term:`identity` it means the user has If :class:`aiohttp.web.Request` has an :term:`identity` it means the user has
some ID that should be checked by :term:`authorization` policy. some ID that should be checked by :term:`authorization` policy.
:term:`identity` is a string shared between browser and server.
identity is a string shared between browser and server.
Thus it's not supposed to be database primary key, user login/email etc. Thus it's not supposed to be database primary key, user login/email etc.
Random string like uuid or hash is better choice. Random string like uuid or hash is better choice.