SUSE / Portus

Authorization service and frontend for Docker registry (v2)
http://port.us.org/
Apache License 2.0
3k stars 472 forks source link

With ldap backend can't add a user to team until it authenticates at least once #1295

Open bmillemathias opened 7 years ago

bmillemathias commented 7 years ago

component: portus 2.2 (docker image opensuse/portus:2.2) with ldap backend enabled

When I add a user who never authenticated to a team Portus tells the user doesn't exist, despite the user existing on ldap backend. Once the user has authenticated, whether through the web interface or using docker client it works fine. I assume this is because portus relies on the database instead of checking on the ldap backend.

Portus logs entries (certainly totally irrelevant)

portus-web         | App 138 stdout: Started POST "/team_users" for 172.21.0.1 at 2017-06-09 14:23:14 +0000
portus-web         | App 138 stdout: Processing by TeamUsersController#create as JS
portus-web         | App 138 stdout:   Parameters: {"utf8"=>"✓", "team_user"=>{"team"=>"the A team", "role"=>"viewer", "user"=>"hannibal.smith"}, "commit"=>"Add"}
portus-web         | App 138 stdout:   Rendered team_users/create.js.erb (0.4ms)
portus-web         | App 138 stdout: Completed 422 Unprocessable Entity in 6ms (Views: 1.0ms | ActiveRecord: 0.7ms)

Is there some portusctl command to synchronize the db with the ldap entries ?

stale[bot] commented 6 years ago

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

mssola commented 6 years ago

This could be added as a feature. We can implement this in the portus side (configuration option, or an action on the admin section) , or in the new portusctl.

Sorry for taking so long to respond, it looks like this issue slipped through and went unnoticed :disappointed: