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 summary: Admin Logout
description: Logs out the authenticated admin and invalidates the JWT token description: Logs out the authenticated admin and invalidates the JWT token
security: security:
- JWT: [] - ApiKeyAuth: []
responses: responses:
200: 200:
description: Logout successful description: Logout successful

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

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

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

Loading…
Cancel
Save