This commit was merged in pull request #2.
This commit is contained in:
Azeez Muibi
2025-04-15 16:56:37 +01:00
parent aafb9a9b41
commit ba96d7a8b4
4 changed files with 72 additions and 0 deletions
+3
View File
@@ -30,6 +30,9 @@ class Config:
JWT_REFRESH_TOKEN_EXPIRES = os.getenv(
"JWT_REFRESH_TOKEN_EXPIRES", timedelta(days=30)
)
JWT_TOKEN_LOCATION = ["headers"]
JWT_HEADER_NAME = "Authorization"
JWT_HEADER_TYPE = "Bearer"
KAFKA_BROKER = 'dev-events.simbrellang.net:9085'
KAFKA_PAYMENT_TOPIC = 'PROCESS_PAYMENT'
+42
View File
@@ -0,0 +1,42 @@
{
"post": {
"tags": [
"Authentication"
],
"summary": "User login",
"description": "Authenticate a user and return a JWT token",
"operationId": "login",
"requestBody": {
"description": "User credentials",
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/LoginRequest.json"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/LoginResponse.json"
}
}
}
},
"400": {
"description": "Invalid request"
},
"401": {
"description": "Invalid username or password"
},
"500": {
"description": "Internal server error"
}
}
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"type": "object",
"properties": {
"username": {
"type": "string",
"example": "digifiuser"
},
"password": {
"type": "string",
"example": "digifipass"
}
},
"required": ["username", "password"]
}
+13
View File
@@ -0,0 +1,13 @@
{
"type": "object",
"properties": {
"jwt_token": {
"type": "string",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWdpZml1c2VyIiwibmFtZSI6ImJhY2tvZmZpY2UgdXNlciIsImlhdCI6MTUxNjIzOTAyMn0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
},
"name": {
"type": "string",
"example": "backoffice user"
}
}
}