change auth and docs path

pull/21891/head
ytqh 1 year ago
parent 54e3250156
commit 92e8ec7002

@ -104,7 +104,7 @@ class LogoutApi(Resource):
summary: Admin Logout
description: Logs out the authenticated admin and invalidates the JWT token
security:
- JWT: []
- ApiKeyAuth: []
responses:
200:
description: Logout successful

@ -12,7 +12,7 @@ class RiskStats(Resource):
summary: Get risk level user counts
description: Get counts of users at different risk levels and their changes
security:
- JWT: []
- ApiKeyAuth: []
parameters:
- name: start_date
in: query
@ -58,7 +58,7 @@ class UserStats(Resource):
summary: Get daily active and new user counts
description: Get statistics of daily active users and new users
security:
- JWT: []
- ApiKeyAuth: []
parameters:
- name: start_date
in: query
@ -106,7 +106,7 @@ class ConversationStats(Resource):
summary: Get daily conversation counts and averages
description: Get statistics of daily total conversations and average conversations per user
security:
- JWT: []
- ApiKeyAuth: []
parameters:
- name: start_date
in: query

@ -35,7 +35,7 @@ class LogoutApi(Resource):
summary: Logout User
description: Logs out the authenticated user and invalidates the session
security:
- JWT: []
- ApiKeyAuth: []
responses:
200:
description: Successfully logged out
@ -226,7 +226,7 @@ class RefreshTokenApi(Resource):
summary: Refresh Token
description: Refreshes an access token using a valid refresh token
security:
- JWT: []
- ApiKeyAuth: []
parameters:
- in: body
name: body

@ -8,12 +8,15 @@ def init_app(app: DifyApp):
app.config['SWAGGER'] = {
'title': 'API Docs',
'uiversion': 3,
'url_prefix': '/openapi',
'specs_route': '/',
'static_url_path': '/flasgger_static',
'securityDefinitions': {
'JWT': {
'ApiKeyAuth': {
'type': 'apiKey',
'name': 'access-token', # name of the cookie
'in': 'header', # specify that auth is in cookie
'description': 'JWT Authorization cookie'
'name': 'Authorization',
'in': 'header',
'description': 'API Key Authorization header using Bearer scheme. Example: "Bearer {token}"'
}
}
}

Loading…
Cancel
Save