From 464b558a0275ed4f0c75d234716937cea691bc21 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 12 Jul 2020 17:20:41 +0200 Subject: [PATCH] */saml: fix typo --- passbook/providers/saml/processors/assertion.py | 4 ++-- passbook/providers/saml/processors/metadata.py | 4 ++-- passbook/sources/saml/models.py | 4 ++-- passbook/sources/saml/processors/constants.py | 2 +- passbook/sources/saml/processors/metadata.py | 4 ++-- passbook/sources/saml/processors/response.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/passbook/providers/saml/processors/assertion.py b/passbook/providers/saml/processors/assertion.py index 2151da7da..a36aa7d68 100644 --- a/passbook/providers/saml/processors/assertion.py +++ b/passbook/providers/saml/processors/assertion.py @@ -20,7 +20,7 @@ from passbook.sources.saml.processors.constants import ( NS_SAML_PROTOCOL, NS_SIGNATURE, SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT, SAML_NAME_ID_FORMAT_X509, ) @@ -139,7 +139,7 @@ class AssertionProcessor: if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_EMAIL: name_id.text = self.http_request.user.email 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 return name_id if name_id.attrib["Format"] == SAML_NAME_ID_FORMAT_X509: diff --git a/passbook/providers/saml/processors/metadata.py b/passbook/providers/saml/processors/metadata.py index 84a665dde..a7f1a6375 100644 --- a/passbook/providers/saml/processors/metadata.py +++ b/passbook/providers/saml/processors/metadata.py @@ -15,7 +15,7 @@ from passbook.sources.saml.processors.constants import ( SAML_BINDING_POST, SAML_BINDING_REDIRECT, SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT, SAML_NAME_ID_FORMAT_X509, ) @@ -51,7 +51,7 @@ class MetadataProcessor: """Get compatible NameID Formats""" formats = [ SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_X509, SAML_NAME_ID_FORMAT_TRANSIENT, ] diff --git a/passbook/sources/saml/models.py b/passbook/sources/saml/models.py index 4cbdf512f..33e1b3da9 100644 --- a/passbook/sources/saml/models.py +++ b/passbook/sources/saml/models.py @@ -11,7 +11,7 @@ from passbook.crypto.models import CertificateKeyPair from passbook.providers.saml.utils.time import timedelta_string_validator from passbook.sources.saml.processors.constants import ( SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT, SAML_NAME_ID_FORMAT_WINDOWS, SAML_NAME_ID_FORMAT_X509, @@ -30,7 +30,7 @@ class SAMLNameIDPolicy(models.TextChoices): """SAML NameID Policies""" EMAIL = SAML_NAME_ID_FORMAT_EMAIL - PERSISTENT = SAML_NAME_ID_FORMAT_PRESISTENT + PERSISTENT = SAML_NAME_ID_FORMAT_PERSISTENT X509 = SAML_NAME_ID_FORMAT_X509 WINDOWS = SAML_NAME_ID_FORMAT_WINDOWS TRANSIENT = SAML_NAME_ID_FORMAT_TRANSIENT diff --git a/passbook/sources/saml/processors/constants.py b/passbook/sources/saml/processors/constants.py index e301a795f..17eb85889 100644 --- a/passbook/sources/saml/processors/constants.py +++ b/passbook/sources/saml/processors/constants.py @@ -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_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_WINDOWS = ( "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName" diff --git a/passbook/sources/saml/processors/metadata.py b/passbook/sources/saml/processors/metadata.py index 0f2cfa257..299356e90 100644 --- a/passbook/sources/saml/processors/metadata.py +++ b/passbook/sources/saml/processors/metadata.py @@ -13,7 +13,7 @@ from passbook.sources.saml.processors.constants import ( NS_SIGNATURE, SAML_BINDING_POST, SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT, SAML_NAME_ID_FORMAT_WINDOWS, SAML_NAME_ID_FORMAT_X509, @@ -50,7 +50,7 @@ class MetadataProcessor: """Get compatible NameID Formats""" formats = [ SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_X509, SAML_NAME_ID_FORMAT_WINDOWS, SAML_NAME_ID_FORMAT_TRANSIENT, diff --git a/passbook/sources/saml/processors/response.py b/passbook/sources/saml/processors/response.py index afc8c5b44..52aab8aa6 100644 --- a/passbook/sources/saml/processors/response.py +++ b/passbook/sources/saml/processors/response.py @@ -24,7 +24,7 @@ from passbook.sources.saml.exceptions import ( from passbook.sources.saml.models import SAMLSource from passbook.sources.saml.processors.constants import ( SAML_NAME_ID_FORMAT_EMAIL, - SAML_NAME_ID_FORMAT_PRESISTENT, + SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT, SAML_NAME_ID_FORMAT_WINDOWS, SAML_NAME_ID_FORMAT_X509, @@ -112,7 +112,7 @@ class ResponseProcessor: _format = name_id_el.attrib["Format"] if _format == SAML_NAME_ID_FORMAT_EMAIL: return {"email": name_id} - if _format == SAML_NAME_ID_FORMAT_PRESISTENT: + if _format == SAML_NAME_ID_FORMAT_PERSISTENT: return {"username": name_id} if _format == SAML_NAME_ID_FORMAT_X509: # This attribute is statically set by the LDAP source