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

merge 2309 #1957

Merged
merged 339 commits into from
Nov 2, 2023
Merged

merge 2309 #1957

merged 339 commits into from
Nov 2, 2023

Conversation

LordofAvernus
Copy link
Collaborator

No description provided.

taolx0 and others added 30 commits September 7, 2023 18:40
username in jwt token will be check when http request go throuth middleware
and use username to check if user exist, if using md5 algorithm to resize
username, the middleware cannot find user by token.

@LinXiaoTao
hot-fix: cannot using hash algo in generate token
fix parameter of api definitions
@LordofAvernus LordofAvernus self-assigned this Oct 26, 2023
@LordofAvernus LordofAvernus requested a review from sjjian October 26, 2023 09:30
test: swagger
cd $(PROJECT_NAME) && GOOS=$(GOOS) GOARCH=amd64 go test -v ./...
test:
cd $(PROJECT_NAME) && GOOS=$(GOOS) GOARCH=amd64 go test -v ./... -count 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-count 1 目的是啥

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

禁用测试缓存,避免本地用缓存跑测试

README.md Outdated
@@ -184,6 +184,18 @@ SQLE 提供了多种安装部署的方式,用户可以结合自己的环境和

# 📞 商业支持
如果您想获得 SQLE 的商业支持, 您可以联系我们:
|渠道 | 链接 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme 的内容以v3的为准

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用了最新的v3文档

sqle/api/app.go Outdated
@@ -268,6 +271,18 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config *config.SqleOpti
v1ProjectRouter.POST("/:project_name/audit_plans/:audit_plan_name/sqls/full", v1.FullSyncAuditPlanSQLs, sqleMiddleware.ScannerVerifier())
v1ProjectRouter.POST("/:project_name/audit_plans/:audit_plan_name/sqls/partial", v1.PartialSyncAuditPlanSQLs, sqleMiddleware.ScannerVerifier())

// sql manager
v1ProjectRouter.GET("/projects/:project_name/sql_manages", v1.GetSqlManageList)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1ProjectRouter 里的url不需要再带/projects

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已调整

sqle/api/app.go Outdated
@@ -357,7 +371,7 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config *config.SqleOpti
v1Router.GET("/custom_rules/:db_type/rule_types", v1.GetRuleTypeByDBType)

// task
v1Router.POST("/projects/:project_name/tasks/audits", v1.CreateAndAuditTask)
v1ProjectRouter.POST("/projects/:project_name/tasks/audits", v1.CreateAndAuditTask)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1ProjectRouter 里的url不需要再带/projects

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已调整

if err != nil {
return controller.JSONBaseErrorReq(c, fmt.Errorf("check project manager failed: %v", err))
}
if !up.IsProjectAdmin() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原始的权限是成员即可访问

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理,移除管理员校验

}

data := map[string]interface{}{
"filter_project_name": projectUid,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调整为filter_project_id

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已调整

var sqlAuditRecordQueryBodyTpl = `
{{ define "body" }}
FROM sql_audit_records
LEFT JOIN projects AS p ON sql_audit_records.project_id = p.id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

projects 表已经没有了

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

FROM sql_manages sm
LEFT JOIN sql_audit_records sar ON sm.sql_audit_record_id = sar.id
LEFT JOIN audit_plans ap ON ap.id = sm.audit_plan_id
LEFT JOIN projects p ON p.id = sm.project_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

projects 表没有了

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@sjjian sjjian merged commit a739386 into release-3.2311.x Nov 2, 2023
2 checks passed
@sjjian sjjian deleted the merge-2309 branch November 2, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants