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

How to reject unauthenticated requests #17

Open
bigeagle opened this issue Jun 26, 2016 · 4 comments
Open

How to reject unauthenticated requests #17

bigeagle opened this issue Jun 26, 2016 · 4 comments

Comments

@bigeagle
Copy link

Hi there,

I'm very exicited to see this library.

However, after reading the source code, I found that there's no interfaces to determine whether a connection is set as authenticated state. This results that unathenticated requests can directly bypass the auth phase.

Maybe the client can have a state for authentication, and can be set as sth like authRequired.

Cheers,
Justin

@bigeagle
Copy link
Author

Hi there,

I've tested and verified this. Let's take an example.

Run the example complex server:

cd examples/complex
go run main.go

Run a python script:

#!/usr/bin/env python2.7
import ldap
ld = ldap.initialize("ldap://localhost:10389/")
ld.set_option(ldap.VERSION3, 1)
print(ld.search_s("aaa", ldap.SCOPE_SUBTREE, "cn=*"))

The correct result directly returned. If possible, I can send a PR to implement this.

Cheers,

@vjeantet
Copy link
Owner

Hello @bigeagle PR welcomed !

It could ne implemented as a middleware, like what we have for httpserver ?

@bigeagle bigeagle reopened this Jun 27, 2016
@bigeagle
Copy link
Author

Middleware is good, we can use middleware to implement ACLs.

@kolleroot
Copy link

Are there any updates on this toppic? I realy would like to use this feature.

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

No branches or pull requests

3 participants