question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handling additional unresolved-reference search results

See original GitHub issue

I know this is really asking for the package to deal with a problem that arguably lies elsewhere, but I’m asking for it anyway. If it is agreed that this is a feature and not a misfeature, then I am definitely interested in writing an implementation.

Our application is failing to authenticate users in their AD even though other applications are having no such problem. After quite a lot of debugging, we finally figured out that our search was returning multiple results. It is returning 1 normal result and several unresolved reference results (AD part is None and data part is an array containing an LDAP URL string).

Neither we nor the customer knows why that is happening, but since ours is the only app having a problem with it, the perception is that it’s our fault.

I have worked around the problem by copying the django-auth-ldap code into our project and patching backend._LDAPUser._search_for_user_dn to optionally (depending on a new setting value) iterate over the results and keep only those that have DN values.

Is this something that we can add to the official package?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
francoisfreitagcommented, Jan 25, 2022

Thanks for the ping. I’m closing it until we have an actual use case. It will be easier to find a satisfactory interface and add tests when we know what we are trying to accomplish.

1reaction
francoisfreitagcommented, Jan 13, 2022

The reasoning is clear. This issue requires more thinking than #285 and I am only getting to it now.

I wonder if the search terms could be more precise, in order to exclude the unwanted results and keep a single result? I’m wary of implementing a behavior that skips some search results, although I’m failing to see how an empty DN could be useful to authenticate a user.

As an aside, my preference would be to raise an exception when there are multiple results (probably an AuthenticationFailed), interrupting the authentication and explaining why the authentication failed. The current behavior of returning None makes debugging needlessly harder. However, there’s backward compatibility to think about… It probably needs a deprecation period and major version bump. I may give that a shot in the next weeks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unresolved reference issue in PyCharm - Stack Overflow
Chose the directory/project where your file that has unresolved imports resides and check the box to tell Pycharm that that project depends on...
Read more >
Managing unresolved references - No Magic Documentation
You can manage the unresolved references in the Model Browser or in the Active Validation Results panel. In the Active Validation Results panel ......
Read more >
Resolve references | PyCharm Documentation - JetBrains
PyCharm's on-the-fly inspection immediately detects unresolved references, and highlights them with the red curvy line. PyCharm suggests quick fixes to deal ...
Read more >
How to fix unresolved and unloaded references - IBM
Perform a search: click Edit > Search > Advanced. Select the Only unresolved/unloaded radio button. Then, click the Find button. You see a...
Read more >
Handle Unresolved References | Asciidoctor Docs
drop the line on which the reference occurs (matches behavior of AsciiDoc.py). warn. print a warning about the missing attribute. The setting you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found