chalice-jwt-1.0.1
توضیحات
JWT integration with Chalice
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | chalice-jwt-1.0.1 |
| نام | chalice-jwt |
| نسخه کتابخانه | 1.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Aniket Sarkar |
| ایمیل نویسنده | aniketsarkar@yahoo.com |
| آدرس صفحه اصلی | https://github.com/marktennyson/chalice-jwt |
| آدرس اینترنتی | https://pypi.org/project/chalice-jwt/ |
| مجوز | MIT |
<h1>Json Web Token based authentication for Python Chalice</h1>
# Maintainers wanted
<!-- [Apply within](https://github.com/github-tools/github/issues/539) -->
# Chalice-JWT
<!-- [][npm-package]
[][npm-package]
[][gitter]
[][travis-ci]
[][codecov] -->
`chalice-jwt` provides a simple interface for jwt based authentication with AWS Chalice microframework(serverless).
source code available at: <a href="https://github.com/marktennyson/chalice-jwt">https://github.com/marktennyson/chalice-jwt</a>
## Usage
```python
from chalice import Chalice
from chalice_jwt import JWTManager
from datetime import timedelta
app = Chalice(app_name='test-jwt')
jwt = JWTManager(jwtSecret="top-secret-key", app=app)
@app.route('/')
def index():
return {'hello': 'world'}
@app.route('/get-token')
def token():
Identity:dict = {"email":"aniketsarkar@yahoo.com"}
return {'token': jwt.create_access_token(identity=Identity, expires_in=timedelta(seconds=60)),}
@app.route('/get-identity')
@jwt.its_required
def login():
return jwt.get_jwt_identity()
```
## Installation
`chalice-jwt` is available from `pypi`.
#### install using pip
```shell
pip install chalice-jwt
```
#### install from source code
```shell
git clone https://github.com/marktennyson/chalice-jwt && cd chalice-jwt
python setup.py install --user
```
## Compatibility
`chalice-jwt` is compatiable with all python3 versions.
Not available for Python version 2.
## Contributing
We welcome contributions of all types!
نیازمندی
| مقدار | نام |
|---|---|
| <3.0,>=2.0 | PyJWT |
| <3.0,>=1.0 | chalice |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6,<4 | Python |
نحوه نصب
نصب پکیج whl chalice-jwt-1.0.1:
pip install chalice-jwt-1.0.1.whl
نصب پکیج tar.gz chalice-jwt-1.0.1:
pip install chalice-jwt-1.0.1.tar.gz