*/saml: fix typo
This commit is contained in:
parent
d1151091cd
commit
464b558a02
|
@ -20,7 +20,7 @@ from passbook.sources.saml.processors.constants import (
|
||||||
NS_SAML_PROTOCOL,
|
NS_SAML_PROTOCOL,
|
||||||
NS_SIGNATURE,
|
NS_SIGNATURE,
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
)
|
)
|
||||||
|
@ -139,7 +139,7 @@ class AssertionProcessor:
|
||||||
if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_EMAIL:
|
if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_EMAIL:
|
||||||
name_id.text = self.http_request.user.email
|
name_id.text = self.http_request.user.email
|
||||||
return name_id
|
return name_id
|
||||||
if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_PRESISTENT:
|
if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_PERSISTENT:
|
||||||
name_id.text = self.http_request.user.username
|
name_id.text = self.http_request.user.username
|
||||||
return name_id
|
return name_id
|
||||||
if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_X509:
|
if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_X509:
|
||||||
|
|
|
@ -15,7 +15,7 @@ from passbook.sources.saml.processors.constants import (
|
||||||
SAML_BINDING_POST,
|
SAML_BINDING_POST,
|
||||||
SAML_BINDING_REDIRECT,
|
SAML_BINDING_REDIRECT,
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
)
|
)
|
||||||
|
@ -51,7 +51,7 @@ class MetadataProcessor:
|
||||||
"""Get compatible NameID Formats"""
|
"""Get compatible NameID Formats"""
|
||||||
formats = [
|
formats = [
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,7 +11,7 @@ from passbook.crypto.models import CertificateKeyPair
|
||||||
from passbook.providers.saml.utils.time import timedelta_string_validator
|
from passbook.providers.saml.utils.time import timedelta_string_validator
|
||||||
from passbook.sources.saml.processors.constants import (
|
from passbook.sources.saml.processors.constants import (
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
SAML_NAME_ID_FORMAT_WINDOWS,
|
SAML_NAME_ID_FORMAT_WINDOWS,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
|
@ -30,7 +30,7 @@ class SAMLNameIDPolicy(models.TextChoices):
|
||||||
"""SAML NameID Policies"""
|
"""SAML NameID Policies"""
|
||||||
|
|
||||||
EMAIL = SAML_NAME_ID_FORMAT_EMAIL
|
EMAIL = SAML_NAME_ID_FORMAT_EMAIL
|
||||||
PERSISTENT = SAML_NAME_ID_FORMAT_PRESISTENT
|
PERSISTENT = SAML_NAME_ID_FORMAT_PERSISTENT
|
||||||
X509 = SAML_NAME_ID_FORMAT_X509
|
X509 = SAML_NAME_ID_FORMAT_X509
|
||||||
WINDOWS = SAML_NAME_ID_FORMAT_WINDOWS
|
WINDOWS = SAML_NAME_ID_FORMAT_WINDOWS
|
||||||
TRANSIENT = SAML_NAME_ID_FORMAT_TRANSIENT
|
TRANSIENT = SAML_NAME_ID_FORMAT_TRANSIENT
|
||||||
|
|
|
@ -12,7 +12,7 @@ NS_MAP = {
|
||||||
}
|
}
|
||||||
|
|
||||||
SAML_NAME_ID_FORMAT_EMAIL = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
|
SAML_NAME_ID_FORMAT_EMAIL = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
|
SAML_NAME_ID_FORMAT_PERSISTENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
|
||||||
SAML_NAME_ID_FORMAT_X509 = "urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName"
|
SAML_NAME_ID_FORMAT_X509 = "urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName"
|
||||||
SAML_NAME_ID_FORMAT_WINDOWS = (
|
SAML_NAME_ID_FORMAT_WINDOWS = (
|
||||||
"urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName"
|
"urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName"
|
||||||
|
|
|
@ -13,7 +13,7 @@ from passbook.sources.saml.processors.constants import (
|
||||||
NS_SIGNATURE,
|
NS_SIGNATURE,
|
||||||
SAML_BINDING_POST,
|
SAML_BINDING_POST,
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
SAML_NAME_ID_FORMAT_WINDOWS,
|
SAML_NAME_ID_FORMAT_WINDOWS,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
|
@ -50,7 +50,7 @@ class MetadataProcessor:
|
||||||
"""Get compatible NameID Formats"""
|
"""Get compatible NameID Formats"""
|
||||||
formats = [
|
formats = [
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
SAML_NAME_ID_FORMAT_WINDOWS,
|
SAML_NAME_ID_FORMAT_WINDOWS,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
|
|
|
@ -24,7 +24,7 @@ from passbook.sources.saml.exceptions import (
|
||||||
from passbook.sources.saml.models import SAMLSource
|
from passbook.sources.saml.models import SAMLSource
|
||||||
from passbook.sources.saml.processors.constants import (
|
from passbook.sources.saml.processors.constants import (
|
||||||
SAML_NAME_ID_FORMAT_EMAIL,
|
SAML_NAME_ID_FORMAT_EMAIL,
|
||||||
SAML_NAME_ID_FORMAT_PRESISTENT,
|
SAML_NAME_ID_FORMAT_PERSISTENT,
|
||||||
SAML_NAME_ID_FORMAT_TRANSIENT,
|
SAML_NAME_ID_FORMAT_TRANSIENT,
|
||||||
SAML_NAME_ID_FORMAT_WINDOWS,
|
SAML_NAME_ID_FORMAT_WINDOWS,
|
||||||
SAML_NAME_ID_FORMAT_X509,
|
SAML_NAME_ID_FORMAT_X509,
|
||||||
|
@ -112,7 +112,7 @@ class ResponseProcessor:
|
||||||
_format = name_id_el.attrib["Format"]
|
_format = name_id_el.attrib["Format"]
|
||||||
if _format == SAML_NAME_ID_FORMAT_EMAIL:
|
if _format == SAML_NAME_ID_FORMAT_EMAIL:
|
||||||
return {"email": name_id}
|
return {"email": name_id}
|
||||||
if _format == SAML_NAME_ID_FORMAT_PRESISTENT:
|
if _format == SAML_NAME_ID_FORMAT_PERSISTENT:
|
||||||
return {"username": name_id}
|
return {"username": name_id}
|
||||||
if _format == SAML_NAME_ID_FORMAT_X509:
|
if _format == SAML_NAME_ID_FORMAT_X509:
|
||||||
# This attribute is statically set by the LDAP source
|
# This attribute is statically set by the LDAP source
|
||||||
|
|
Reference in New Issue