-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
GH-2054 Cover #2054 with test case #2055
Conversation
} | ||
|
||
@Test | ||
fun `should authenticate mykola`() { |
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.
@dzikoysk Please correct me if I'm wrong but understand this test like only "mykola" is allowed to login. But as I described it in the ticket, only "readonly" should be allowed to connect LDAP and all other should be blocked. This is how BindDN works.
Here is more details how it works, hope this can help to understand
https://github.com/osixia/docker-openldap#defaultstartupyaml
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.
Okay, so that's not how I understood the issue. From the logs you've provided I thought you can successfully login with readonly (conn=1021), but you cannot do this with mykola (conn=1022). Could you specify your LDAP server config that I can use in this test to go through your issue? I feel like it can be done in multiple ways and I'm currently trying to guess what setup you actually have 🤔
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.
Only three users are allowed:
- admin - administration tasks (add/remove).
- config - Ldap configuration.
- readonly - used by external services to bind to the server.
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.
Okay, so that's not how I understood the issue. From the logs you've provided I thought you can successfully login with readonly (conn=1021), but you cannot do this with mykola (conn=1022).
Yes, you understand it correct. User "mykola" shouldn't have expected to LDAP server. Access is granted only for user specified in Reposilite configuration and none other.
So this is your configuration:
Let's go through this:
Having that in mind, I've updated our test:
|
Yes that's correct now. This code which you have now (v 3.5.6) is suitable for the case when each user connect server separately. But on user interface there is way to setup BindDN connection (only one user have to do all work). Here is good screenshots for Gitea to understand what I'm talking about. |
Okay, I think I got what you assume the bug is here. You're trying to reuse If that's correct, then you should modify your Also, if you'll confirm this is valid, I see that we could improve our integration - especially considering changes that are coming in 4.x: |
Yes, this is what page design is propose to do (at least how I understood that with my previous experience with Gitea page design of integration with LDAP). |
But, user which connect to server again to fetch the name should remains the first one, but not this one the name of which you want to receive.
|
So now, |
@dzikoysk |
Like I said before, this is the limitation of our current implementation in 3.x - password is required to create a new secret associated with generated access token. What you're asking for is a passwordless logging form for users working in the internal network - we don't have a concept of users nor the token management panel in the UI. This kind of work is scheduled for 4.x: On the other hand, if we'd keep username + password in the logging form & we'd not validate the user's credentials, we'd silently create a new token on the first logging attempt. It's a bit dirty, since it's not covered at any point by current UI. What we did in the past for this kind of edge cases, is an internal flag. I could disable user's authentication behind a feature flag, like e.g. |
Yes, looks like acceptable solution at this moment. |
Tested and works fine. Thank you. |
No description provided.