Skip to content

Commit 976725c

Browse files
committed
fix: updated .env file and added security related items
1 parent 1c31855 commit 976725c

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.env

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ REDIS_HOST=redis
77
REDIS_PORT=6379
88
REDIS_URL=redis://redis:6379/0
99
#MongoDB
10-
MONGODB_URL=mongodb://mongo:27017
10+
MONGODB_URL=mongodb://mongo:27017
11+
#Secrets
12+
SECRET_KEY="YourSecretKeyHere"
13+
ALGORITHM="HS256"
14+
ACCESS_TOKEN_EXPIRE_MINUTES=30

app/auth/handlers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from datetime import UTC, datetime, timedelta
23
from typing import Annotated
34

@@ -13,9 +14,9 @@
1314

1415
# to get a string like this run:
1516
# openssl rand -hex 32
16-
SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
17-
ALGORITHM = "HS256"
18-
ACCESS_TOKEN_EXPIRE_MINUTES = 30
17+
SECRET_KEY = os.environ.get("SECRET_KEY")
18+
ALGORITHM = os.environ.get("ALGORITHM")
19+
ACCESS_TOKEN_EXPIRE_MINUTES = os.environ.get("ACCESS_TOKEN_EXPIRE_MINUTES")
1920

2021
router = APIRouter()
2122

app/auth/handlers_scopes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from datetime import UTC, datetime, timedelta
23
from typing import Annotated
34

@@ -17,9 +18,9 @@
1718

1819
# to get a string like this run:
1920
# openssl rand -hex 32
20-
SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
21-
ALGORITHM = "HS256"
22-
ACCESS_TOKEN_EXPIRE_MINUTES = 30
21+
SECRET_KEY = os.environ.get("SECRET_KEY")
22+
ALGORITHM = os.environ.get("ALGORITHM")
23+
ACCESS_TOKEN_EXPIRE_MINUTES = os.environ.get("ACCESS_TOKEN_EXPIRE_MINUTES")
2324

2425
router = APIRouter()
2526

0 commit comments

Comments
 (0)