Skip to content

Commit 5d1195b

Browse files
gyermolenkoasvetlov
authored andcommitted
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
1 parent 8360095 commit 5d1195b

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

README.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,31 @@ aiohttp_security
99
.. image:: https://img.shields.io/pypi/v/aiohttp-security.svg
1010
:target: https://pypi.python.org/pypi/aiohttp-security
1111

12-
The library provides identity and autorization for `aiohttp.web`__.
12+
The library provides identity and authorization for `aiohttp.web`__.
1313

1414
.. _aiohttp_web: http://aiohttp.readthedocs.org/en/latest/web.html
1515

1616
__ aiohttp_web_
1717

18-
Usage
19-
-----
20-
To install type ``pip install aiohttp_security``.
21-
Launch ``make doc`` and see examples or look under **demo** directory for a
22-
sample project.
18+
Installation
19+
------------
20+
Simplest case (authorization via cookies) ::
21+
22+
$ pip install aiohttp_security
23+
24+
With `aiohttp-session` support ::
25+
26+
$ pip install aiohttp_security[session]
27+
28+
Examples
29+
--------
30+
Take a look at examples:
31+
32+
:ref:`aiohttp-security-example`
33+
34+
:ref:`aiohttp-security-example-db-auth`
35+
36+
and demos at **demo** directory.
2337

2438
Documentation
2539
-------------

docs/index.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@ aiohttp_security
33

44
The library provides security for :ref:`aiohttp.web<aiohttp-web>`.
55

6-
Usage
7-
-----
86

9-
10-
License
11-
-------
12-
13-
``aiohttp_security`` is offered under the Apache 2 license.
14-
15-
Contents:
7+
Contents
8+
--------
169

1710
.. toctree::
1811
:maxdepth: 2
@@ -23,7 +16,10 @@ Contents:
2316
example_db_auth
2417
glossary
2518

19+
License
20+
-------
2621

22+
``aiohttp_security`` is offered under the Apache 2 license.
2723

2824
Indices and tables
2925
==================

docs/usage.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ First of all, what is *aiohttp_security* about?
1313

1414
It is a set of public API functions and standard for implementation details.
1515

16+
17+
Public API
18+
==========
19+
1620
API is implementation agnostic, all client code should not call policy
1721
code (see below) directly but use API only.
1822

@@ -27,9 +31,6 @@ base classes for both concepts as well as several implementations
2731
shipped with the library. End user is free to build own implemetations
2832
if needed.
2933

30-
Public API
31-
==========
32-
3334

3435
Authentication
3536
==============
@@ -43,11 +44,6 @@ knowledge is there the user still registered in DB.
4344
If :class:`aiohttp.web.Request` has an :term:`identity` it means the user has
4445
some ID that should be checked by :term:`authorization` policy.
4546

46-
47-
48-
49-
50-
51-
identity is a string shared between browser and server.
47+
:term:`identity` is a string shared between browser and server.
5248
Thus it's not supposed to be database primary key, user login/email etc.
5349
Random string like uuid or hash is better choice.

0 commit comments

Comments
 (0)