OAuth2 token validation for UTVS API
Project description
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
from utvsapitoken import TokenClient
client = TokenClient()
info = client.token_to_info('token')
You can provide custom URIs for the constructor:
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:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file utvsapitoken-0.0.2.tar.gz.
File metadata
- Download URL: utvsapitoken-0.0.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f37456bbc812842d6efb6fc1fc8f92c01de6c53c44b4002681fd697807052c0
|
|
| MD5 |
d2d60cbaca55463d347fd890a878f345
|
|
| BLAKE2b-256 |
afaf4d43a2ec29c96b5649b0e3ccd610f6d713f66d5d50f36ca1560cce930ca6
|