Skip to content

Fix ldapurl parsing fails when scheme is uppercase #281

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

Closed
wants to merge 1 commit into from
Closed

Fix ldapurl parsing fails when scheme is uppercase #281

wants to merge 1 commit into from

Conversation

dmulder
Copy link
Contributor

@dmulder dmulder commented Apr 26, 2019

Fixes issue mentioned in #280.

@codecov
Copy link

codecov bot commented Apr 26, 2019

Codecov Report

Merging #281 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #281      +/-   ##
==========================================
- Coverage    71.1%   71.06%   -0.05%     
==========================================
  Files          49       49              
  Lines        4818     4818              
  Branches      812      812              
==========================================
- Hits         3426     3424       -2     
- Misses       1056     1058       +2     
  Partials      336      336
Impacted Files Coverage Δ
Lib/ldapurl.py 77.11% <100%> (-1%) ⬇️
Lib/ldap/controls/deref.py 57.14% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update adf9dc4...b3abf27. Read the comment docs.

Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

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

Let's first discuss if we want to change the check. If we move forward, please also provide tests to verify that the change works as expected.

@encukou
Copy link
Member

encukou commented Jan 29, 2020

I'm not opposed to moving forward. But yes, this does need tests.

Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

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

Could you please provide test cases and documentation update for the change set? Thanks!

@dmulder
Copy link
Contributor Author

dmulder commented May 27, 2020

@tiran do you have docs for the python-ldap test suite? I've never written a test for this project before.

@tiran
Copy link
Member

tiran commented May 27, 2020

@tiran do you have docs for the python-ldap test suite? I've never written a test for this project before.

The tests are in Tests/ directory. You can add some upper-case examples to this test class:

class TestIsLDAPUrl(unittest.TestCase):
is_ldap_url_tests = {
# Examples from RFC2255
'ldap:///o=University%20of%20Michigan,c=US':1,
'ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US':1,
'ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,':1,
'ldap://host.com:6666/o=University%20of%20Michigan,':1,
'ldap://ldap.itd.umich.edu/c=GB?objectClass?one':1,
'ldap://ldap.question.com/o=Question%3f,c=US?mail':1,
'ldap://ldap.netscape.com/o=Babsco,c=US??(int=%5c00%5c00%5c00%5c04)':1,
'ldap:///??sub??bindname=cn=Manager%2co=Foo':1,
'ldap:///??sub??!bindname=cn=Manager%2co=Foo':1,
# More examples from various sources
'ldap://ldap.nameflow.net:1389/c%3dDE':1,
'ldap://root.openldap.org/dc=openldap,dc=org':1,
'ldap://root.openldap.org/dc=openldap,dc=org':1,
'ldap://x500.mh.se/o=Mitthogskolan,c=se????1.2.752.58.10.2=T.61':1,
'ldp://root.openldap.org/dc=openldap,dc=org':0,
'ldap://localhost:1389/ou%3DUnstructured%20testing%20tree%2Cdc%3Dstroeder%2Cdc%3Dcom??one':1,
'ldaps://ldap.example.com/c%3dDE':1,
'ldapi:///dc=stroeder,dc=de????x-saslmech=EXTERNAL':1,
}

@tiran
Copy link
Member

tiran commented Jun 6, 2020

I have opened PR #347 for you to get the fix into 3.3.0.

@tiran tiran closed this Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy