Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.5 dev #1265

Merged
merged 4 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions api/v1/schema/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Any, List
from pydantic import Field
from ninja import ModelSchema, Schema
from arkid.config import get_app_config
from arkid.core.translation import gettext_default as _
from arkid.core.schema import ResponseSchema
from arkid.core.models import App
Expand Down Expand Up @@ -40,7 +39,7 @@ class AppItemOut(ModelSchema):
title=_('secret', '接口访问密钥'),
default='请点击刷新按钮获取密钥',
suffix_action={
"path": get_app_config().get_host() + '/api/v1/tenant/{tenant_id}/apps/{id}/read_secret/',
"path": '/api/v1/tenant/{tenant_id}/apps/{id}/read_secret/',
"method": "get",
"delay":60,
"name":_("刷新密钥")
Expand Down
9 changes: 5 additions & 4 deletions arkid/core/request_response_logging_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ def __init__(self, get_response):
self.get_response = get_response
# One-time configuration and initialization.

# Filter to log all request to url's that start with any of the strings below.
# Filter to log all request to url's that does not start with any of the strings below.
self.prefixs = [
"/api/v1/ping/"
]

def __call__(self, request):
Expand All @@ -32,10 +33,10 @@ def __call__(self, request):

exec_time = int((time.time() - start)*1000)

# If the url does not start with on of the prefixes above, then return response and dont save log.
# If the url starts with on of the prefixes above, then return response and dont save log.
# (Remove these two lines below to log everything)
# if not list(filter(request.get_full_path().startswith, self.prefixs)):
# return response
if list(filter(request.get_full_path().startswith, self.prefixs)):
return response

try:
body_request = str(request.body.decode())
Expand Down