mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
update env vars for redis and jwt
This commit is contained in:
parent
f160dac370
commit
95ed21bdd5
12
.env
12
.env
@ -8,5 +8,13 @@ SQL_USER=user
|
|||||||
SQL_PASS=secret
|
SQL_PASS=secret
|
||||||
SQL_URL=postgresql+asyncpg://${SQL_USER}:${SQL_PASS}@${SQL_HOST}/${SQL_DB}
|
SQL_URL=postgresql+asyncpg://${SQL_USER}:${SQL_PASS}@${SQL_HOST}/${SQL_DB}
|
||||||
|
|
||||||
ALGORITHM=HS256
|
REDIS_HOST=redis
|
||||||
ACCESS_TOKEN_EXPIRE_MINUTES=30
|
REDIS_PORT=6379
|
||||||
|
REDIS_DB=2
|
||||||
|
REDIS_URL="redis://${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB}"
|
||||||
|
|
||||||
|
JWT_EXPIRE=3600
|
||||||
|
JWT_ALGORITHM=HS256
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
.secrets
2
.secrets
@ -1,2 +1,2 @@
|
|||||||
POSTGRES_PASSWORD=secret
|
POSTGRES_PASSWORD=secret
|
||||||
SECRET_KEY=key
|
FERNET_KEY=Ms1HSn513x0_4WWFBQ3hYPDGAHpKH_pIseC5WwqyO7M=
|
10
README.md
10
README.md
@ -73,6 +73,16 @@ Below steps were done to integrate [rich](https://github.com/Textualize/rich) in
|
|||||||
|
|
||||||
### User authentication with JWT and Redis as token storage :lock: :key:
|
### User authentication with JWT and Redis as token storage :lock: :key:
|
||||||
|
|
||||||
|
#### Generate Fernet key for storing password in db
|
||||||
|
```python
|
||||||
|
In [1]: from cryptography.fernet import Fernet
|
||||||
|
|
||||||
|
In [2]: Fernet.generate_key()
|
||||||
|
Out[2]: b'Ms1HSn513x0_4WWFBQ3hYPDGAHpKH_pIseC5WwqyO7M='
|
||||||
|
|
||||||
|
```
|
||||||
|
Save the key in .secrets as FERNET_KEY
|
||||||
|
|
||||||
|
|
||||||
### Local development with poetry
|
### Local development with poetry
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user