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

Release 2.5.10 #1249

Merged
merged 68 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
dc606fc
feat: 🎸 update
longgui-penglei Aug 30, 2022
f88dd96
Merge branch 'v2.5-dev' into dev-pl
longgui-penglei Aug 30, 2022
06c38f5
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into dev-pl
longgui-penglei Aug 30, 2022
0849dde
feat: 🎸 表格排序新增action
guancyxx Aug 31, 2022
272413a
feat: 🎸 添加多个测试点
guancyxx Aug 31, 2022
8f15d92
feat: 🎸 更改排序方式
guancyxx Aug 31, 2022
a585b3e
feat: 🎸 添加排序action类型
guancyxx Aug 31, 2022
6e59bf9
feat: 🎸 更新权限内容
jinji-hanbin Aug 31, 2022
fd2d967
feat: 🎸 更新创建问题
jinji-hanbin Aug 31, 2022
8ad2eb4
docs: ✏️ 优化插件文档
fanhe-lg Aug 31, 2022
a0f961a
Merge pull request #1226 from longguikeji/feature-651
fanhe-lg Aug 31, 2022
7efa0f3
feat: 🎸 更新租户
jinji-hanbin Aug 31, 2022
f70c622
Merge pull request #1227 from longguikeji/feature-402
hanbinloop Aug 31, 2022
fb6d06c
feat: 🎸 完善内容
jinji-hanbin Aug 31, 2022
0c8a74e
Merge pull request #1228 from longguikeji/feature-402
hanbinloop Aug 31, 2022
b67ba77
feat: 🎸 普通用户权限缩小
jinji-hanbin Aug 31, 2022
1f80d25
test: 💍 普通用户权限缩小
jinji-hanbin Aug 31, 2022
b5f375d
Merge pull request #1229 from longguikeji/feature-402
hanbinloop Aug 31, 2022
9577abb
feat: 🎸 当前系统如果支持IDaaS的话,用户登录后进入后默认打开切换租户页面
guancyxx Aug 31, 2022
7d78444
Merge pull request #1230 from longguikeji/feature-718
guancyxx Aug 31, 2022
ef996e5
Merge pull request #1231 from longguikeji/feature-715
guancyxx Aug 31, 2022
d6e930b
fix: 🐛 受schema更改影响jie'kou接口BUG
guancyxx Aug 31, 2022
0cf101f
fix: 🐛 expandobject不能获取property只读属性问题
guancyxx Aug 31, 2022
6543592
feat: 🎸 删除不再使用的schema
guancyxx Aug 31, 2022
f708f00
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into dev-pl
longgui-penglei Sep 1, 2022
8c63999
fix: 🐛 app install (#1232)
luolu-lg Sep 1, 2022
b7da31c
feat: 🎸 新建租户添加默认认证因素
guancyxx Sep 1, 2022
9c98c61
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into v2.5-dev
guancyxx Sep 1, 2022
1ae684e
feat: 🎸 验证码输入错误应刷新验证码
guancyxx Sep 1, 2022
ea34ee4
Merge pull request #1235 from longguikeji/feature-677
guancyxx Sep 1, 2022
41020e1
feat: 🎸 default_tenant添加is_platform_tenant字段
guancyxx Sep 1, 2022
8881897
Merge pull request #1236 from longguikeji/feature-677
guancyxx Sep 1, 2022
9baeefb
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into dev-pl
longgui-penglei Sep 2, 2022
713a0dc
feat: 🎸 用户列表接口添加注册时间字段
guancyxx Sep 2, 2022
4b46223
Merge pull request #1237 from longguikeji/feature-726
guancyxx Sep 2, 2022
640cd22
feat: 🎸 应用授权主体逻辑完成
jinji-hanbin Sep 2, 2022
19b701d
feat: 🎸 更新冲突的应用
jinji-hanbin Sep 2, 2022
acb2818
Merge pull request #1239 from longguikeji/feature-402
hanbinloop Sep 2, 2022
984c216
fix: 🐛 应用分组删除BUG
guancyxx Sep 2, 2022
ad8cc17
fix: 🐛 应用分组获取时过滤条件
guancyxx Sep 2, 2022
d9701f3
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into v2.5-dev
guancyxx Sep 2, 2022
d6e2f3e
Merge
longgui-penglei Sep 2, 2022
eded742
fix: 🐛 app_group
longgui-penglei Sep 2, 2022
dc2f036
fix: 🐛 permission_data
longgui-penglei Sep 2, 2022
ccfce03
Merge branch 'v2.5-dev' feature-fix-app-group
longgui-penglei Sep 2, 2022
819c01e
Merge pull request #1241 from longguikeji/feature-theme
longgui-penglei Sep 2, 2022
ca0dfa9
fix: 🐛 修复active_objects使用错误的地方
guancyxx Sep 2, 2022
ed5b82d
Merge branches 'v2.5-dev' and 'v2.5-dev' of github.com:longguikeji/ar…
guancyxx Sep 2, 2022
3615908
feat: 🎸 add request and response logging
luolu-lg Aug 25, 2022
ec4055e
fix: 🐛 request logs
luolu-lg Sep 2, 2022
4682501
Merge pull request #1242 from longguikeji/feature-logging-request
luolu-lg Sep 2, 2022
d95a47c
feat: 🎸 处理视图函数注释
guancyxx Sep 2, 2022
ff583ca
fix: 🐛 log detail output
luolu-lg Sep 2, 2022
d8bf10e
Merge pull request #1243 from longguikeji/feature-logging-request
luolu-lg Sep 2, 2022
936fe46
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into v2.5-dev
guancyxx Sep 5, 2022
b5adad7
feat: 🎸 完成了operation_id的描述
jinji-hanbin Sep 5, 2022
b043b35
Merge pull request #1244 from longguikeji/feature-402
hanbinloop Sep 5, 2022
bb9e373
fix: 🐛 scim-server生成scim user和group的id设置成str类型
fanhe-lg Sep 5, 2022
d30fc2a
Merge pull request #1245 from longguikeji/feature-651
fanhe-lg Sep 5, 2022
b605a98
feat: 🎸 更新文档内容
jinji-hanbin Sep 5, 2022
2ad37df
Merge pull request #1246 from longguikeji/feature-402
hanbinloop Sep 5, 2022
255932a
fix: 🐛 给租户列表添加角色
welylongguikeji Sep 5, 2022
a2999b7
Merge branch 'v2.5-dev' of https://github.com/longguikeji/arkid into …
welylongguikeji Sep 5, 2022
e3f4d4e
feat: 🎸 更新了secret值
jinji-hanbin Sep 5, 2022
88fa63a
feat: 🎸 权限更新
jinji-hanbin Sep 5, 2022
9730c0d
Merge pull request #1247 from longguikeji/feature-402
hanbinloop Sep 5, 2022
97e3e7e
feat: 🎸 增加了搜索条件
jinji-hanbin Sep 5, 2022
ae13271
Merge pull request #1248 from longguikeji/feature-402
hanbinloop Sep 5, 2022
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
5 changes: 5 additions & 0 deletions api/v1/pages/app_manage/app_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
'create':actions.CreateAction(
path='/api/v1/tenant/{tenant_id}/apps/'
),
"order_name":actions.OrderSetAction(
path='/api/v1/tenant/{tenant_id}/apps/',
method=actions.FrontActionMethod.GET,
order_parms=["name"]
)
},
node_actions=[
actions.DirectAction(
Expand Down
5 changes: 5 additions & 0 deletions api/v1/pages/auth_manage/auth_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
global_actions={
'create': actions.CreateAction(
path='/api/v1/tenant/{tenant_id}/auth_factors/',
),
"order_name":actions.OrderSetAction(
path='/api/v1/tenant/{tenant_id}/auth_factors/',
method=actions.FrontActionMethod.GET,
order_parms=["name"]
)
},
local_actions={
Expand Down
2 changes: 1 addition & 1 deletion api/v1/pages/auth_manage/auth_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
global_actions={
'create': actions.CreateAction(
path='/api/v1/tenant/{tenant_id}/auth_rules/',
)
),
},
local_actions={
"edit": actions.EditAction(
Expand Down
10 changes: 9 additions & 1 deletion api/v1/pages/desktop/mine_app_group_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/arkstore/apps/{id}/click/',
method=actions.FrontActionMethod.GET,
)
),
],
global_actions={
"order_name":actions.OrderAction(
up="/api/v1/mine/tenant/{tenant_id}/mine_group_apps/?app_group_id={app_group_id}&order=name",
down="/api/v1/mine/tenant/{tenant_id}/mine_group_apps/?app_group_id={app_group_id}&order=-name",
method=actions.FrontActionMethod.GET,
order_parm="name"
)
}
)
6 changes: 0 additions & 6 deletions api/v1/pages/log_manage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
from arkid.core import routers
from arkid.core.translation import gettext_default as _
from . import log_config,manager_log,user_log

router = routers.FrontRouter(
path='log_manage',
name=_('日志管理'),
icon='log',
children=[
log_config.router,
manager_log.router,
user_log.router,
]
)
1 change: 1 addition & 0 deletions api/v1/pages/mine/switch_tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
),
global_actions={
'create': actions.CreateAction(
name=_("新建租户"),
path='/api/v1/tenants/',
)
},
Expand Down
29 changes: 27 additions & 2 deletions api/v1/pages/permission_manage/grant_manage/app_grant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

page = pages.TreePage(tag=tag,name=name)
app_permission_page = pages.TablePage(name=_("该应用权限"))
update_app_permission_page = pages.TablePage(name=_("更新应用权限"), select=True)

pages.register_front_pages(page)
pages.register_front_pages(app_permission_page)
pages.register_front_pages(update_app_permission_page)

page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/all_apps_in_arkid/',
path='/api/v1/tenant/{tenant_id}/all_apps_in_arkid/?not_arkid=1',
method=actions.FrontActionMethod.GET,
),
node_actions=[
Expand All @@ -25,7 +27,30 @@

app_permission_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/permissions?app_id={app_id}',
path='/api/v1/tenant/{tenant_id}/apps/{id}/permissions',
method=actions.FrontActionMethod.GET
),
local_actions={
"delete": actions.DeleteAction(
path='/api/v1/tenant/{tenant_id}/permission/app/{select_app_id}/{permission_id}/remove_permission'
)
},
global_actions={
'open': actions.OpenAction(
name=("添加应用权限"),
page=update_app_permission_page
),
}
)

