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.3 #1163

Merged
merged 43 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
754dd24
docs: ✏️ 更改关于
welylongguikeji Aug 2, 2022
6b98607
docs: ✏️ 关于我们
welylongguikeji Aug 2, 2022
49501e5
docs: ✏️ 开发者指南 改动
welylongguikeji Aug 2, 2022
d41b342
docs: ✏️ 修改部分商业合作指南
welylongguikeji Aug 9, 2022
e5daf11
docs: ✏️ 添加技术咨询与支持
welylongguikeji Aug 9, 2022
f440489
docs: ✏️ 文档修改
welylongguikeji Aug 9, 2022
62702cb
docs: ✏️ 代理商与运营商部分修改
welylongguikeji Aug 9, 2022
f3a0b25
docs: ✏️ 前端文档
longgui-penglei Aug 9, 2022
d2067a1
docs: ✏️ 前端界面
longgui-penglei Aug 9, 2022
242856a
Merge pull request #1147 from longguikeji/feature-567
longgui-penglei Aug 9, 2022
09bff23
feat: 🎸 更新插件文档
guancyxx Aug 9, 2022
89d6351
feat: 🎸 优化文档格式
guancyxx Aug 9, 2022
13088ea
Merge pull request #1148 from longguikeji/feature-594
guancyxx Aug 9, 2022
bc3ce01
fix: 🐛 app config schema
luolu-lg Aug 9, 2022
5de7590
Merge pull request #1149 from longguikeji/feature-fix-app
luolu-lg Aug 9, 2022
aa48961
feat: 🎸 统一权限初版
jinji-hanbin Aug 9, 2022
01656a5
Merge pull request #1150 from longguikeji/feature-402
hanbinloop Aug 9, 2022
933d564
Create mkdocs.yml
notevery Aug 9, 2022
69e4080
feat: 🎸 描述错误
jinji-hanbin Aug 9, 2022
e7a282a
Merge pull request #1155 from longguikeji/feature-402
hanbinloop Aug 9, 2022
ba9e760
feat: 🎸 文档更新
jinji-hanbin Aug 9, 2022
6d43b54
Merge pull request #1156 from longguikeji/feature-402
hanbinloop Aug 9, 2022
6bbb230
feat: 🎸 更新说明
jinji-hanbin Aug 9, 2022
8d45b66
Merge pull request #1157 from longguikeji/feature-402
hanbinloop Aug 9, 2022
c540f9f
docs: ✏️ 更新前端界面说明文档
longgui-penglei Aug 9, 2022
ef3ecb9
Merge pull request #1158 from longguikeji/feature-567
longgui-penglei Aug 9, 2022
8755708
docs: ✏️ 增加统一审批文档,更新审批系统插件和基类文档
fanhe-lg Aug 9, 2022
b616c85
Merge pull request #1159 from longguikeji/feature-613
fanhe-lg Aug 9, 2022
a5e779d
feat: 🎸 add arkstore extension search
luolu-lg Aug 9, 2022
d784200
feat: 🎸 add app search
luolu-lg Aug 9, 2022
11b6282
Merge pull request #1160 from longguikeji/feautre-extension-search
luolu-lg Aug 9, 2022
cd2ae2e
fix: 🐛 重置密码接口权限设置问题,应为无限制
guancyxx Aug 10, 2022
43cea53
fix: 🐛 昵称可为空,更新认证因素时不创建新的认证因素
guancyxx Aug 10, 2022
3bda485
fix: 🐛 去掉mkdocs的流水线
welylongguikeji Aug 10, 2022
91481e5
Merge branch 'v2.5-dev' of https://github.com/longguikeji/arkid into …
welylongguikeji Aug 10, 2022
c2ac170
fix: 🐛 本地存储插件默认配置路径改为/data
guancyxx Aug 10, 2022
e8f9128
feat: 🎸 进一步改写了文档
jinji-hanbin Aug 10, 2022
273274b
Merge branch 'v2.5-dev' of github.com:longguikeji/arkid into v2.5-dev
guancyxx Aug 10, 2022
1b1bad2
feat: 🎸 更新了文档描述
jinji-hanbin Aug 10, 2022
3e8385c
Merge pull request #1161 from longguikeji/feature-402
hanbinloop Aug 10, 2022
6b7da5a
feat: 🎸 更新了actions内容
jinji-hanbin Aug 10, 2022
7303a9b
Merge pull request #1162 from longguikeji/feature-402
hanbinloop Aug 10, 2022
ff70791
Create mkdocs.yml
notevery Aug 10, 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
9 changes: 9 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ls
- run: rm -rf arkid_extensions
- uses: actions/checkout@v3
with:
repository: 'longguikeji/arkid-extensions'
ref: 'v2.5-dev'
path: 'arkid_extensions'
token: '${{ secrets.NOTEVERY_TOKEN }}'
- run: ls arkid_extensions
- uses: actions/setup-python@v2
with:
python-version: 3.8
Expand Down
4 changes: 2 additions & 2 deletions api/v1/schema/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class ConfigOpenApiVersionDataSchemaOut(ResponseSchema):

