-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: API支持 #206
feat: API支持 #206
Conversation
resource/l10n/en-US.toml
Outdated
@@ -469,6 +469,21 @@ other = "Services" | |||
[ScheduledTasks] | |||
other = "Scheduled Tasks" | |||
|
|||
[ApiManagement] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en 和 es 需要恢复,在仓库直接改会让 crowdin 混乱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最新的commit是在en和es里直接删掉了这几个设置
不太确定是不是要这样做
现在conf设置成en-US会panic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没事,crowdin 会自己补缺失的 key,先不发版,提交了翻译完再发
其他没了 👍🏿 |
工作完成
安全性相关
额外为Auth中间件增加AllowAPI选项(默认false)
目前仅/api/v1/目录下的路径支持API认证(获取服务器列表与详情)
防止API Token泄漏后调用计划任务相关接口进行恶意攻击
后续可以尝试通过增加scope字段对Token权限进行约束
接口参考
API接口(允许使用API Token认证与Cookies认证)
Token认证方式:
获取服务器列表:
GET /api/v1/server/list?tag=
query: tag (ServerTag 提供此参数则仅查询该分组下的服务器)
获取服务器详情:
GET /api/v1/server/details?id=&tag=
query: id (ServerID 以逗号分隔 提供此参数则查询该列表对应的服务器 同时无视tag参数)
query: tag (ServerTag 提供此参数则仅查询该分组下的服务器)