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

[MVP]integrate LDAP as external auth service #2

Merged
merged 17 commits into from
May 31, 2023
Merged

Conversation

Makonike
Copy link
Contributor

@Makonike Makonike commented May 28, 2023

see #1 . This MVP version of LDAP integration as an external authentication service does not currently support TLS (Transport Layer Security). Other detailed explanations can be found in the README.md file.

Copy link
Member

@doujiang24 doujiang24 left a comment

Choose a reason for hiding this comment

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

Looks great, please add a CI for it. it could be run the existing test cases in github action, as the first step.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
config.go Outdated Show resolved Hide resolved
config.go Outdated Show resolved Hide resolved
envoy.yaml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
filter.go Outdated Show resolved Hide resolved
filter.go Outdated Show resolved Hide resolved
@Makonike Makonike changed the title [MVP Version]integrate LDAP as external auth service [MVP]integrate LDAP as external auth service May 29, 2023
example/filter.go Outdated Show resolved Hide resolved
Copy link
Member

@doujiang24 doujiang24 left a comment

Choose a reason for hiding this comment

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

seems the github action will only run after this PR merged? Let's finished the smalls comments, and merged it as the first version. Thanks!

@Makonike
Copy link
Contributor Author

seems the github action will only run after this PR merged? Let's finished the smalls comments, and merged it as the first version. Thanks!

It will run in my repository, and you can find it there.

README.md Outdated Show resolved Hide resolved
Copy link
Member

@doujiang24 doujiang24 left a comment

Choose a reason for hiding this comment

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

just a few comments, otherwise, I think it good for the first version.

Copy link
Member

@doujiang24 doujiang24 left a comment

Choose a reason for hiding this comment

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

good enough for the first version, may add more comments, please fix in other PRs.

@doujiang24 doujiang24 merged commit 41c66eb into mosn:main May 31, 2023
Copy link
Member

@doujiang24 doujiang24 left a comment

Choose a reason for hiding this comment

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

please also fix the TODOs, thanks!

go-version: 1.19

- name: build
run: make build
Copy link
Member

Choose a reason for hiding this comment

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

need run tests.

Copy link
Member

Choose a reason for hiding this comment

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

Also, need a better way to test other modes, now we could only test with simple static configuration.
we should test with different configuration modes, eventually, not a very high priority.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix this later.

bind_dn:
bind_password:
# if the filter is set, the filter application will run in search mode.
filter:
Copy link
Member

Choose a reason for hiding this comment

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

better add an example config as demo, in comment could be good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

bind_password:
# if the filter is set, the filter application will run in search mode.
filter:
timeout: 60
Copy link
Member

Choose a reason for hiding this comment

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

add comment: unit is second.

}

func (p *parser) Merge(parent interface{}, child interface{}) interface{} {
panic("TODO")
Copy link
Member

Choose a reason for hiding this comment

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

this TODO need to be addressed.

func dial(config *config) (*ldap.Conn, error) {
return ldap.DialURL(
// TODO: support TLS
fmt.Sprintf("ldap://%s:%d", config.host, config.port),
Copy link
Member

Choose a reason for hiding this comment

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

use fmt for debug log is not a good idea, eventually. please use the HttpLog in filter.callbacks.

func newLdapClient(config *config) (*ldap.Conn, error) {
client, err := dial(config)
if err != nil {
fmt.Println("ldap dial error: ", err)
Copy link
Member

Choose a reason for hiding this comment

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

ditto and somewhere else.

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.

2 participants