AppProtocolConfigIn = AppProtocolExtension.create_composite_config_schema(
'AppProtocolConfigIn',
exclude=["name", "type", "logo", "url", 'description', 'entry_permission'],
exclude=["name", "type", "logo", "url", 'description', 'entry_permission', 'arkstore_app_id'],
)

AppProtocolConfigItemOut = AppProtocolExtension.create_composite_config_schema(
'AppProtocolConfigItemOut',
id=(UUID, Field(hidden=True)),
exclude=["name", "type", "logo", "url", 'description', 'entry_permission'],
exclude=["name", "type", "logo", "url", 'description', 'entry_permission', 'arkstore_app_id'],
)


Expand Down
44 changes: 36 additions & 8 deletions api/v1/views/arkstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from arkid.core.api import api, operation
from datetime import datetime
from typing import List, Optional
from ninja import Schema
from ninja import Schema, Query
import enum
from pydantic import Field
from ninja.pagination import paginate
Expand All @@ -45,7 +45,7 @@



def get_arkstore_list(request, purchased, type, rented=False, all=False):
def get_arkstore_list(request, purchased, type, rented=False, all=False, extra_params={}):
page = request.GET.get('page', 1)
page_size = request.GET.get('page_size', 10)
token = request.user.auth_token
Expand All @@ -58,7 +58,7 @@ def get_arkstore_list(request, purchased, type, rented=False, all=False):
if all:
limit = 1000000
offset = 0
saas_extensions_data = get_arkstore_extensions(access_token, purchased, rented, type, offset, limit)
saas_extensions_data = get_arkstore_extensions(access_token, purchased, rented, type, offset, limit, extra_params)
saas_extensions_data = saas_extensions_data['items']
return saas_extensions_data

Expand Down Expand Up @@ -200,18 +200,46 @@ class PaymentStatus(Schema):
amount: Amount


class ArkstoreExtensionQueryIn(Schema):
name__contains:str = Field(
default="",
title=_("插件名")
)
package__contains:str = Field(
default="",
title=_("插件包名")
)
labels__contains:str = Field(
default="",
title=_("插件标签")
)


class ArkstoreAppQueryIn(Schema):
name__contains:str = Field(
default="",
title=_("应用名")
)
labels__contains:str = Field(
default="",
title=_("应用标签")
)


@api.get("/tenant/{tenant_id}/arkstore/extensions/", tags=['方舟商店'], response=List[OnShelveExtensionPurchaseOut])
@operation(List[ArkstoreItemSchemaOut], roles=[TENANT_ADMIN, PLATFORM_ADMIN])
@paginate(CustomPagination)
def list_arkstore_extensions(request, tenant_id: str):
return get_arkstore_list(request, None, 'extension')
def list_arkstore_extensions(request, tenant_id: str, query_data: ArkstoreExtensionQueryIn=Query(...)):
query_data = query_data.dict()
return get_arkstore_list(request, None, 'extension', extra_params=query_data)


@api.get("/tenant/{tenant_id}/arkstore/apps/", tags=['方舟商店'], response=List[ArkstoreItemSchemaOut])
@operation(List[ArkstoreItemSchemaOut], roles=[TENANT_ADMIN, PLATFORM_ADMIN])
@paginate(CustomPagination)
def list_arkstore_apps(request, tenant_id: str):
return get_arkstore_list(request, None, 'app')
def list_arkstore_apps(request, tenant_id: str, query_data: ArkstoreAppQueryIn=Query(...)):
query_data = query_data.dict()
return get_arkstore_list(request, None, 'app', extra_params=query_data)


@api.get("/tenant/{tenant_id}/arkstore/purchased/extensions/", tags=['方舟商店'], response=List[OnShelveExtensionPurchaseOut])
Expand All @@ -226,7 +254,7 @@ def list_arkstore_purchased_extensions(request, tenant_id: str):
@paginate(CustomPagination)
def list_arkstore_purchased_apps(request, tenant_id: str):
arkstore_apps = get_arkstore_list(request, None, 'app', all=True)
installed_apps = App.objects.filter(tenant_id=tenant_id, arkstore_app_id__isnull=False)
installed_apps = App.active_objects.filter(tenant_id=tenant_id, arkstore_app_id__isnull=False)
installed_app_ids = set(str(app.arkstore_app_id) for app in installed_apps)
return [app for app in arkstore_apps if app['uuid'] in installed_app_ids]

Expand Down
2 changes: 1 addition & 1 deletion api/v1/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def auth(request, tenant_id: str, event_tag: str, data: AuthIn):

return {'error': ErrorCode.OK.value, 'data': {'user': user, 'token': token}}

@api.post("/tenant/{tenant_id}/reset_password/", response=ResetPasswordOut, tags=['登录与注册'])
@api.post("/tenant/{tenant_id}/reset_password/", response=ResetPasswordOut, tags=['登录与注册'],auth=None)
@operation(ResetPasswordOut, use_id=True)
def reset_passowrd(request, tenant_id: str, event_tag: str, data: ResetPasswordIn):
tenant = request.tenant
Expand Down
2 changes: 2 additions & 0 deletions api/v1/views/auth_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def update_auth_factor(request, tenant_id: str, id: str, data: AuthFactorUpdateI
config = TenantExtensionConfig.active_objects.get(
tenant__id=tenant_id, id=id)
for attr, value in data.dict().items():
if attr == "id":
continue
setattr(config, attr, value)
config.save()
return ErrorDict(ErrorCode.OK)
Expand Down
3 changes: 2 additions & 1 deletion arkid/common/arkstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_arkstore_access_token_with_saas_token(saas_tenant_slug, saas_tenant_id,
return arkstore_access_token_saas_cache[key]


def get_arkstore_extensions(access_token, purchased=None, rented=False, type=None, offset=0, limit=10):
def get_arkstore_extensions(access_token, purchased=None, rented=False, type=None, offset=0, limit=10, extra_params={}):
if type == 'extension':
if rented:
url = "/api/v1/arkstore/extensions/leased"
Expand All @@ -111,6 +111,7 @@ def get_arkstore_extensions(access_token, purchased=None, rented=False, type=Non
params['purchased'] = 'false'
if rented is True:
params['leased'] = 'true'
params.update(extra_params)
resp = requests.get(arkstore_extensions_url, params=params, headers=headers)
if resp.status_code != 200:
raise Exception(f'Error get_arkstore_apps_and_extensions: {url}, {resp.status_code}')
Expand Down
6 changes: 6 additions & 0 deletions arkid/core/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class FrontActionType(Enum):
CANCEL_ACTION = 'cancel'
RESET_ACTION = 'reset'
IMPORT_ACTION = 'import'
EXPORT_ACTION = 'export'
URL_ACTION = 'url'
PASSWORD_ACTION = 'password'
CASCADE_ACTION = 'cascade'
Expand Down Expand Up @@ -142,6 +143,11 @@ def __init__(self, *args, **kwargs):
super().__init__(action_type=FrontActionType.IMPORT_ACTION, *args, **kwargs)


class ExportAction(FrontAction):
def __init__(self, *args, **kwargs):
super().__init__(action_type=FrontActionType.EXPORT_ACTION, *args, **kwargs)


class URLAction(FrontAction):
def __init__(self, *args, **kwargs):
super().__init__(action_type=FrontActionType.URL_ACTION, *args, **kwargs)
Expand Down
24 changes: 12 additions & 12 deletions arkid/core/extension/approve_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ def create_approve_request(self, event, **kwargs):

@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def pass_approve_request_handler(self, request, request_id):
"""
抽象方法
Args:
request (django.http.HttpRequest): 创建审批请求事件
approve_request_id (str): 需要改变审批状态的审批请求ID
"""
approve_request = ApproveRequest.valid_objects.get(id=request_id)
self.pass_approve_request(request, approve_request)
approve_request.status = 'pass'
Expand All @@ -87,16 +81,16 @@ def pass_approve_request_handler(self, request, request_id):

@abstractmethod
def pass_approve_request(self, request, approve_request):
pass

@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def deny_approve_request_handler(self, request, request_id):
"""
抽象方法
Args:
request (django.http.HttpRequest): 创建审批请求事件
approve_request_id (str): 需要改变审批状态的审批请求ID
request (django.http.HttpRequest): HTTP 请求
approve_request (arkid.core.models.ApproveRequest): 需要同意的审批请求
"""
pass

@operation(roles=[TENANT_ADMIN, PLATFORM_ADMIN])
def deny_approve_request_handler(self, request, request_id):
approve_request = ApproveRequest.valid_objects.get(id=request_id)
self.deny_approve_request(request, approve_request)
approve_request.status = 'deny'
Expand All @@ -105,6 +99,12 @@ def deny_approve_request_handler(self, request, request_id):

@abstractmethod
def deny_approve_request(self, request, approve_request):
"""
抽象方法
Args:
request (django.http.HttpRequest): HTTP 请求
approve_request (arkid.core.models.ApproveRequest): 需要拒绝的审批请求
"""
pass

def create_tenant_config(self, tenant, config, name, type):
Expand Down
16 changes: 8 additions & 8 deletions arkid/core/perm/permission_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,16 +2105,16 @@ def id_token_to_permission_str(self, request, is_64=False):
user_id = payload.get('sub_id', '')
tenant_id = payload.get('tenant_id', '')

apps = App.valid_objects.filter(
type__in=['OIDC-Platform'],
)
apps = App.valid_objects.all()
app_temp = None
for app in apps:
data = app.config.config
app_client_id = data.get('client_id', '')
if app_client_id == client_id:
app_temp = app
break
app_config = app.config
if app_config:
data = app_config.config
app_client_id = data.get('client_id', '')
if app_client_id == client_id:
app_temp = app
break
user = User.valid_objects.filter(id=user_id).first()
if user and app_temp and tenant_id:
return self.get_permission_str(user, tenant_id, app_temp.id, is_64)
Expand Down
26 changes: 25 additions & 1 deletion docs/ 商业合作指南/ 开发商.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,30 @@
5. 提交审核
6. 通过即上架完成,所有ArkID的用户在其应用商店中都能看到该应用了。

#### 自定义认证协议

如果你的应用使用的是其它非标准协议,请联系我们。

#### 账密代填

如果你的应用暂时无法通过OIDC接入,我们还推荐使用
如果你的应用暂时无法通过OIDC接入,我们还推荐使用账密代填的方式。

账密代填并非单点登录的协议,只是会在浏览器中记录对应站点的账号密码,并自动填入并点击登录。

如果该网站使用了如验证码等额外的方式,则不适用账密代填。

#### 推广链接

如果当前应用不支持上述各类情况,你可以仅仅上传一个ArkID的专属推广链接,并记录下该用户后续的注册,登录,付费等行为,用来作为与ArkID分账的依据。

通常这种情况,支付会使用内付费的形式,你需要联系我们。

## 价格规则

### 商店支付

插件只能选择商店支付的方式,应用可以是商店支付或者应用内支付的方式。

无论是插件还是应用,开发商都可以设置价格。

价格分两类:**购买价格** 与 **租赁价格**,两种价格的组成是相同的。
Expand All @@ -66,6 +84,12 @@

价格可以设置多条,以满足不同的定价策略。

### 应用内支付

你的应用可以不通过商店支付,而是用户自行在你的应用内支付页面完成支付。

这种情况,需要你跟龙归签署相关合作协议,并商定好分成比例,定期与龙归结算即可。

## 订单记录

在ArkStore中,点击 费用中心-开发商订单 即可查看
Expand Down
25 changes: 23 additions & 2 deletions docs/ 商业合作指南/ 代理商.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 拥有ArkID账号
* 访问ArkStore

## 代理规则
## 插件代理规则

1. 访问ArkStore
2. 点击 代理商-代理商详情,在这里你可以看到当前代理商的所有信息
Expand Down Expand Up @@ -85,7 +85,7 @@ ArkStore平台提成 = 最小值(开发商市场指导价 * 0.1 , 开发商

由代理商自由设置 0-1 之间的小数。

## 计算规则如下
### 计算规则如下

* 代理商拿货价格

Expand All @@ -103,6 +103,27 @@ ArkStore平台提成 = 最小值(开发商市场指导价 * 0.1 , 开发商

```代理商利润 = 产品最终销售价格 - 代理商拿货价格```


## 应用代理规则

应用代理规则 相比 插件 要复杂一些。因为应用接入标准不同,各个应用开发商要求的分成比例,账期都不同。每个应用都需要具体看其具体的代理规则。

大致分为这几类:

1. OIDC 与 商店支付

应用使用OIDC协议与ArkID对接并接入了商店支付标准,其代理规则则与插件一致。

2. 应用内支付

应用虽然使用**OIDC协议**或**自定义协议**接入ArkID,但使用了应用内支付,也就意味着该应用为免费应用。分成比例就以开发商设置为准。

3. 推广链接 与 应用内支付

如果应用仅仅使用推广链接,ArkID无法获取应用内身份与ArkID身份的映射关系,无法按照实际使用情况与代理商分成。

推广链接采用记录点击量并计算点击占比,通过该点击占比进行分成。

## 订单与提现

在ArkStore的费用中心中即可查看代理商订单或发起提现申请。
Expand Down
8 changes: 7 additions & 1 deletion docs/ 商业合作指南/ 运营商.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

## 运营规则

租户付费使用运营商的ArkID服务。ArkID的插件或应用都支持租赁。也就是租户都需要租赁才能使用这些插件或应用。
### 插件租赁

租户付费使用运营商的ArkID服务。ArkID的插件支持租赁。也就是租户都需要租赁才能使用这些插件。

运营商被视为代理商的一种,相关设置与代理商完全一致。

Expand All @@ -34,6 +36,10 @@

```运营商等级折扣规则,参见```[代理商等级折扣规则](../%20代理商/#_4)

### 应用购买

运营商会被视为其租户的代理商,即租户购买应用,运营商也会获得相应的分成。

## 运营费用

除了运营商需要从插件或应用商店中直接购买插件或应用外,龙归原则上不会对运营商有任何额外的收费,也不排除运营商需要额外的托管,运维,开发服务,这部分可以发送邮件至[bd@longguikeji.com](mailto:bd@longguikeji.com),将您的需求告知,我们会与您联系。
Expand Down
35 changes: 35 additions & 0 deletions docs/ 商业合作指南/技术咨询与支持.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## 支持范围
为在开发阶段和生产环境中使用 ArKID 的公司提供原厂商业支持。

## 服务内容
服务支持包括架构审查、代码审查、故障排除、诊断、建议、升级和安全补丁,以确保 ArKID的正常运行。

如果您已经修改了ArKID的核心,或者有自定义插件,建议购买高级版本,以便我们了解这些更改并更快地定位和解决故障。

| | 标准版 | 高级版 |
|----|-----|-----|
| 推荐模式 | 关键业务| 关键业务 紧密沟通 |
| 运维部署 | ✓ | ✓ |
| 故障排查 | - | ✓|
| 安全补丁 | ✓ | ✓|
| 版本更新 | - | ✓|
| 性能调优 | - | ✓|
| 技术咨询&答疑 | ✓ | ✓|
| 架构评审 | ✓ | ✓|
| 代码 review | ✓ | ✓|
| 支持方式 | Email\微信 | Email\微信\Phone |
| 支持时间 | 工作时间(5x8h) | 7X 24h|
| 响应时间 SLA | 8 小时 | 高:30 分钟;中:1 小时;低:24 小时 |
| 技术支持联系人 | 1 | 2|
| 技术支持经理 | - | ✓|
| 巡检 | - | ✓|
| 赠送额外的开发支持时间 | - | 5人/天|

## 收费
根据不同服务等级,按照年度订阅收费。超出套餐内开发支持时长,需额外支付费用。

标准版: 12 万/年

高级版: 36 万/年

开发支持: 5000 人/天
Loading