update_app_permission_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/permissions',
method=actions.FrontActionMethod.GET
),
global_actions={
'confirm':actions.ConfirmAction(
path='/api/v1/tenant/{tenant_id}/permission/app/{select_app_id}/add_permission',
),
}
)
6 changes: 6 additions & 0 deletions api/v1/pages/user_manage/user_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
'create': actions.CreateAction(
path='/api/v1/tenant/{tenant_id}/users/',
),
"order_username":actions.OrderAction(
up="/api/v1/tenant/{tenant_id}/users/?order=username",
down="/api/v1/tenant/{tenant_id}/users/?order=-username",
method=actions.FrontActionMethod.GET,
order_parm="username"
)
},
local_actions={
"edit": actions.EditAction(
Expand Down
15 changes: 15 additions & 0 deletions api/v1/schema/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class AppListsOut(ResponseSchema):
class AppItemOut(ModelSchema):

id: UUID = Field(readonly=True)
read_secret: str = Field(readonly=True, title=_('secret', '接口访问密钥'), default='', append={
"http": {
"url": '/api/v1/tenant/{tenant_id}/apps/{id}/read_secret/',
"method": "get",
},
})

class Config:
model = App
Expand All @@ -44,6 +50,15 @@ class AppOut(ResponseSchema):
data: AppItemOut


class AppReadSecretItemOut(Schema):

read_secret: str = Field(readonly=True, title=_('secret', '接口访问密钥'))


class AppReadSecretOut(ResponseSchema):
data: AppReadSecretItemOut


class AppUpdateIn(ModelSchema):

class Config:
Expand Down
4 changes: 4 additions & 0 deletions api/v1/schema/mine.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ class Config:


class MineTenantListItemOut(ModelSchema):

role:str = Field(title='角色')

class Config:
model = Tenant
model_fields = ["id", "name", "slug", "icon"]

class MinePermissionListSchemaOut(Schema):

id: UUID = Field(hidden=True)
operation_id: str = Field(default='', title=_("操作ID"))
name: str
# app_name: str = Field(default=None, alias="app.name", title=_("应用名称"))
category: str
Expand Down
20 changes: 18 additions & 2 deletions api/v1/schema/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,32 @@ class PermissionsListSchemaOut(ModelSchema):

app_name: str = Field(default=None, alias="app.name", title=_("应用名称"))
sort_id: int = Field(hidden=True)
is_open: bool = Field(item_action={"path":"/api/v1/tenant/{tenant_id}/permission/{id}/toggle_open", "method":actions.FrontActionMethod.POST.value}, title=_("是否授权给其它租户"))
# is_open: bool = Field(item_action={"path":"/api/v1/tenant/{tenant_id}/permission/{id}/toggle_open", "method":actions.FrontActionMethod.POST.value}, title=_("是否授权给其它租户"))
category: str = Field(title=_("分类名称"))
operation_id: str = Field(default='', title=_("操作ID"))

class Config:
model = Permission
model_fields = ['id', 'name', 'is_system']
model_fields = ['id', 'operation_id', 'name', 'is_system']


class AppPermissionsItemSchemaOut(Schema):

id: UUID = Field(hidden=True)
operation_id: str = Field(default='', title=_("操作ID"))
name: str = Field(title=_("名称"))
app_name: str = Field(default=None, alias='app.name', title=_("应用名称"))
sort_id: int = Field(hidden=True)
category: str = Field(title=_("分类名称"))


class AppPermissionsListSchemaOut(ResponseSchema):
data: List[AppPermissionsItemSchemaOut]

class UserAppLastPermissionsItemSchemaOut(Schema):

id: UUID = Field(default=None)
operation_id: str = Field(default='', title=_("操作ID"))
name: str = Field(title=_("名称"))
is_system: bool = Field(title=_("是否是系统权限"))
app_name: str = Field(default=None, alias="app.name", title=_("应用名称"))
Expand Down
2 changes: 2 additions & 0 deletions api/v1/schema/permission_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ class PermissionGroupEditSchemaIn(Schema):

class PermissionListSchemaOut(Schema):
category: str = Field(title=_("分类名称"))
operation_id: str = Field(default='', title=_("操作ID"))
id: UUID = Field(title=_("id"))
name: str = Field(title=_("名称"))
is_open: bool = Field(item_action={"path":"/api/v1/tenant/{tenant_id}/permission/{id}/toggle_open", "method":actions.FrontActionMethod.POST.value}, title=_("是否授权给其它租户"))
is_system: bool = Field(title=_("是否是系统权限 "))
# class Config:
# model = SystemPermission
Expand Down
12 changes: 12 additions & 0 deletions api/v1/schema/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ class Config:
model = Tenant
model_fields = ["id","name","slug","icon"]

is_platform_tenant:bool = Field(
title=_("是否是平台租户")
)

@staticmethod
def resolve_is_platform_tenant(obj):
return obj.is_platform_tenant

class TenantOut(ResponseSchema):

data: TenantItemOut
Expand Down Expand Up @@ -98,6 +106,10 @@ class DefaultTenantItemOut(ModelSchema):
class Config:
model = Tenant
model_fields = ["id", "name"]

is_platform_tenant:bool = Field(
title=_("是否是平台租户")
)

class DefaultTenantOut(ResponseSchema):
data: DefaultTenantItemOut
Expand Down
10 changes: 7 additions & 3 deletions api/v1/schema/user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional
from typing import Any, List, Optional
from uuid import UUID
from ninja import ModelSchema, Schema
from arkid.core.models import User
Expand All @@ -15,8 +15,12 @@ class UserListItemOut(ModelSchema):

class Config:
model = User
model_fields = ['id', 'username', 'avatar']

model_fields = ['id', 'username', 'avatar','created']

created:Any = Field(
title=_("注册时间")
)

class UserListOut(ResponseSchema):
data: List[UserListItemOut]

Expand Down
2 changes: 1 addition & 1 deletion api/v1/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
permission_group,
platform_config,
languape,
log,
# log,
front_theme,
approve_request,
approve_system,
Expand Down
34 changes: 26 additions & 8 deletions api/v1/views/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@


@api.get("/tenant/{tenant_id}/apps/", response=List[AppListItemOut], tags=['应用'])
@operation(AppListOut, roles=[NORMAL_USER, TENANT_ADMIN, PLATFORM_ADMIN])
@operation(AppListOut, roles=[TENANT_ADMIN, PLATFORM_ADMIN])
@paginate(CustomPagination)
def list_apps(request, tenant_id: str):
def list_apps(request, tenant_id: str,order:str=None):
'''
app列表
'''
Expand All @@ -37,6 +37,11 @@ def list_apps(request, tenant_id: str):
is_active=True,
is_del=False
)

if order:
apps = apps.order_by(order)
else:
apps = apps.order_by('-created')
# # 取得请求地址和方式
# method = request.method
# url = request.resolver_match.route
Expand All @@ -45,11 +50,11 @@ def list_apps(request, tenant_id: str):
# from arkid.core.perm.permission_data import PermissionData
# pd = PermissionData()
# pd.update_arkid_system_permission()
return apps.order_by('created')
return apps


@api.get("/tenant/{tenant_id}/open_apps/", response=List[AppListItemOut], tags=['应用'])
@operation(AppListOut, roles=[NORMAL_USER, TENANT_ADMIN, PLATFORM_ADMIN])
@operation(AppListOut, roles=[TENANT_ADMIN, PLATFORM_ADMIN])
@paginate(CustomPagination)
def list_open_apps(request, tenant_id: str):
'''
Expand All @@ -62,7 +67,7 @@ def list_open_apps(request, tenant_id: str):


@api.get("/tenant/{tenant_id}/all_apps/", response=List[AppListItemOut], tags=['应用'])
@operation(AppListOut, roles=[NORMAL_USER, TENANT_ADMIN, PLATFORM_ADMIN])
@operation(AppListOut, roles=[TENANT_ADMIN, PLATFORM_ADMIN])
@paginate(CustomPagination)
def list_all_apps(request, tenant_id: str):
'''
Expand All @@ -75,7 +80,7 @@ def list_all_apps(request, tenant_id: str):


@api.get("/tenant/{tenant_id}/all_apps_in_arkid/", response=AppListsOut, tags=['应用'])
@operation(AppListOut, roles=[NORMAL_USER, TENANT_ADMIN, PLATFORM_ADMIN])
@operation(AppListOut, roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def all_apps_in_arkid(request, tenant_id: str, not_arkid: int=None):
'''
所有app列表(含arkid)
Expand Down Expand Up @@ -108,8 +113,21 @@ def get_app(request, tenant_id: str, id: str):
app = App.expand_objects.get(id=id)
return {"data":app}


@api.get("/tenant/{tenant_id}/apps/{id}/read_secret/", response=AppReadSecretOut, tags=['应用'])
@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def get_app_read_secret(request, tenant_id: str, id: str):
'''
获取应用秘钥
'''
from arkid.common.utils import generate_secret
app = App.valid_objects.get(id=id)
app.secret = generate_secret()
app.save()
return {"data": {"read_secret": app.secret}}

@api.get("/tenant/{tenant_id}/apps/{app_id}/openapi_version/", response=ConfigOpenApiVersionDataSchemaOut, tags=['应用'])
@operation(roles=[PLATFORM_ADMIN, NORMAL_USER])
@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def get_app_openapi_version(request, tenant_id: str, app_id: str):
'''
获取app的openapi地址和版本
Expand Down Expand Up @@ -273,7 +291,7 @@ def get_app_config(request, tenant_id: str, id: str):


@api.get("/apps/{id}/sync_permission/", tags=['应用'], auth=None)
@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN, NORMAL_USER])
@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def sync_app_permission(request, id: str):
'''
同步应用权限
Expand Down
Loading