Skip to content

add LDAP specific API call to resolve an LDAP (login) name to an ownC… - #19600

Closed
blizzz wants to merge 3 commits into
masterfrom
fix-15084
Closed

blizzz wants to merge 3 commits into
masterfrom
fix-15084

Conversation

@blizzz

@blizzz blizzz commented Oct 6, 2015

Copy link
Copy Markdown
Contributor

…loud username that can be used with user related API calls

Fixes #15084

This introduces the cloud/apps/user_ldap/resolveloginname/{loginname} route to the Provisioning API as suggested in #15084 (comment).

Following output is created on those cases:

# unknown user
$ curl http://master:[email protected]/master/ocs/v1.php/cloud/apps/user_ldap/resolveloginname/foobar
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>998</statuscode>
  <message>Could not resolve login name to user name</message>
 </meta>
 <data/>
</ocs>

# success
$ curl http://master:[email protected]/master/ocs/v1.php/cloud/apps/user_ldap/resolveloginname/alice
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
 </meta>
 <data>
  <element>dc35a74a-5de6-1932-93af-e3cc75610c15</element>
 </data>
</ocs>

# LDAP enabled, but no active configurations
$ curl http://master:[email protected]/master/ocs/v1.php/cloud/apps/user_ldap/resolveloginname/alice
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>996</statuscode>
  <message>No active LDAP configuration</message>
 </meta>
 <data/>
</ocs>

# LDAP not enabled
$ curl http://master:[email protected]/master/ocs/v1.php/cloud/apps/user_ldap/resolveloginname/alice
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>996</statuscode>
  <message>LDAP backend is not enabled</message>
 </meta>
 <data/>
</ocs>

Please test and review @tomneedham @rullzer @MorrisJobke

…loud username that can be used with user related API calls
@karlitschek

Copy link
Copy Markdown
Contributor

makes sense 👍

Comment thread apps/provisioning_api/lib/apps.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👎 we should not reuse ldap classes in the provisioning app

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please move this code to the ldap app - no need to keep it in the provisioing app - THX

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@DeepDiver1975 now, is this more what you were looking for? Or do you prefer to keep it totally out of the Provisioning API? Having it there is what was agreed on, but I can put it anywhere of course.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inter app dependency? Just create your own OCS endpoint?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This sounds like it will break when the ldap backend is not installed

@nickvergessen

Copy link
Copy Markdown
Contributor

I think it would be also okay to have this in general (placed in the user manager)
Because for the database backend it would also be good to have an endpoint to get the correct casing of a user id, ref #19580

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@DeepDiver1975 now, is this more what you were looking for? Or do you prefer to keep it totally out of the Provisioning API? Having it there is what was agreed on, but I can put it anywhere of course.

Having this OCS api in the scope of provisioning API is give by the URL of the http call.
The code itself to be located in ldap otherwise we totally violate our principals.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Having a look at this and other places this all looks like workaround over workaround.

I'd vote for postponing this until 9.0 and see if there is anything we can do in a more general and centric approach

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@karlitschek @cmonteroluque @MTRichards we might want to setup a story around user mgmt - there are some issue piling up which needs to be adresses.

@MTRichards

Copy link
Copy Markdown
Contributor

Ok. Can you say more - What else is missing / needs work?

@MorrisJobke

Copy link
Copy Markdown
Contributor

I'd vote for postponing this until 9.0 and see if there is anything we can do in a more general and centric approach

cc @karlitschek @cmonteroluque

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Ok. Can you say more - What else is missing / needs work?

  • uppercase/lowercase user name issues all over the place
  • have ONE centric user accounts table to rule them all
  • reliable calculation of users, data dirs regardless of auth backends being available/online or not
  • reliable enumeration of users (e.g. run occ commands for all users - it's a mess today)

@MorrisJobke

Copy link
Copy Markdown
Contributor

reliable enumeration of users (e.g. run occ commands for all users - it's a mess today)

Additional: Having a properly sorted list of users. Currently the ldap users are sorted in the JS part, because LDAP doesn't support this kind of sorting.

@ghost

ghost commented Oct 9, 2015

Copy link
Copy Markdown

@DeepDiver1975 and @MorrisJobke I am worried setting up this story will end up with it in 9.1 and that seems to far forward (I don't see a good path for a faster timeline). At this point I'd prefer a good workaround AND a story for the future.

@karlitschek @MTRichards your thoughts?

@karlitschek

Copy link
Copy Markdown
Contributor

Hmm. What is the severity here? Anyone waiting for this fix? @blizzz How big is the risk if we put this into 8.2?

@blizzz

blizzz commented Oct 12, 2015

Copy link
Copy Markdown
Contributor Author

@karlitschek there's nothing agreed on that we can mere. I could move this part to the LDAP backend solely (then we have an API call and could not throw it away for awhile…), now it was suggested to put it on hold #19600 (comment)

@ghost

ghost commented Oct 12, 2015

Copy link
Copy Markdown

ok, this has to be addressed in 9.0 @MTRichards @karlitschek

@ghost ghost modified the milestones: 9.0-next, 8.2-current Oct 12, 2015
@MTRichards

Copy link
Copy Markdown
Contributor

Ok.

@PVince81

Copy link
Copy Markdown
Contributor

ok, this has to be addressed in 9.0

The scope needs to be cleared out.
Are we talking about @blizzz's workaround of adding an API or about the non-trivial topics from @DeepDiver1975 here #19600 (comment) ?

@PVince81

Copy link
Copy Markdown
Contributor

Raised #21282 to discuss the "central user lookup table" approach.

@PVince81

Copy link
Copy Markdown
Contributor

I vote for deferring this to 9.1.

@ghost ghost modified the milestones: 9.1-next, 9.0-current Feb 24, 2016
@MorrisJobke

Copy link
Copy Markdown
Contributor

🌆 it!

@blizzz

blizzz commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

not needed

@blizzz blizzz closed this Mar 31, 2016
@blizzz
blizzz deleted the fix-15084 branch March 31, 2016 18:15
@lock

lock Bot commented Aug 6, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meta data missing the username when querying for an ldap user via the provisioning api

8 participants