-
Notifications
You must be signed in to change notification settings - Fork 443
Support enclosing the IPv6 address in brackets #627
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
Comments
Just a note, I've managed to get the provider to send the IPv6 without the brackets, but this issue might help someone else. |
Another choice to solve this would be to refactor the from functools import reduce
from operator import add
def verify(self):
if self.address:
# dotted-decimal IPv4 or RFC3513 IPv6 address
if valid_ipv4(self.address) or valid_ipv6(reduce(add, self.address)):
pass
else:
raise ShouldValueError("Not an IPv4 or IPv6 address")
elif self.dns_name:
valid_domain_name(self.dns_name)
return SubjectLocalityType_.verify(self) an example of how this
|
We must normalize the PS: We should also separate the validation of the |
fixed by #653 |
Shibboleth provider sends IPv6 address in brackets, like:
The standard they are using is defined here: https://tools.ietf.org/html/rfc4038#section-5.1
in short:
"The IP address parsers should support enclosing the IPv6 address in brackets, even when the address is not used in conjunction with a port number."
Code Version
Master:
https://github.com/IdentityPython/pysaml2/blob/master/src/saml2/saml.py#L982
Expected Behavior
Check if the address is in brackets, and run the valid_ipv6() function on the item inside the list, then pass.
Current Behavior
raise ShouldValueError("Not an IPv4 or IPv6 address")
Possible Solution
Maybe not the most optimal, but should work.
It would also be possible to extract the item from the list before assigning self.address in the constructor function.
Steps to Reproduce
<saml2:SubjectConfirmationData Address="[2001:8003:5555:9999:555a:5555:c77:d5c5]" InResponseTo="xxx" NotOnOrAfter="2019-07-02T12:12:12.966Z" Recipient="xxx"/>
Send through address with IPv6 in brackets.
The text was updated successfully, but these errors were encountered: