Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hroncok/utvsapitoken
Python class that allows to check a token against ČVUT OAAS and get s personal number form Usermap API
https://github.com/hroncok/utvsapitoken
Last synced: 15 days ago
JSON representation
Python class that allows to check a token against ČVUT OAAS and get s personal number form Usermap API
- Host: GitHub
- URL: https://github.com/hroncok/utvsapitoken
- Owner: hroncok
- License: mit
- Created: 2016-04-28T14:46:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-04T19:35:12.000Z (over 8 years ago)
- Last Synced: 2024-12-13T20:49:49.075Z (20 days ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/utvsapitoken
- Size: 15.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
utvsapitoken
============A little Python class that allows to check a token against `ČVUT OAAS `_ and get s personal number form `Usermap API `_. Used in ÚTVS API.
Usage
-----.. code-block:: python
from utvsapitoken import TokenClient
client = TokenClient()
info = client.token_to_info('token')You can provide custom URIs for the constructor:
.. code-block:: python
client = TokenClient(check_token_uri='http://localhost:8080/token',
usermap_uri='http://localhost:8080/user'))This comes with a fake OAAS that can be used for various testing, including the tests of this very project.
To start the fake server, just run:.. code-block:: python
from utvsapitoken import fakeserver
fakeserver.serve_forever(port=8080)In order to run the testsuite, no need to start the server, just run::
PYTHONPATH=. py.test-3 -v --port 8080
You can omit the port argument to use the default (8080).
This requires Python 3 and ``requests``.
License
-------This software is licensed under the terms of the MIT license, see LICENSE for full text and copyright information.