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

feat(ldap): add ldap protocol support #50

Merged
merged 8 commits into from
Jan 7, 2022
Merged

feat(ldap): add ldap protocol support #50

merged 8 commits into from
Jan 7, 2022

Conversation

Li4n0
Copy link
Owner

@Li4n0 Li4n0 commented Jan 5, 2022

Describe the pull request

add ldap protocol support

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have reviewed my own code.
  • All new and existing tests passed.

@Li4n0 Li4n0 requested a review from wuhan005 January 5, 2022 15:18
pkg/ldap/ldap.go Outdated Show resolved Hide resolved
pkg/ldap/ldap.go Show resolved Hide resolved
}

//Delete records
if c.Request.Method == http.MethodDelete {
Copy link
Collaborator

Choose a reason for hiding this comment

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

删除操作为什么要跟 GET 共用一个路由?

}),
}).Create(r).Error
if err != nil {
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

不是很建议这种直接 return 不写明具体变量的写法。

pkg/ldap/rule.go Outdated Show resolved Hide resolved
pkg/ldap/rule.go Outdated Show resolved Hide resolved
@@ -95,6 +98,10 @@ func (revsuit *Revsuit) registerHttpRouter() {
rmiGroup.GET("", rmi.Records)
rmiGroup.DELETE("", rmi.Records)

ldapGroup := recordGroup.Group("/ldap")
ldapGroup.GET("", ldap.Records)
ldapGroup.DELETE("", ldap.Records)
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上,GET 和 DELETE 分开为两个 Handler。

pkg/server/server.go Outdated Show resolved Hide resolved
pkg/server/settings.go Outdated Show resolved Hide resolved
@Li4n0 Li4n0 merged commit fc505b0 into master Jan 7, 2022
@Li4n0 Li4n0 deleted the add-ldap-support branch January 7, 2022 14:47
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.

3 participants