diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..3b2e86e6 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +ignore = E731,W503,W504,E501 +max-complexity = 50 +max-line-length = 200 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..ac0a9f6c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [SAML-Toolkits] diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 00000000..c17b3107 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,100 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test_py3: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + pip install -U setuptools + sudo apt-get update -qq + sudo apt-get install -qq swig libxml2-dev libxmlsec1-dev + make install-req + make install-test + - name: Test + run: make pytest + lint: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + pip install -U setuptools + sudo apt-get update -qq + sudo apt-get install -qq swig libxml2-dev libxmlsec1-dev + make install-req + make install-lint + - name: Run linters + run: | + make flake8 + make black + coveralls: + if: ${{ github.secret_source == 'Actions' }} + runs-on: ubuntu-22.04 + environment: CI + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + pip install -U setuptools + sudo apt-get update -qq + sudo apt-get install -qq swig libxml2-dev libxmlsec1-dev + make install-req + make install-test + - name: Run coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + pip install coveralls + make coverage + make coveralls diff --git a/.gitignore b/.gitignore index c16b943e..7504184a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ __pycache_ /*.eg *.egg-info /eggs +/.eggs /build /dist /venv @@ -21,6 +22,8 @@ __pycache_ .pypirc /.idea .mypy_cache/ +.pytest_cache +poetry.lock *.key *.crt diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3ddd4236..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -python: - - '2.7' - - '3.5' - - '3.6' - -matrix: - include: - - python: '3.7' - dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069) - -install: - - sudo apt-get update -qq - - sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev - - 'travis_retry pip install .' - - 'travis_retry pip install -e ".[test]"' - -script: - - 'coverage run --source=src/onelogin/saml2 --rcfile=tests/coverage.rc setup.py test' - - 'coverage report -m --rcfile=tests/coverage.rc' -# - 'pylint src/onelogin/saml2 --rcfile=tests/pylint.rc' - - 'flake8 .' - -after_success: 'coveralls' diff --git a/LICENSE b/LICENSE index 1c8f814e..c141165e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2010-2018 OneLogin, Inc. +Copyright (c) 2010-2022 OneLogin, Inc. +Copyright (c) 2023 IAM Digital Services, SL. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 9b0be815..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include README.md -include LICENSE -recursive-include src *.py -recursive-include src *.xsd -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..31efe284 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +PIP=pip +BLACK=black +FLAKE8=flake8 +PYTEST=pytest +COVERAGE=coverage +COVERAGE_CONFIG=tests/coverage.rc +COVERALLS=coveralls +MAIN_SOURCE=src/onelogin/saml2 +DEMOS=demo-django demo-flask demo-tornado demo_pyramid +TESTS=tests/src/OneLogin/saml2_tests +SOURCES=$(MAIN_SOURCE) $(DEMOS) $(TESTS) + +install-req: + $(PIP) install . + +install-test: + $(PIP) install -e ".[test]" + +install-lint: + $(PIP) install -e ".[lint]" + +pytest: + $(PYTEST) + +coverage: + $(COVERAGE) run -m $(PYTEST) + $(COVERAGE) report -m + +coveralls: + $(COVERALLS) + +black: + $(BLACK) $(SOURCES) + +flake8: + $(FLAKE8) $(SOURCES) + +clean: + rm -rf .pytest_cache/ + rm -rf .eggs/ + find . -type d -name "__pycache__" -exec rm -r {} + + find . -type d -name "*.egg-info" -exec rm -r {} + + rm .coverage diff --git a/README.md b/README.md index e652786e..ff71357f 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ -# OneLogin's SAML Python Toolkit (compatible with Python3) +# SAML Python3 Toolkit -[![Build Status](https://api.travis-ci.org/onelogin/python3-saml.png?branch=master)](http://travis-ci.org/onelogin/python3-saml) -[![Coverage Status](https://coveralls.io/repos/github/onelogin/python3-saml/badge.svg?branch=master)](https://coveralls.io/github/onelogin/python3-saml?branch=master) +[![Python package](https://github.com/SAML-Toolkits/python3-saml/actions/workflows/python-package.yml/badge.svg)](https://github.com/SAML-Toolkits/python3-saml/actions/workflows/python-package.yml) +![PyPI Downloads](https://img.shields.io/pypi/dm/python3-saml.svg?label=PyPI%20Downloads) +[![Coverage Status](https://coveralls.io/repos/github/SAML-Toolkits/python3-saml/badge.svg?branch=master)](https://coveralls.io/github/SAML-Toolkits/python3-saml?branch=master) [![PyPi Version](https://img.shields.io/pypi/v/python3-saml.svg)](https://pypi.python.org/pypi/python3-saml) -![Python versions](https://img.shields.io/pypi/pyversions/python3-saml.svg) - +![Python versions](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FSAML-Toolkits%2Fpython3-saml%2Fmaster%2Fpyproject.toml) Add SAML support to your Python software using this library. -Forget those complicated libraries and use the open source library provided -and supported by OneLogin Inc. +Forget those complicated libraries and use the open source library provided by the SAML tool community. -This version supports Python3. There is a separate version that only support Python2: [python-saml](https://github.com/onelogin/python-saml) +This version supports Python3. Python 2 support was deprecated on Jan 1st, 2020: [python-saml](https://github.com/onelogin/python-saml) #### Warning #### +Version 1.16.X is the latest version supporting Python2, consider its use deprecated. 1.17 won't be Python2 and old Python3 compatible. + +Version 1.13.0 sets sha256 and rsa-sha256 as default algorithms + +Version 1.8.0 sets strict mode active by default + Update ``python3-saml`` to ``1.5.0``, this version includes security improvements for preventing XEE and Xpath Injections. Update ``python3-saml`` to ``1.4.0``, this version includes a fix for the [CVE-2017-11427](https://www.cvedetails.com/cve/CVE-2017-11427/) vulnerability. @@ -30,7 +35,12 @@ Update ``python3-saml`` to ``>= 1.2.1``, ``1.2.0`` had a bug on signature valida #### Security Guidelines #### -If you believe you have discovered a security vulnerability in this toolkit, please report it at https://www.onelogin.com/security with a description. We follow responsible disclosure guidelines, and will work with you to quickly find a resolution. +If you believe you have discovered a security vulnerability in this toolkit, please report it by mail to the maintainer: sixto.martin.garcia+security@gmail.com + +### Sponsors +Thanks to the following sponsors for their support: + +[84codes](https://www.maykinmedia.nl) Why add SAML support to my software? ------------------------------------ @@ -58,7 +68,7 @@ since 2002, but lately it is becoming popular due its advantages: General Description ------------------- -OneLogin's SAML Python toolkit lets you turn your Python application into a SP +SAML Python toolkit lets you turn your Python application into a SP (Service Provider) that can be connected to an IdP (Identity Provider). **Supports:** @@ -79,20 +89,19 @@ OneLogin's SAML Python toolkit lets you turn your Python application into a SP * **Easy to use** - Programmer will be allowed to code high-level and low-level programming, 2 easy to use APIs are available. * **Tested** - Thoroughly tested. - * **Popular** - OneLogin's customers use it. Add easy support to your Django/Flask web projects. Installation ------------ ### Dependencies ### - * python 2.7 // python 3.6 + * python => 3.7 * [xmlsec](https://pypi.python.org/pypi/xmlsec) Python bindings for the XML Security Library. + * [lxml](https://pypi.python.org/pypi/lxml) Python bindings for the libxml2 and libxslt libraries. * [isodate](https://pypi.python.org/pypi/isodate) An ISO 8601 date/time/ duration parser and formatter - * [defusedxml](https://pypi.python.org/pypi/defusedxml) XML bomb protection for Python stdlib modules -Review the ``setup.py`` file to know the version of the library that ``python3-saml`` is using +Review the ``pyproject.toml`` file to know the version of the library that ``python3-saml`` is using ### Code ### @@ -100,10 +109,10 @@ Review the ``setup.py`` file to know the version of the library that ``python3-s The toolkit is hosted on GitHub. You can download it from: - * Latest release: https://github.com/onelogin/python3-saml/releases/latest - * Master repo: https://github.com/onelogin/python3-saml/tree/master + * Latest release: https://github.com/saml-toolkits/python3-saml/releases/latest + * Master repo: https://github.com/saml-toolkits/python3-saml/tree/master -Copy the core of the library ``(src/onelogin/saml2 folder)`` and merge the ``setup.py`` inside the Python application. (Each application has its structure so take your time to locate the Python SAML toolkit in the best place). +Find the core of the library at ``src/onelogin/saml2`` folder. #### Option 2. Download from pypi #### @@ -116,6 +125,14 @@ $ pip install python3-saml If you want to know how a project can handle python packages review this [guide](https://packaging.python.org/en/latest/tutorial.html) and review this [sampleproject](https://github.com/pypa/sampleproject) +#### NOTE #### +To avoid ``libxml2`` library version incompatibilities between ``xmlsec`` and ``lxml`` it is recommended that ``lxml`` is not installed from binary. + +This can be ensured by executing: +``` +$ pip install --force-reinstall --no-binary lxml lxml +``` + Security Warning ---------------- @@ -124,12 +141,41 @@ your environment is not secure and will be exposed to attacks. In production also we highly recommend to register on the settings the IdP certificate instead of using the fingerprint method. The fingerprint, is a hash, so at the end is open to a collision attack that can end on a signature validation bypass. Other SAML toolkits deprecated that mechanism, we maintain it for compatibility and also to be used on test environment. + +### Avoiding Open Redirect attacks ### + +Some implementations uses the RelayState parameter as a way to control the flow when SSO and SLO succeeded. So basically the +user is redirected to the value of the RelayState. + +If you are using Signature Validation on the HTTP-Redirect binding, you will have the RelayState value integrity covered, otherwise, and +on HTTP-POST binding, you can't trust the RelayState so before +executing the validation, you need to verify that its value belong +a trusted and expected URL. + +Read more about Open Redirect [CWE-601](https://cwe.mitre.org/data/definitions/601.html). + +### Avoiding Replay attacks ### + +A replay attack is basically try to reuse an intercepted valid SAML Message in order to impersonate a SAML action (SSO or SLO). + +SAML Messages have a limited timelife (NotBefore, NotOnOrAfter) that +make harder this kind of attacks, but they are still possible. + +In order to avoid them, the SP can keep a list of SAML Messages or Assertion IDs already validated and processed. Those values only need +to be stored the amount of time of the SAML Message life time, so +we don't need to store all processed message/assertion Ids, but the most recent ones. + +The OneLogin_Saml2_Auth class contains the [get_last_request_id](https://github.com/onelogin/python3-saml/blob/ab62b0d6f3e5ac2ae8e95ce3ed2f85389252a32d/src/onelogin/saml2/auth.py#L357), [get_last_message_id](https://github.com/onelogin/python3-saml/blob/ab62b0d6f3e5ac2ae8e95ce3ed2f85389252a32d/src/onelogin/saml2/auth.py#L364) and [get_last_assertion_id](https://github.com/onelogin/python3-saml/blob/ab62b0d6f3e5ac2ae8e95ce3ed2f85389252a32d/src/onelogin/saml2/auth.py#L371) methods to retrieve the IDs + +Checking that the ID of the current Message/Assertion does not exists in the list of the ones already processed will prevent replay attacks. + + Getting Started --------------- ### Knowing the toolkit ### -The new OneLogin SAML Toolkit contains different folders (``certs``, ``lib``, ``demo-django``, ``demo-flask`` and ``tests``) and some files. +The new SAML Toolkit contains different folders (``certs``, ``lib``, ``demo-django``, ``demo-flask`` and ``tests``) and some files. Let's start describing them: @@ -161,7 +207,7 @@ publish that X.509 certificate on Service Provider metadata. If you want to create self-signed certs, you can do it at the https://www.samltool.com/self_signed_certs.php service, or using the command: ```bash -openssl req -new -x509 -days 3652 -nodes -out sp.crt -keyout saml.key +openssl req -new -x509 -days 3652 -nodes -out sp.crt -keyout sp.key ``` #### demo-flask #### @@ -172,26 +218,36 @@ This folder contains a Flask project that will be used as demo to show how to ad This folder contains a Pyramid project that will be used as demo to show how to add SAML support to the [Pyramid Web Framework](http://docs.pylonsproject.org/projects/pyramid/en/latest/). ``\_\_init__.py`` is the main file that configures the app and its routes, ``views.py`` is where all the logic and SAML handling takes place, and the templates are stored in the ``templates`` folder. The ``saml`` folder is the same as in the other two demos. +#### demo-tornado #### + +This folder contains a Tornado project that will be used as demo to show how to add SAML support to the Tornado Framework. ``views.py`` (with its ``settings.py``) is the main Flask file that has all the code, this file uses the templates stored at the ``templates`` folder. In the ``saml`` folder we found the ``certs`` folder to store the X.509 public and private key, and the SAML toolkit settings (``settings.json`` and ``advanced_settings.json``). -#### setup.py #### +It requires python3.8 (it's using tornado 6.4.1) -Setup script is the centre of all activity in building, distributing, and installing modules. -Read more at https://pythonhosted.org/an_example_pypi_project/setuptools.html #### tests #### Contains the unit test of the toolkit. -In order to execute the test you only need to load the virtualenv with the toolkit installed on it and execute: +In order to execute the test you only need to load the virtualenv with the toolkit installed on it properly: +``` +make install-test +``` + +and execute: ``` -python setup.py test +make pytest ``` The previous line will run the tests for the whole toolkit. You can also run the tests for a specific module. To do so for the auth module you would have to execute this: ``` -python setup.py test --test-suite tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test +pytest tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test +``` + +Or for an specific method: +``` +pytest tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testBuildRequestSignature ``` -With the ``--test-suite`` parameter you can specify the module to test. You'll find all the module available and their class names at ``tests/src/OneLogin/saml2_tests/``. ### How It Works ### @@ -230,24 +286,31 @@ This is the ``settings.json`` file: // URL Location where the from the IdP will be returned "url": "https:///?acs", // SAML protocol binding to be used when returning the - // message. OneLogin Toolkit supports this endpoint for the + // message. SAML Toolkit supports this endpoint for the // HTTP-POST binding only. "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" }, - // Specifies info about where and how the message MUST be - // returned to the requester, in this case our SP. + // Specifies info about where and how the message MUST be sent. "singleLogoutService": { - // URL Location where the from the IdP will be returned + // URL Location where the from the IdP will be sent (IdP-initiated logout) "url": "https:///?sls", + // URL Location where the from the IdP will sent (SP-initiated logout, reply) + // OPTIONAL: only specify if different from url parameter + //"responseUrl": "https:///?sls", // SAML protocol binding to be used when returning the - // message. OneLogin Toolkit supports the HTTP-Redirect binding + // message. SAML Toolkit supports the HTTP-Redirect binding // only for this endpoint. "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" }, // If you need to specify requested attributes, set a // attributeConsumingService. nameFormat, attributeValue and - // friendlyName can be ommited + // friendlyName can be omitted "attributeConsumingService": { + // OPTIONAL: only specify if SP requires this. + // index is an integer which identifies the attributeConsumingService used + // to the SP. SAML toolkit supports configuring only one attributeConsumingService + // but in certain cases the SP requires a different value. Defaults to '1'. + // "index": '1', "serviceName": "SP test", "serviceDescription": "Test Service", "requestedAttributes": [ @@ -289,16 +352,19 @@ This is the ``settings.json`` file: // will be sent. "url": "https://app.onelogin.com/trust/saml2/http-post/sso/", // SAML protocol binding to be used when returning the - // message. OneLogin Toolkit supports the HTTP-Redirect binding + // message. SAML Toolkit supports the HTTP-Redirect binding // only for this endpoint. "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" }, // SLO endpoint info of the IdP. "singleLogoutService": { - // URL Location of the IdP where SLO Request will be sent. + // URL Location where the from the IdP will be sent (IdP-initiated logout) "url": "https://app.onelogin.com/trust/saml2/http-redirect/slo/", + // URL Location where the from the IdP will sent (SP-initiated logout, reply) + // OPTIONAL: only specify if different from url parameter + "responseUrl": "https://app.onelogin.com/trust/saml2/http-redirect/slo_return/", // SAML protocol binding to be used when returning the - // message. OneLogin Toolkit supports the HTTP-Redirect binding + // message. SAML Toolkit supports the HTTP-Redirect binding // only for this endpoint. "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" }, @@ -307,8 +373,8 @@ This is the ``settings.json`` file: /* * Instead of using the whole X.509cert you can use a fingerprint in order to * validate a SAMLResponse (but you still need the X.509cert to validate LogoutRequest and LogoutResponse using the HTTP-Redirect binding). - * But take in mind that the fingerprint, is a hash, so at the end is open to a collision attack that can end on a signature validation bypass, - * that why we don't recommend it use for production environments. + * But take in mind that the algorithm for the fingerprint should be as strong as the algorithm in a normal certificate signature + * (e.g. SHA256 or strong) * * (openssl x509 -noout -fingerprint -in "idp.crt" to generate it, * or add for example the -sha256 , -sha384 or -sha512 parameter) @@ -408,7 +474,7 @@ In addition to the required settings data (idp, sp), extra settings can be defin "requestedAuthnContext": true, // Allows the authn comparison parameter to be set, defaults to 'exact' if the setting is not present. "requestedAuthnContextComparison": "exact", - // Set to true to check that the AuthnContext received matches the one requested. + // Set to true to check that the AuthnContext(s) received match(es) the requested. "failOnAuthnContextMismatch": false, // In some environment you will need to set how long the published metadata of the Service Provider gonna be valid. @@ -418,20 +484,33 @@ In addition to the required settings data (idp, sp), extra settings can be defin // Provide the desire Duration, for example PT518400S (6 days) "metadataCacheDuration": null, + // If enabled, URLs with single-label-domains will + // be allowed and not rejected by the settings validator (Enable it under Docker/Kubernetes/testing env, not recommended on production) + "allowSingleLabelDomains": false, + // Algorithm that the toolkit will use on signing process. Options: // 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' // 'http://www.w3.org/2000/09/xmldsig#dsa-sha1' // 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' // 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384' // 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512' - "signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", + "signatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", // Algorithm that the toolkit will use on digest process. Options: // 'http://www.w3.org/2000/09/xmldsig#sha1' // 'http://www.w3.org/2001/04/xmlenc#sha256' // 'http://www.w3.org/2001/04/xmldsig-more#sha384' // 'http://www.w3.org/2001/04/xmlenc#sha512' - 'digestAlgorithm': "http://www.w3.org/2000/09/xmldsig#sha1" + 'digestAlgorithm': "http://www.w3.org/2001/04/xmlenc#sha256", + + // Specify if you want the SP to view assertions with duplicated Name or FriendlyName attributes to be valid + // Defaults to false if not specified + 'allowRepeatAttributeName': false, + + // If the toolkit receive a message signed with a + // deprecated algorithm (defined at the constant class) + // will raise an error and reject the message + "rejectDeprecatedAlgorithm": true }, // Contact information template, it is recommended to suply a @@ -448,7 +527,7 @@ In addition to the required settings data (idp, sp), extra settings can be defin }, // Organization information template, the info in en_US lang is - // recomended, add more if required. + // recommended, add more if required. "organization": { "en-US": { "name": "sp_test", @@ -500,12 +579,25 @@ The method above requires a little extra work to manually specify attributes abo There's an easier method -- use a metadata exchange. Metadata is just an XML file that defines the capabilities of both the IdP and the SP application. It also contains the X.509 public key certificates which add to the trusted relationship. The IdP administrator can also configure custom settings for an SP based on the metadata. -Using ````parse_remote```` IdP metadata can be obtained and added to the settings withouth further ado. +Using ````parse_remote```` IdP metadata can be obtained and added to the settings without further ado. + +Take in mind that the OneLogin_Saml2_IdPMetadataParser class does not validate in any way the URL that is introduced in order to be parsed. + +Usually the same administrator that handles the Service Provider also sets the URL to the IdP, which should be a trusted resource. + +But there are other scenarios, like a SAAS app where the administrator of the app delegates this functionality to other users. In this case, extra precaution should be taken in order to validate such URL inputs and avoid attacks like SSRF. + `` idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote('https://example.com/auth/saml2/idp/metadata') `` +You can specify a timeout in seconds for metadata retrieval, without it is not guaranteed that the request will complete + +`` +idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote('https://example.com/auth/saml2/idp/metadata', timeout=5) +`` + If the Metadata contains several entities, the relevant ``EntityDescriptor`` can be specified when retrieving the settings from the ``IdpMetadataParser`` by its ``entityId`` value: ``idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(https://example.com/metadatas, entity_id='idp_entity_id')`` @@ -536,15 +628,15 @@ This parameter has the following scheme: req = { "http_host": "", "script_name": "", - "server_port": "", "get_data": "", "post_data": "", # Advanced request options "https": "", - "lowercase_urlencoding": "", "request_uri": "", - "query_string": "" + "query_string": "", + "validate_signature_from_qs": False, + "lowercase_urlencoding": False } ``` @@ -556,7 +648,6 @@ def prepare_from_django_request(request): return { 'http_host': request.META['HTTP_HOST'], 'script_name': request.META['PATH_INFO'], - 'server_port': request.META['SERVER_PORT'], 'get_data': request.GET.copy(), 'post_data': request.POST.copy() } @@ -564,8 +655,7 @@ def prepare_from_django_request(request): def prepare_from_flask_request(request): url_data = urlparse(request.url) return { - 'http_host': request.host, - 'server_port': url_data.port, + 'http_host': request.netloc, 'script_name': request.path, 'get_data': request.args.copy(), 'post_data': request.form.copy() @@ -576,12 +666,12 @@ An explanation of some advanced request parameters: * `https` - Defaults to ``off``. Set this to ``on`` if you receive responses over HTTPS. -* `lowercase_urlencoding` - Defaults to `false`. ADFS users should set this to `true`. - -* `request_uri` - The path where your SAML server recieves requests. Set this if requests are not recieved at the server's root. +* `request_uri` - The path where your SAML server receives requests. Set this if requests are not received at the server's root. * `query_string` - Set this with additional query parameters that should be passed to the request endpoint. +* `validate_signature_from_qs` - If `True`, use `query_string` to validate request and response signatures. Otherwise, use `get_data`. Defaults to `False`. Note that when using `get_data`, query parameters need to be url-encoded for validation. By default we use upper-case url-encoding. Some IdPs, notably Microsoft AD, use lower-case url-encoding, which makes signature validation to fail. To fix this issue, either pass `query_string` and set `validate_signature_from_qs` to `True`, which works for all IdPs, or set `lowercase_urlencoding` to `True`, which only works for AD. + #### Initiate SSO #### @@ -594,12 +684,13 @@ req = prepare_request_for_toolkit(request) auth = OneLogin_Saml2_Auth(req) # Constructor of the SP, loads settings.json # and advanced_settings.json -auth.login() # Method that builds and sends the AuthNRequest +auth.login() # This method will build and return a AuthNRequest URL that can be + # either redirected to, or printed out onto the screen as a hyperlink ``` The ``AuthNRequest`` will be sent signed or unsigned based on the security info of the ``advanced_settings.json`` file (i.e. ``authnRequestsSigned``). -The IdP will then return the SAML Response to the user's client. The client is then forwarded to the **Attribute Consumer Service (ACS)** of the SP with this information. +The IdP will then return the SAML Response to the user's client. The client is then forwarded to the **Assertion Consumer Service (ACS)** of the SP with this information. We can set a ``return_to`` url parameter to the login function and that will be converted as a ``RelayState`` parameter: @@ -607,7 +698,7 @@ We can set a ``return_to`` url parameter to the login function and that will be target_url = 'https://example.com' auth.login(return_to=target_url) ``` -The login method can recieve 3 more optional parameters: +The login method can receive 3 more optional parameters: * ``force_authn`` When ``true``, the ``AuthNReuqest`` will set the ``ForceAuthn='true'`` * ``is_passive`` When true, the ``AuthNReuqest`` will set the ``Ispassive='true'`` @@ -648,7 +739,7 @@ saml_settings = OneLogin_Saml2_Settings(settings=None, custom_base_path=None, sp ``` to get the settings object and with the ``sp_validation_only=True`` parameter we will avoid the IdP settings validation. -***Attribute Consumer Service (ACS)*** +***Assertion Consumer Service (ACS)*** This code handles the SAML response that the IdP forwards to the SP through the user's client. @@ -662,6 +753,8 @@ if not errors: request.session['samlUserdata'] = auth.get_attributes() if 'RelayState' in req['post_data'] and OneLogin_Saml2_Utils.get_self_url(req) != req['post_data']['RelayState']: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the req['post_data']['RelayState'] is a trusted URL. auth.redirect_to(req['post_data']['RelayState']) else: for attr_name in request.session['samlUserdata'].keys(): @@ -669,7 +762,7 @@ if not errors: else: print('Not authenticated') else: - print("Error when processing SAML Response: %s" % (', '.join(errors))) + print("Error when processing SAML Response: %s %s" % (', '.join(errors), auth.get_last_error_reason())) ``` The SAML response is processed and then checked that there are no errors. It also verifies that the user is authenticated and stored the userdata in session. @@ -684,7 +777,7 @@ Notice that we saved the user data in the session before the redirection to have In order to retrieve attributes we use: ```python -attributes = auth.get_attributes(); +attributes = auth.get_attributes() ``` With this method we get a dict with all the user data provided by the IdP in the assertion of the SAML response. @@ -700,12 +793,12 @@ If we execute print attributes we could get: } ``` -Each attribute name can be used as a key to obtain the value. Every attribute is a list of values. A single-valued attribute is a listy of a single element. +Each attribute name can be used as a key to obtain the value. Every attribute is a list of values. A single-valued attribute is a list of a single element. The following code is equivalent: ```python -attributes = auth.get_attributes(); +attributes = auth.get_attributes() print(attributes['cn']) print(auth.get_attribute('cn')) @@ -724,11 +817,13 @@ url = auth.process_slo(delete_session_cb=delete_session_callback) errors = auth.get_errors() if len(errors) == 0: if url is not None: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the url is a trusted URL. return redirect(url) else: - print("Sucessfully Logged out") + print("Successfully Logged out") else: - print("Error when processing SLO: %s" % (', '.join(errors))) + print("Error when processing SLO: %s %s" % (', '.join(errors), auth.get_last_error_reason())) ``` If the SLS endpoints receives a Logout Response, the response is validated and the session could be closed, using the callback. @@ -851,6 +946,8 @@ elif 'acs' in request.args: # Assertion Consumer Service request.session['samlSessionIndex'] = auth.get_session_index() self_url = OneLogin_Saml2_Utils.get_self_url(req) if 'RelayState' in request.form and self_url != request.form['RelayState']: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the request.form['RelayState'] is a trusted URL. return redirect(auth.redirect_to(request.form['RelayState'])) # Redirect if there is a relayState else: # If there is user data we save that to print it later. msg = '' @@ -862,9 +959,11 @@ elif 'sls' in request.args: # Single errors = auth.get_errors() # Retrieves possible validation errors if len(errors) == 0: if url is not None: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the url is a trusted URL. return redirect(url) else: - msg = "Sucessfully logged out" + msg = "Successfully logged out" if len(errors) == 0: print(msg) @@ -906,7 +1005,7 @@ Described below are the main classes and methods that can be invoked from the SA #### OneLogin_Saml2_Auth - auth.py #### -Main class of OneLogin Python Toolkit +Main class of SAML Python Toolkit * `__init__` Initializes the SP SAML instance. * ***login*** Initiates the SSO process. @@ -932,9 +1031,11 @@ Main class of OneLogin Python Toolkit * ***set_strict*** Set the strict mode active/disable. * ***get_last_request_xml*** Returns the most recently-constructed/processed XML SAML request (``AuthNRequest``, ``LogoutRequest``) * ***get_last_response_xml*** Returns the most recently-constructed/processed XML SAML response (``SAMLResponse``, ``LogoutResponse``). If the SAMLResponse had an encrypted assertion, decrypts it. +* ***get_last_response_in_response_to*** The `InResponseTo` ID of the most recently processed SAML Response. * ***get_last_message_id*** The ID of the last Response SAML message processed. * ***get_last_assertion_id*** The ID of the last assertion processed. * ***get_last_assertion_not_on_or_after*** The ``NotOnOrAfter`` value of the valid ``SubjectConfirmationData`` node (if any) of the last assertion processed (is only calculated with strict = true) +* ***get_last_assertion_issue_instant*** The `IssueInstant` value of the last assertion processed. #### OneLogin_Saml2_Auth - authn_request.py #### @@ -978,7 +1079,7 @@ SAML 2 Logout Request class * ***get_nameid*** Gets the NameID of the Logout Request Message (returns a string). * ***get_issuer*** Gets the Issuer of the Logout Request Message. * ***get_session_indexes*** Gets the ``SessionIndexes`` from the Logout Request. -* ***is_valid*** Checks if the Logout Request recieved is valid. +* ***is_valid*** Checks if the Logout Request received is valid. * ***get_error*** After execute a validation process, if fails this method returns the cause. * ***get_xml*** Returns the XML that will be sent as part of the request or that was received at the SP @@ -997,7 +1098,7 @@ SAML 2 Logout Response class #### OneLogin_Saml2_Settings - settings.py #### -Configuration of the OneLogin Python Toolkit +Configuration of the SAML Python Toolkit * `__init__` Initializes the settings: Sets the paths of the different folders and Loads settings info from settings file or array/object provided. * ***check_settings*** Checks the settings info. @@ -1061,7 +1162,7 @@ Auxiliary class that contains several methods * ***get_expire_time*** Compares 2 dates and returns the earliest. * ***delete_local_session*** Deletes the local session. * ***calculate_X.509_fingerprint*** Calculates the fingerprint of a X.509 cert. -* ***format_finger_print*** Formates a fingerprint. +* ***format_finger_print*** Formats a fingerprint. * ***generate_name_id*** Generates a nameID. * ***get_status*** Gets Status from a Response. * ***decrypt_element*** Decrypts an encrypted element. @@ -1095,7 +1196,7 @@ For more info, look at the source code. Each method is documented and details ab Demos included in the toolkit ----------------------------- -The toolkit includes 2 demos to teach how use the toolkit (A Django and a Flask project), take a look on it. +The toolkit includes 3 demos to teach how use the toolkit (A Django, Flask and a Tornado project), take a look on it. Demos require that SP and IdP are well configured before test it, so edit the settings files. Notice that each python framework has it own way to handle routes/urls and process request, so focus on @@ -1111,22 +1212,14 @@ let's see how fast is it to deploy them. The use of a [virtualenv](http://virtualenv.readthedocs.org/en/latest/) is highly recommended. -Virtualenv helps isolating the python enviroment used to run the toolkit. You +Virtualenv helps isolating the python environment used to run the toolkit. You can find more details and an installation guide in the [official documentation](http://virtualenv.readthedocs.org/en/latest/). Once you have your virtualenv ready and loaded, then you can install the -toolkit on it in development mode executing this: -``` - python setup.py develop -``` - -Using this method of deployment the toolkit files will be linked instead of -copied, so if you make changes on them you won't need to reinstall the toolkit. - -If you want install it in a normal mode, execute: +toolkit executing this: ``` - python setup.py install + make install-req ``` ### Demo Flask ### @@ -1165,7 +1258,7 @@ The flask project contains: #### SP setup #### -The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways: Settings files or define a setting dict. In the ``demo-flask``, it uses the first method. +The SAML Python Toolkit allows you to provide the settings info in 2 ways: Settings files or define a setting dict. In the ``demo-flask``, it uses the first method. In the ``index.py`` file we define the ``app.config['SAML_PATH']``, that will target to the ``saml`` folder. We require it in order to load the settings files. @@ -1175,6 +1268,79 @@ First we need to edit the ``saml/settings.json`` file, configure the SP part and Once the SP is configured, the metadata of the SP is published at the ``/metadata`` url. Based on that info, configure the IdP. +#### How it works #### + + 1. First time you access to the main view (http://localhost:8000), you can select to login and return to the same view or login and be redirected to ``/?attrs`` (attrs view). + + 2. When you click: + + 2.1 in the first link, we access to ``/?sso`` (index view). An ``AuthNRequest`` is sent to the IdP, we authenticate at the IdP and then a Response is sent through the user's client to the SP, specifically the Assertion Consumer Service view: ``/?acs``. Notice that a ``RelayState`` parameter is set to the url that initiated the process, the index view. + + 2.2 in the second link we access to ``/?attrs`` (attrs view), we will expetience have the same process described at 2.1 with the diference that as ``RelayState`` is set the ``attrs`` url. + + 3. The SAML Response is processed in the ACS ``/?acs``, if the Response is not valid, the process stops here and a message is shown. Otherwise we are redirected to the ``RelayState`` view. a) / or b) ``/?attrs`` + + 4. We are logged in the app and the user attributes are showed. At this point, we can test the single log out functionality. + + The single log out functionality could be tested by 2 ways. + + 5.1 SLO Initiated by SP. Click on the ``logout`` link at the SP, after that a Logout Request is sent to the IdP, the session at the IdP is closed and replies through the client to the SP with a Logout Response (sent to the Single Logout Service endpoint). The SLS endpoint ``/?sls`` of the SP process the Logout Response and if is valid, close the user session of the local app. Notice that the SLO Workflow starts and ends at the SP. + + 5.2 SLO Initiated by IdP. In this case, the action takes place on the IdP side, the logout process is initiated at the IdP, sends a Logout Request to the SP (SLS endpoint, ``/?sls``). The SLS endpoint of the SP process the Logout Request and if is valid, close the session of the user at the local app and send a Logout Response to the IdP (to the SLS endpoint of the IdP). The IdP receives the Logout Response, process it and close the session at of the IdP. Notice that the SLO Workflow starts and ends at the IdP. + +Notice that all the SAML Requests and Responses are handled at a unique view (index) and how GET parameters are used to know the action that must be done. + +### Demo Tornado ### + +You'll need a virtualenv with the toolkit installed on it. + +First of all you need some packages, execute: +``` +apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl +``` + +To run the demo you need to install the requirements first. Load your +virtualenv and execute: +``` + pip install -r demo-tornado/requirements.txt +``` + + +This will install tornado and its dependencies. Once it has finished, you have to complete the configuration +of the toolkit. You'll find it at `demo-tornado/saml/settings.json` + +Now, with the virtualenv loaded, you can run the demo like this: +``` + cd demo-tornado + python views.py +``` + +You'll have the demo running at http://localhost:8000 + +#### Content #### + +The tornado project contains: + +* ***views.py*** Is the main flask file, where or the SAML handle take place. + +* ***settings.py*** Contains the base path and the path where is located the ``saml`` folder and the ``template`` folder + +* ***templates***. Is the folder where tornado stores the templates of the project. It was implemented a base.html template that is extended by index.html and attrs.html, the templates of our simple demo that shows messages, user attributes when available and login and logout links. + +* ***saml*** Is a folder that contains the 'certs' folder that could be used to store the X.509 public and private key, and the saml toolkit settings (settings.json and advanced_settings.json). + +#### SP setup #### + +The SAML Python Toolkit allows you to provide the settings info in 2 ways: Settings files or define a setting dict. In the ``demo-tornado``, it uses the first method. + +In the ``settings.py`` file we define the ``SAML_PATH``, that will target to the ``saml`` folder. We require it in order to load the settings files. + +First we need to edit the ``saml/settings.json`` file, configure the SP part and review the metadata of the IdP and complete the IdP info. Later edit the ``saml/advanced_settings.json`` files and configure the how the toolkit will work. Check the settings section of this document if you have any doubt. + +#### IdP setup #### + +Once the SP is configured, the metadata of the SP is published at the ``/metadata`` url. Based on that info, configure the IdP. + #### How it works #### 1. First time you access to the main view (http://localhost:8000), you can select to login and return to the same view or login and be redirected to ``/?attrs`` (attrs view). @@ -1238,7 +1404,7 @@ The django project contains: #### SP setup #### -The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways: settings files or define a setting dict. In the demo-django it used the first method. +The SAML Python Toolkit allows you to provide the settings info in 2 ways: settings files or define a setting dict. In the demo-django it used the first method. After set the ``SAML_FOLDER`` in the ``demo/settings.py``, the settings of the Python toolkit will be loaded on the Django web. @@ -1318,7 +1484,7 @@ The Pyramid project contains: #### SP setup #### -The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways: settings files or define a setting dict. In ``demo_pyramid`` the first method is used. +The SAML Python Toolkit allows you to provide the settings info in 2 ways: settings files or define a setting dict. In ``demo_pyramid`` the first method is used. In the ``views.py`` file we define the ``SAML_PATH``, which will target the ``saml`` folder. We require it in order to load the settings files. @@ -1342,7 +1508,7 @@ Once the SP is configured, the metadata of the SP is published at the ``/metadat 4. We are logged in the app and the user attributes are showed. At this point, we can test the single log out functionality. - The single log out funcionality could be tested by 2 ways. + The single log out functionality could be tested by 2 ways. 5.1 SLO Initiated by SP. Click on the "logout" link at the SP, after that a Logout Request is sent to the IdP, the session at the IdP is closed and replies through the client to the SP with a Logout Response (sent to the Single Logout Service endpoint). The SLS endpoint /?sls of the SP process the Logout Response and if is valid, close the user session of the local app. Notice that the SLO Workflow starts and ends at the SP. diff --git a/changelog.md b/changelog.md index 9d7e4384..10a066f0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,74 @@ # python3-saml changelog -### 1.7.1 (unrelease) -* Drop python3.4 support +### 1.16.0 (Oct 9, 2023) +- [#364](https://github.com/SAML-Toolkits/python3-saml/commit/d1bfaeb17a786735827b8252b91deafde29dabd8) Improve get_metadata method from Parser, allowing to set headers +- Fix WantAuthnRequestsSigned parser +- Fix expired payloads used on tests +- Updated content from docs folder + +### 1.15.0 (Dec 27, 2022) +- [#317](https://github.com/SAML-Toolkits/python3-saml/pull/317) Handle unicode characters gracefully in python 2 +- [#338](https://github.com/SAML-Toolkits/python3-saml/pull/338) Fix WantAuthnRequestsSigned parser +- [#339](https://github.com/SAML-Toolkits/python3-saml/pull/339) Add Poetry support +- Remove version restriction on lxml dependency +- Updated Django demo to 4.X (only py3 compatible) +- Updated Travis file. Forced lxml to be installed using no-validate_binary +- Removed references to OneLogin from documentation + +### 1.14.0 (Feb 18, 2022) +- [#297](https://github.com/onelogin/python3-saml/pull/297) Don't require yanked version of lxml. +- [#298](https://github.com/onelogin/python3-saml/pull/298) Add support for python 3.10 and cleanup the GHA. +- [#299](https://github.com/onelogin/python3-saml/pull/299) Remove stats from coveralls removed as they are no longer maintained. + +### 1.13.0 (Jan 28, 2022) +- [#296](https://github.com/onelogin/python3-saml/pull/296) Add rejectDeprecatedAlgorithm settings in order to be able reject messages signed with deprecated algorithms. +- Set sha256 and rsa-sha256 as default algorithms +- [#288](https://github.com/onelogin/python3-saml/pull/288) Support building a LogoutResponse with non-success status +- Added warning about Open Redirect and Reply attacks +- [##274](https://github.com/onelogin/python3-saml/pull/274) Replace double-underscored names with single underscores +- Add at OneLogin_Saml2_Auth get_last_assertion_issue_instant() and get_last_response_in_response_to() methods +- Upgrade dependencies + +### 1.12.0 (Aug 13, 2021) +* [#276](https://github.com/onelogin/python3-saml/pull/276) Deprecate server_port from request data dictionary + +### 1.11.0 (Jul 23, 2021) +* [#261](https://github.com/onelogin/python3-saml/pull/261) Allow duplicate named attributes, controlled by a new setting +* [#268](https://github.com/onelogin/python3-saml/pull/268) Make the redirect scheme matcher case-insensitive +* [#256](https://github.com/onelogin/python3-saml/pull/256) Improve signature validation process. Add an option to use query string for validation +* [#259](https://github.com/onelogin/python3-saml/pull/259) Add get metadata timeout +* [#246](https://github.com/onelogin/python3-saml/pull/246) Add the ability to change the ProtocolBinding in the authn request. +* [#248](https://github.com/onelogin/python3-saml/pull/248) Move storing the response data into its own method in the Auth class +* Remove the dependency on defusedxml +* [#241](https://github.com/onelogin/python3-saml/pull/241) Improve AttributeConsumingService support +* Update expired dates from test responses +* Migrate from Travis to Github Actions + +### 1.10.1 (Jan 27, 2021) +* Fix bug on LogoutRequest class, get_idp_slo_response_url was used instead get_idp_slo_url + +### 1.10.0 (Jan 14, 2021) +* Added custom lxml parser based on the one defined at xmldefused. Parser will ignore comments and processing instructions and by default have deactivated huge_tree, DTD and access to external documents +* Destination URL Comparison is now case-insensitive for netloc +* Support single-label-domains as valid. New security parameter allowSingleLabelDomains +* Added get_idp_sso_url, get_idp_slo_url and get_idp_slo_response_url methods to the Settings class and use it in the toolkit +* [#212](https://github.com/onelogin/python3-saml/pull/212) Overridability enhancements. Made classes overridable by subclassing. Use of classmethods instead staticmethods +* Add get_friendlyname_attributes support +* Remove external lib method get_ext_lib_path. Add set_cert_path in order to allow set the cert path in a different folder than the toolkit +* Add sha256 instead sha1 algorithm for sign/digest as recommended value on documentation and settings +* [#178](https://github.com/onelogin/python3-saml/pull/178) Support for adding idp.crt from filesystem +* Add samlUserdata to demo-flask session +* Fix autoreloading in demo-tornado + +### 1.9.0 (Nov 20, 2019) +* Allow any number of decimal places for seconds on SAML datetimes +* Fix failOnAuthnContextMismatch code +* Improve signature validation when no reference uri +* Update demo versions. Improve them and add Tornado demo. + +### 1.8.0 (Sep 11, 2019) +* Set true as the default value for strict setting +* [#152](https://github.com/onelogin/python3-saml/pull/152/files) Don't clean xsd and xsi namespaces +* Drop python3.4 support due lxml. See lxml 4.4.0 (2019-07-27) ### 1.7.0 (Jul 02, 2019) * Adjusted acs endpoint to extract NameQualifier and SPNameQualifier from SAMLResponse. Adjusted single logout service to provide NameQualifier and SPNameQualifier to logout method. Add getNameIdNameQualifier to Auth and SamlResponse. Extend logout method from Auth and LogoutRequest constructor to support SPNameQualifier parameter. Align LogoutRequest constructor with SAML specs @@ -39,7 +107,7 @@ ### 1.3.0 (Sep 15, 2017) * Improve decrypt method, Add an option to decrypt an element in place or copy it before decryption. * [#63](https://github.com/onelogin/python3-saml/pull/63) Be able to get at the auth object the last processed ID (response/assertion) and the last generated ID, as well as the NotOnOrAfter value of the valid SubjectConfirmationData in the processed SAMLResponse -* On a LogoutRequest if the NameIdFormat is entity, NameQualifier and SPNameQualifier will be ommited. If the NameIdFormat is not entity and a NameQualifier is provided, then the SPNameQualifier will be also added. +* On a LogoutRequest if the NameIdFormat is entity, NameQualifier and SPNameQualifier will be omitted. If the NameIdFormat is not entity and a NameQualifier is provided, then the SPNameQualifier will be also added. * Reset errorReason attribute of the auth object before each Process method * [#65](https://github.com/onelogin/python3-saml/pull/65) Fix issue on getting multiple certs when only sign or encryption certs diff --git a/demo-django/demo/urls.py b/demo-django/demo/urls.py index cb05b321..92bc0a2b 100644 --- a/demo-django/demo/urls.py +++ b/demo-django/demo/urls.py @@ -1,10 +1,11 @@ -from django.conf.urls import url +from django.urls import re_path from django.contrib import admin from .views import attrs, index, metadata + admin.autodiscover() urlpatterns = [ - url(r'^$', index, name='index'), - url(r'^attrs/$', attrs, name='attrs'), - url(r'^metadata/$', metadata, name='metadata'), + re_path(r"^$", index, name="index"), + re_path(r"^attrs/$", attrs, name="attrs"), + re_path(r"^metadata/$", metadata, name="metadata"), ] diff --git a/demo-django/demo/views.py b/demo-django/demo/views.py index 4c61e599..82ae55eb 100644 --- a/demo-django/demo/views.py +++ b/demo-django/demo/views.py @@ -1,7 +1,6 @@ from django.conf import settings from django.urls import reverse -from django.http import (HttpResponse, HttpResponseRedirect, - HttpResponseServerError) +from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError from django.shortcuts import render from onelogin.saml2.auth import OneLogin_Saml2_Auth @@ -17,14 +16,13 @@ def init_saml_auth(req): def prepare_django_request(request): # If server is behind proxys or balancers use the HTTP_X_FORWARDED fields result = { - 'https': 'on' if request.is_secure() else 'off', - 'http_host': request.META['HTTP_HOST'], - 'script_name': request.META['PATH_INFO'], - 'server_port': request.META['SERVER_PORT'], - 'get_data': request.GET.copy(), + "https": "on" if request.is_secure() else "off", + "http_host": request.META["HTTP_HOST"], + "script_name": request.META["PATH_INFO"], + "get_data": request.GET.copy(), # Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144 # 'lowercase_urlencoding': True, - 'post_data': request.POST.copy() + "post_data": request.POST.copy(), } return result @@ -39,89 +37,93 @@ def index(request): attributes = False paint_logout = False - if 'sso' in req['get_data']: + if "sso" in req["get_data"]: return HttpResponseRedirect(auth.login()) # If AuthNRequest ID need to be stored in order to later validate it, do instead # sso_built_url = auth.login() # request.session['AuthNRequestID'] = auth.get_last_request_id() # return HttpResponseRedirect(sso_built_url) - elif 'sso2' in req['get_data']: - return_to = OneLogin_Saml2_Utils.get_self_url(req) + reverse('attrs') + elif "sso2" in req["get_data"]: + return_to = OneLogin_Saml2_Utils.get_self_url(req) + reverse("attrs") return HttpResponseRedirect(auth.login(return_to)) - elif 'slo' in req['get_data']: + elif "slo" in req["get_data"]: name_id = session_index = name_id_format = name_id_nq = name_id_spnq = None - if 'samlNameId' in request.session: - name_id = request.session['samlNameId'] - if 'samlSessionIndex' in request.session: - session_index = request.session['samlSessionIndex'] - if 'samlNameIdFormat' in request.session: - name_id_format = request.session['samlNameIdFormat'] - if 'samlNameIdNameQualifier' in request.session: - name_id_nq = request.session['samlNameIdNameQualifier'] - if 'samlNameIdSPNameQualifier' in request.session: - name_id_spnq = request.session['samlNameIdSPNameQualifier'] + if "samlNameId" in request.session: + name_id = request.session["samlNameId"] + if "samlSessionIndex" in request.session: + session_index = request.session["samlSessionIndex"] + if "samlNameIdFormat" in request.session: + name_id_format = request.session["samlNameIdFormat"] + if "samlNameIdNameQualifier" in request.session: + name_id_nq = request.session["samlNameIdNameQualifier"] + if "samlNameIdSPNameQualifier" in request.session: + name_id_spnq = request.session["samlNameIdSPNameQualifier"] return HttpResponseRedirect(auth.logout(name_id=name_id, session_index=session_index, nq=name_id_nq, name_id_format=name_id_format, spnq=name_id_spnq)) # If LogoutRequest ID need to be stored in order to later validate it, do instead # slo_built_url = auth.logout(name_id=name_id, session_index=session_index) # request.session['LogoutRequestID'] = auth.get_last_request_id() # return HttpResponseRedirect(slo_built_url) - elif 'acs' in req['get_data']: + elif "acs" in req["get_data"]: request_id = None - if 'AuthNRequestID' in request.session: - request_id = request.session['AuthNRequestID'] + if "AuthNRequestID" in request.session: + request_id = request.session["AuthNRequestID"] auth.process_response(request_id=request_id) errors = auth.get_errors() not_auth_warn = not auth.is_authenticated() if not errors: - if 'AuthNRequestID' in request.session: - del request.session['AuthNRequestID'] - request.session['samlUserdata'] = auth.get_attributes() - request.session['samlNameId'] = auth.get_nameid() - request.session['samlNameIdFormat'] = auth.get_nameid_format() - request.session['samlNameIdNameQualifier'] = auth.get_nameid_nq() - request.session['samlNameIdSPNameQualifier'] = auth.get_nameid_spnq() - request.session['samlSessionIndex'] = auth.get_session_index() - if 'RelayState' in req['post_data'] and OneLogin_Saml2_Utils.get_self_url(req) != req['post_data']['RelayState']: - return HttpResponseRedirect(auth.redirect_to(req['post_data']['RelayState'])) - else: - if auth.get_settings().is_debug_active(): - error_reason = auth.get_last_error_reason() - elif 'sls' in req['get_data']: + if "AuthNRequestID" in request.session: + del request.session["AuthNRequestID"] + request.session["samlUserdata"] = auth.get_attributes() + request.session["samlNameId"] = auth.get_nameid() + request.session["samlNameIdFormat"] = auth.get_nameid_format() + request.session["samlNameIdNameQualifier"] = auth.get_nameid_nq() + request.session["samlNameIdSPNameQualifier"] = auth.get_nameid_spnq() + request.session["samlSessionIndex"] = auth.get_session_index() + if "RelayState" in req["post_data"] and OneLogin_Saml2_Utils.get_self_url(req) != req["post_data"]["RelayState"]: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the req['post_data']['RelayState'] is a trusted URL. + return HttpResponseRedirect(auth.redirect_to(req["post_data"]["RelayState"])) + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() + elif "sls" in req["get_data"]: request_id = None - if 'LogoutRequestID' in request.session: - request_id = request.session['LogoutRequestID'] + if "LogoutRequestID" in request.session: + request_id = request.session["LogoutRequestID"] dscb = lambda: request.session.flush() url = auth.process_slo(request_id=request_id, delete_session_cb=dscb) errors = auth.get_errors() if len(errors) == 0: if url is not None: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the url is a trusted URL return HttpResponseRedirect(url) else: success_slo = True + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() - if 'samlUserdata' in request.session: + if "samlUserdata" in request.session: paint_logout = True - if len(request.session['samlUserdata']) > 0: - attributes = request.session['samlUserdata'].items() + if len(request.session["samlUserdata"]) > 0: + attributes = request.session["samlUserdata"].items() - return render(request, 'index.html', {'errors': errors, 'error_reason': error_reason, 'not_auth_warn': not_auth_warn, 'success_slo': success_slo, - 'attributes': attributes, 'paint_logout': paint_logout}) + return render( + request, "index.html", {"errors": errors, "error_reason": error_reason, "not_auth_warn": not_auth_warn, "success_slo": success_slo, "attributes": attributes, "paint_logout": paint_logout} + ) def attrs(request): paint_logout = False attributes = False - if 'samlUserdata' in request.session: + if "samlUserdata" in request.session: paint_logout = True - if len(request.session['samlUserdata']) > 0: - attributes = request.session['samlUserdata'].items() - return render(request, 'attrs.html', - {'paint_logout': paint_logout, - 'attributes': attributes}) + if len(request.session["samlUserdata"]) > 0: + attributes = request.session["samlUserdata"].items() + return render(request, "attrs.html", {"paint_logout": paint_logout, "attributes": attributes}) def metadata(request): @@ -133,7 +135,7 @@ def metadata(request): errors = saml_settings.validate_metadata(metadata) if len(errors) == 0: - resp = HttpResponse(content=metadata, content_type='text/xml') + resp = HttpResponse(content=metadata, content_type="text/xml") else: - resp = HttpResponseServerError(content=', '.join(errors)) + resp = HttpResponseServerError(content=", ".join(errors)) return resp diff --git a/demo-django/demo/wsgi.py b/demo-django/demo/wsgi.py index b1c7db13..49617a60 100644 --- a/demo-django/demo/wsgi.py +++ b/demo-django/demo/wsgi.py @@ -8,7 +8,9 @@ """ import os + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings") from django.core.wsgi import get_wsgi_application # noqa: E402 + application = get_wsgi_application() diff --git a/demo-django/requirements.txt b/demo-django/requirements.txt index 1aa1df39..c4d84d80 100644 --- a/demo-django/requirements.txt +++ b/demo-django/requirements.txt @@ -1,2 +1,2 @@ -Django==1.11 +Django==4.1.13 python3-saml diff --git a/demo-django/saml/advanced_settings.json b/demo-django/saml/advanced_settings.json index 3115e17e..3960911a 100644 --- a/demo-django/saml/advanced_settings.json +++ b/demo-django/saml/advanced_settings.json @@ -10,8 +10,10 @@ "wantNameId" : true, "wantNameIdEncrypted": false, "wantAssertionsEncrypted": false, - "signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", - "digestAlgorithm": "http://www.w3.org/2000/09/xmldsig#sha1" + "allowSingleLabelDomains": false, + "signatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", + "digestAlgorithm": "http://www.w3.org/2001/04/xmlenc#sha256", + "rejectDeprecatedAlgorithm": true }, "contactPerson": { "technical": { diff --git a/demo-django/saml/certs/README b/demo-django/saml/certs/README index 7e837fb9..ed973e05 100644 --- a/demo-django/saml/certs/README +++ b/demo-django/saml/certs/README @@ -1,6 +1,6 @@ Take care of this folder that could contain private key. Be sure that this folder never is published. -Onelogin Python Toolkit expects that certs for the SP could be stored in this folder as: +SAML Python Toolkit expects that certs for the SP could be stored in this folder as: * sp.key Private Key * sp.crt Public cert diff --git a/demo-django/templates/base.html b/demo-django/templates/base.html index a55dbf0b..960ca0bc 100644 --- a/demo-django/templates/base.html +++ b/demo-django/templates/base.html @@ -5,7 +5,7 @@ - A Python SAML Toolkit by OneLogin demo + A Python SAML Toolkit demo @@ -18,7 +18,7 @@
-

A Python SAML Toolkit by OneLogin demo

+

A Python SAML Toolkit demo

{% block content %}{% endblock %}
diff --git a/demo-flask/index.py b/demo-flask/index.py index b344da4c..a03eeccd 100644 --- a/demo-flask/index.py +++ b/demo-flask/index.py @@ -1,134 +1,131 @@ import os -from flask import (Flask, request, render_template, redirect, session, - make_response) - -from urllib.parse import urlparse +from flask import Flask, request, render_template, redirect, session, make_response from onelogin.saml2.auth import OneLogin_Saml2_Auth from onelogin.saml2.utils import OneLogin_Saml2_Utils app = Flask(__name__) -app.config['SECRET_KEY'] = 'onelogindemopytoolkit' -app.config['SAML_PATH'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'saml') +app.config["SECRET_KEY"] = "onelogindemopytoolkit" +app.config["SAML_PATH"] = os.path.join(os.path.dirname(os.path.abspath(__file__)), "saml") def init_saml_auth(req): - auth = OneLogin_Saml2_Auth(req, custom_base_path=app.config['SAML_PATH']) + auth = OneLogin_Saml2_Auth(req, custom_base_path=app.config["SAML_PATH"]) return auth def prepare_flask_request(request): # If server is behind proxys or balancers use the HTTP_X_FORWARDED fields - url_data = urlparse(request.url) return { - 'https': 'on' if request.scheme == 'https' else 'off', - 'http_host': request.host, - 'server_port': url_data.port, - 'script_name': request.path, - 'get_data': request.args.copy(), + "https": "on" if request.scheme == "https" else "off", + "http_host": request.host, + "script_name": request.path, + "get_data": request.args.copy(), # Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144 # 'lowercase_urlencoding': True, - 'post_data': request.form.copy() + "post_data": request.form.copy(), } -@app.route('/', methods=['GET', 'POST']) +@app.route("/", methods=["GET", "POST"]) def index(): req = prepare_flask_request(request) auth = init_saml_auth(req) errors = [] + error_reason = None not_auth_warn = False success_slo = False attributes = False paint_logout = False - if 'sso' in request.args: + if "sso" in request.args: return redirect(auth.login()) # If AuthNRequest ID need to be stored in order to later validate it, do instead # sso_built_url = auth.login() # request.session['AuthNRequestID'] = auth.get_last_request_id() # return redirect(sso_built_url) - elif 'sso2' in request.args: - return_to = '%sattrs/' % request.host_url + elif "sso2" in request.args: + return_to = "%sattrs/" % request.host_url return redirect(auth.login(return_to)) - elif 'slo' in request.args: + elif "slo" in request.args: name_id = session_index = name_id_format = name_id_nq = name_id_spnq = None - if 'samlNameId' in session: - name_id = session['samlNameId'] - if 'samlSessionIndex' in session: - session_index = session['samlSessionIndex'] - if 'samlNameIdFormat' in session: - name_id_format = session['samlNameIdFormat'] - if 'samlNameIdNameQualifier' in session: - name_id_nq = session['samlNameIdNameQualifier'] - if 'samlNameIdSPNameQualifier' in session: - name_id_spnq = session['samlNameIdSPNameQualifier'] + if "samlNameId" in session: + name_id = session["samlNameId"] + if "samlSessionIndex" in session: + session_index = session["samlSessionIndex"] + if "samlNameIdFormat" in session: + name_id_format = session["samlNameIdFormat"] + if "samlNameIdNameQualifier" in session: + name_id_nq = session["samlNameIdNameQualifier"] + if "samlNameIdSPNameQualifier" in session: + name_id_spnq = session["samlNameIdSPNameQualifier"] return redirect(auth.logout(name_id=name_id, session_index=session_index, nq=name_id_nq, name_id_format=name_id_format, spnq=name_id_spnq)) - elif 'acs' in request.args: + elif "acs" in request.args: request_id = None - if 'AuthNRequestID' in session: - request_id = session['AuthNRequestID'] + if "AuthNRequestID" in session: + request_id = session["AuthNRequestID"] auth.process_response(request_id=request_id) errors = auth.get_errors() not_auth_warn = not auth.is_authenticated() if len(errors) == 0: - if 'AuthNRequestID' in session: - del session['AuthNRequestID'] - session['samlNameId'] = auth.get_nameid() - session['samlNameIdFormat'] = auth.get_nameid_format() - session['samlNameIdNameQualifier'] = auth.get_nameid_nq() - session['samlNameIdSPNameQualifier'] = auth.get_nameid_spnq() - session['samlSessionIndex'] = auth.get_session_index() + if "AuthNRequestID" in session: + del session["AuthNRequestID"] + session["samlUserdata"] = auth.get_attributes() + session["samlNameId"] = auth.get_nameid() + session["samlNameIdFormat"] = auth.get_nameid_format() + session["samlNameIdNameQualifier"] = auth.get_nameid_nq() + session["samlNameIdSPNameQualifier"] = auth.get_nameid_spnq() + session["samlSessionIndex"] = auth.get_session_index() self_url = OneLogin_Saml2_Utils.get_self_url(req) - if 'RelayState' in request.form and self_url != request.form['RelayState']: - return redirect(auth.redirect_to(request.form['RelayState'])) - elif 'sls' in request.args: + if "RelayState" in request.form and self_url != request.form["RelayState"]: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the request.form['RelayState'] is a trusted URL. + return redirect(auth.redirect_to(request.form["RelayState"])) + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() + elif "sls" in request.args: request_id = None - if 'LogoutRequestID' in session: - request_id = session['LogoutRequestID'] + if "LogoutRequestID" in session: + request_id = session["LogoutRequestID"] dscb = lambda: session.clear() url = auth.process_slo(request_id=request_id, delete_session_cb=dscb) errors = auth.get_errors() if len(errors) == 0: if url is not None: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the url is a trusted URL. return redirect(url) else: success_slo = True + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() - if 'samlUserdata' in session: + if "samlUserdata" in session: paint_logout = True - if len(session['samlUserdata']) > 0: - attributes = session['samlUserdata'].items() + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() - return render_template( - 'index.html', - errors=errors, - not_auth_warn=not_auth_warn, - success_slo=success_slo, - attributes=attributes, - paint_logout=paint_logout - ) + return render_template("index.html", errors=errors, error_reason=error_reason, not_auth_warn=not_auth_warn, success_slo=success_slo, attributes=attributes, paint_logout=paint_logout) -@app.route('/attrs/') +@app.route("/attrs/") def attrs(): paint_logout = False attributes = False - if 'samlUserdata' in session: + if "samlUserdata" in session: paint_logout = True - if len(session['samlUserdata']) > 0: - attributes = session['samlUserdata'].items() + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() - return render_template('attrs.html', paint_logout=paint_logout, - attributes=attributes) + return render_template("attrs.html", paint_logout=paint_logout, attributes=attributes) -@app.route('/metadata/') +@app.route("/metadata/") def metadata(): req = prepare_flask_request(request) auth = init_saml_auth(req) @@ -138,11 +135,11 @@ def metadata(): if len(errors) == 0: resp = make_response(metadata, 200) - resp.headers['Content-Type'] = 'text/xml' + resp.headers["Content-Type"] = "text/xml" else: - resp = make_response(', '.join(errors), 500) + resp = make_response(", ".join(errors), 500) return resp if __name__ == "__main__": - app.run(host='0.0.0.0', port=8000, debug=True) + app.run(host="0.0.0.0", port=8000, debug=True) diff --git a/demo-flask/requirements.txt b/demo-flask/requirements.txt index 335836f7..d9340937 100644 --- a/demo-flask/requirements.txt +++ b/demo-flask/requirements.txt @@ -1 +1 @@ -flask==0.10.1 +flask==1.0 diff --git a/demo-flask/saml/advanced_settings.json b/demo-flask/saml/advanced_settings.json index 3115e17e..3960911a 100644 --- a/demo-flask/saml/advanced_settings.json +++ b/demo-flask/saml/advanced_settings.json @@ -10,8 +10,10 @@ "wantNameId" : true, "wantNameIdEncrypted": false, "wantAssertionsEncrypted": false, - "signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", - "digestAlgorithm": "http://www.w3.org/2000/09/xmldsig#sha1" + "allowSingleLabelDomains": false, + "signatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", + "digestAlgorithm": "http://www.w3.org/2001/04/xmlenc#sha256", + "rejectDeprecatedAlgorithm": true }, "contactPerson": { "technical": { diff --git a/demo-flask/saml/certs/README b/demo-flask/saml/certs/README index 7e837fb9..ed973e05 100644 --- a/demo-flask/saml/certs/README +++ b/demo-flask/saml/certs/README @@ -1,6 +1,6 @@ Take care of this folder that could contain private key. Be sure that this folder never is published. -Onelogin Python Toolkit expects that certs for the SP could be stored in this folder as: +SAML Python Toolkit expects that certs for the SP could be stored in this folder as: * sp.key Private Key * sp.crt Public cert diff --git a/demo-flask/templates/base.html b/demo-flask/templates/base.html index a55dbf0b..960ca0bc 100644 --- a/demo-flask/templates/base.html +++ b/demo-flask/templates/base.html @@ -5,7 +5,7 @@ - A Python SAML Toolkit by OneLogin demo + A Python SAML Toolkit demo @@ -18,7 +18,7 @@
-

A Python SAML Toolkit by OneLogin demo

+

A Python SAML Toolkit demo

{% block content %}{% endblock %}
diff --git a/demo-flask/templates/index.html b/demo-flask/templates/index.html index ad42cf5c..fd1ff051 100644 --- a/demo-flask/templates/index.html +++ b/demo-flask/templates/index.html @@ -10,6 +10,9 @@
  • {{err}}
  • {% endfor %} + {% if error_reason %} + {{error_reason}} + {% endif %} {% endif %} diff --git a/demo-tornado/README.md b/demo-tornado/README.md new file mode 100644 index 00000000..428d192c --- /dev/null +++ b/demo-tornado/README.md @@ -0,0 +1,9 @@ +# Tornado Demo # +Fully-working tornado-demo. + +### About issues ### +This is only a demo, some issues about session still remain. +Actually the session is global. + +### Production ### +Remember to disable debugging in production. diff --git a/demo-tornado/Settings.py b/demo-tornado/Settings.py new file mode 100644 index 00000000..46fb48ca --- /dev/null +++ b/demo-tornado/Settings.py @@ -0,0 +1,6 @@ +import os + +BASE_DIR = os.path.dirname(__file__) + +SAML_PATH = os.path.join(BASE_DIR, "saml") +TEMPLATE_PATH = os.path.join(BASE_DIR, "templates") diff --git a/demo-tornado/requirements.txt b/demo-tornado/requirements.txt new file mode 100644 index 00000000..0f21d3ed --- /dev/null +++ b/demo-tornado/requirements.txt @@ -0,0 +1 @@ +tornado==6.4.1 diff --git a/demo-tornado/saml/advanced_settings.json b/demo-tornado/saml/advanced_settings.json new file mode 100644 index 00000000..3960911a --- /dev/null +++ b/demo-tornado/saml/advanced_settings.json @@ -0,0 +1,35 @@ +{ + "security": { + "nameIdEncrypted": false, + "authnRequestsSigned": false, + "logoutRequestSigned": false, + "logoutResponseSigned": false, + "signMetadata": false, + "wantMessagesSigned": false, + "wantAssertionsSigned": false, + "wantNameId" : true, + "wantNameIdEncrypted": false, + "wantAssertionsEncrypted": false, + "allowSingleLabelDomains": false, + "signatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", + "digestAlgorithm": "http://www.w3.org/2001/04/xmlenc#sha256", + "rejectDeprecatedAlgorithm": true + }, + "contactPerson": { + "technical": { + "givenName": "technical_name", + "emailAddress": "technical@example.com" + }, + "support": { + "givenName": "support_name", + "emailAddress": "support@example.com" + } + }, + "organization": { + "en-US": { + "name": "sp_test", + "displayname": "SP test", + "url": "http://sp.example.com" + } + } +} \ No newline at end of file diff --git a/demo-tornado/saml/certs/README b/demo-tornado/saml/certs/README new file mode 100644 index 00000000..ed973e05 --- /dev/null +++ b/demo-tornado/saml/certs/README @@ -0,0 +1,13 @@ +Take care of this folder that could contain private key. Be sure that this folder never is published. + +SAML Python Toolkit expects that certs for the SP could be stored in this folder as: + + * sp.key Private Key + * sp.crt Public cert + * sp_new.crt Future Public cert + + +Also you can use other cert to sign the metadata of the SP using the: + + * metadata.key + * metadata.crt diff --git a/demo-tornado/saml/settings.json b/demo-tornado/saml/settings.json new file mode 100644 index 00000000..391b91c1 --- /dev/null +++ b/demo-tornado/saml/settings.json @@ -0,0 +1,30 @@ +{ + "strict": true, + "debug": true, + "sp": { + "entityId": "https:///metadata/", + "assertionConsumerService": { + "url": "https:///?acs", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" + }, + "singleLogoutService": { + "url": "https:///?sls", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + }, + "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", + "x509cert": "", + "privateKey": "" + }, + "idp": { + "entityId": "https://app.onelogin.com/saml/metadata/", + "singleSignOnService": { + "url": "https://app.onelogin.com/trust/saml2/http-post/sso/", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + }, + "singleLogoutService": { + "url": "https://app.onelogin.com/trust/saml2/http-redirect/slo/", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + }, + "x509cert": "" + } +} \ No newline at end of file diff --git a/demo-tornado/templates/attrs.html b/demo-tornado/templates/attrs.html new file mode 100644 index 00000000..e2429739 --- /dev/null +++ b/demo-tornado/templates/attrs.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block content %} + +{% if paint_logout %} + {% if attributes %} +

    You have the following attributes:

    + + + + + + {% for attr, i in attributes %} + {% if i == 0 %} + + + {% end %} + +
    NameValues
    {{ attr }}
      + {% end %} + {% if i == 1 %} + {% for val in attr %} +
    • {{ val }}
    • + {% end %} + {% end %} +
    + {% else %} + + {% end %} + Logout +{% else %} + Login and access again to this page +{% end %} + +{% end %} diff --git a/demo-tornado/templates/base.html b/demo-tornado/templates/base.html new file mode 100644 index 00000000..e71bb136 --- /dev/null +++ b/demo-tornado/templates/base.html @@ -0,0 +1,26 @@ + + + + + + + + A Python SAML Toolkit demo + + + + + + + + +
    +

    A Python SAML Toolkit demo

    + + {% block content %}{% end %} +
    + + diff --git a/demo-tornado/templates/index.html b/demo-tornado/templates/index.html new file mode 100644 index 00000000..f8dfac0a --- /dev/null +++ b/demo-tornado/templates/index.html @@ -0,0 +1,69 @@ +{% extends "base.html" %} + +{% block content %} + +{% if errors %} + +{% end %} + +{% if not_auth_warn %} + +{% end %} + +{% if success_slo %} + +{% end %} + +{% if paint_logout %} + {% if attributes %} + + + + + + {% for attr in attributes %} + + + + + {% end %} + + + + +
    NameValues
    {{ attr[0] }}
      + + {% for elem in attr[1] %} +
    • {{ elem }}
    • + {% end %} +
    + {% else %} + + {% end %} + Logout +{% else %} + Login Login and access to attrs page +{% end %} + +{% end %} diff --git a/demo-tornado/views.py b/demo-tornado/views.py new file mode 100644 index 00000000..677cf3a8 --- /dev/null +++ b/demo-tornado/views.py @@ -0,0 +1,170 @@ +import tornado.ioloop +import tornado.web +import Settings +import tornado.httpserver +import tornado.httputil + +from onelogin.saml2.auth import OneLogin_Saml2_Auth +from onelogin.saml2.utils import OneLogin_Saml2_Utils + +# Global session info +session = {} + + +class Application(tornado.web.Application): + def __init__(self): + handlers = [ + (r"/", IndexHandler), + (r"/attrs", AttrsHandler), + (r"/metadata", MetadataHandler), + ] + settings = {"template_path": Settings.TEMPLATE_PATH, "saml_path": Settings.SAML_PATH, "autoreload": True, "debug": True} + tornado.web.Application.__init__(self, handlers, **settings) + + +class IndexHandler(tornado.web.RequestHandler): + def post(self): + req = prepare_tornado_request(self.request) + auth = init_saml_auth(req) + error_reason = None + attributes = False + paint_logout = False + success_slo = False + + auth.process_response() + errors = auth.get_errors() + not_auth_warn = not auth.is_authenticated() + + if len(errors) == 0: + session["samlUserdata"] = auth.get_attributes() + session["samlNameId"] = auth.get_nameid() + session["samlSessionIndex"] = auth.get_session_index() + self_url = OneLogin_Saml2_Utils.get_self_url(req) + if "RelayState" in self.request.arguments and self_url != self.request.arguments["RelayState"][0].decode("utf-8"): + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the self.request.arguments['RelayState'][0] is a trusted URL. + return self.redirect(self.request.arguments["RelayState"][0].decode("utf-8")) + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() + + if "samlUserdata" in session: + paint_logout = True + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() + + self.render("index.html", errors=errors, error_reason=error_reason, not_auth_warn=not_auth_warn, success_slo=success_slo, attributes=attributes, paint_logout=paint_logout) + + def get(self): + req = prepare_tornado_request(self.request) + auth = init_saml_auth(req) + error_reason = None + errors = [] + not_auth_warn = False + success_slo = False + attributes = False + paint_logout = False + + if "sso" in req["get_data"]: + print("-sso-") + return self.redirect(auth.login()) + elif "sso2" in req["get_data"]: + print("-sso2-") + return_to = "%s/attrs" % self.request.host + return self.redirect(auth.login(return_to)) + elif "slo" in req["get_data"]: + print("-slo-") + name_id = None + session_index = None + if "samlNameId" in session: + name_id = session["samlNameId"] + if "samlSessionIndex" in session: + session_index = session["samlSessionIndex"] + return self.redirect(auth.logout(name_id=name_id, session_index=session_index)) + elif "acs" in req["get_data"]: + print("-acs-") + auth.process_response() + errors = auth.get_errors() + not_auth_warn = not auth.is_authenticated() + if len(errors) == 0: + session["samlUserdata"] = auth.get_attributes() + session["samlNameId"] = auth.get_nameid() + session["samlSessionIndex"] = auth.get_session_index() + self_url = OneLogin_Saml2_Utils.get_self_url(req) + if "RelayState" in self.request.arguments and self_url != self.request.arguments["RelayState"][0].decode("utf-8"): + return self.redirect(auth.redirect_to(self.request.arguments["RelayState"][0].decode("utf-8"))) + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() + elif "sls" in req["get_data"]: + print("-sls-") + dscb = lambda: session.clear() # clear out the session + url = auth.process_slo(delete_session_cb=dscb) + errors = auth.get_errors() + if len(errors) == 0: + if url is not None: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the url is a trusted URL. + return self.redirect(url) + else: + success_slo = True + elif auth.get_settings().is_debug_active(): + error_reason = auth.get_last_error_reason() + if "samlUserdata" in session: + print("-samlUserdata-") + paint_logout = True + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() + print("ATTRIBUTES", attributes) + self.render("index.html", errors=errors, error_reason=error_reason, not_auth_warn=not_auth_warn, success_slo=success_slo, attributes=attributes, paint_logout=paint_logout) + + +class AttrsHandler(tornado.web.RequestHandler): + def get(self): + paint_logout = False + attributes = False + + if "samlUserdata" in session: + paint_logout = True + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() + + self.render("attrs.html", paint_logout=paint_logout, attributes=attributes) + + +class MetadataHandler(tornado.web.RequestHandler): + def get(self): + req = prepare_tornado_request(self.request) + auth = init_saml_auth(req) + saml_settings = auth.get_settings() + metadata = saml_settings.get_sp_metadata() + errors = saml_settings.validate_metadata(metadata) + + if len(errors) == 0: + # resp = HttpResponse(content=metadata, content_type='text/xml') + self.set_header("Content-Type", "text/xml") + self.write(metadata) + else: + # resp = HttpResponseServerError(content=', '.join(errors)) + self.write(", ".join(errors)) + # return resp + + +def prepare_tornado_request(request): + + dataDict = {} + for key in request.arguments: + dataDict[key] = request.arguments[key][0].decode("utf-8") + + result = {"https": "on" if request == "https" else "off", "http_host": request.host, "script_name": request.path, "get_data": dataDict, "post_data": dataDict, "query_string": request.query} + return result + + +def init_saml_auth(req): + auth = OneLogin_Saml2_Auth(req, custom_base_path=Settings.SAML_PATH) + return auth + + +if __name__ == "__main__": + app = Application() + http_server = tornado.httpserver.HTTPServer(app) + http_server.listen(8000) + tornado.ioloop.IOLoop.instance().start() diff --git a/demo_pyramid/demo_pyramid/__init__.py b/demo_pyramid/demo_pyramid/__init__.py index 805e51d1..02abda7b 100644 --- a/demo_pyramid/demo_pyramid/__init__.py +++ b/demo_pyramid/demo_pyramid/__init__.py @@ -2,18 +2,17 @@ from pyramid.session import SignedCookieSessionFactory -session_factory = SignedCookieSessionFactory('onelogindemopytoolkit') +session_factory = SignedCookieSessionFactory("onelogindemopytoolkit") def main(global_config, **settings): - """ This function returns a Pyramid WSGI application. - """ + """This function returns a Pyramid WSGI application.""" config = Configurator(settings=settings) config.set_session_factory(session_factory) - config.include('pyramid_jinja2') - config.add_static_view('static', 'static', cache_max_age=3600) - config.add_route('index', '/') - config.add_route('attrs', '/attrs/') - config.add_route('metadata', '/metadata/') + config.include("pyramid_jinja2") + config.add_static_view("static", "static", cache_max_age=3600) + config.add_route("index", "/") + config.add_route("attrs", "/attrs/") + config.add_route("metadata", "/metadata/") config.scan() return config.make_wsgi_app() diff --git a/demo_pyramid/demo_pyramid/saml/advanced_settings.json b/demo_pyramid/demo_pyramid/saml/advanced_settings.json index 3115e17e..3960911a 100644 --- a/demo_pyramid/demo_pyramid/saml/advanced_settings.json +++ b/demo_pyramid/demo_pyramid/saml/advanced_settings.json @@ -10,8 +10,10 @@ "wantNameId" : true, "wantNameIdEncrypted": false, "wantAssertionsEncrypted": false, - "signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", - "digestAlgorithm": "http://www.w3.org/2000/09/xmldsig#sha1" + "allowSingleLabelDomains": false, + "signatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", + "digestAlgorithm": "http://www.w3.org/2001/04/xmlenc#sha256", + "rejectDeprecatedAlgorithm": true }, "contactPerson": { "technical": { diff --git a/demo_pyramid/demo_pyramid/saml/certs/README b/demo_pyramid/demo_pyramid/saml/certs/README index 7e837fb9..ed973e05 100644 --- a/demo_pyramid/demo_pyramid/saml/certs/README +++ b/demo_pyramid/demo_pyramid/saml/certs/README @@ -1,6 +1,6 @@ Take care of this folder that could contain private key. Be sure that this folder never is published. -Onelogin Python Toolkit expects that certs for the SP could be stored in this folder as: +SAML Python Toolkit expects that certs for the SP could be stored in this folder as: * sp.key Private Key * sp.crt Public cert diff --git a/demo_pyramid/demo_pyramid/tests.py b/demo_pyramid/demo_pyramid/tests.py index 58882283..f2a171cf 100644 --- a/demo_pyramid/demo_pyramid/tests.py +++ b/demo_pyramid/demo_pyramid/tests.py @@ -12,18 +12,21 @@ def tearDown(self): def test_my_view(self): from .views import my_view + request = testing.DummyRequest() info = my_view(request) - self.assertEqual(info['project'], 'demo_pyramid') + self.assertEqual(info["project"], "demo_pyramid") class FunctionalTests(unittest.TestCase): def setUp(self): from demo_pyramid import main + app = main({}) from webtest import TestApp + self.testapp = TestApp(app) def test_root(self): - res = self.testapp.get('/', status=200) - self.assertTrue(b'Pyramid' in res.body) + res = self.testapp.get("/", status=200) + self.assertTrue(b"Pyramid" in res.body) diff --git a/demo_pyramid/demo_pyramid/views.py b/demo_pyramid/demo_pyramid/views.py index 86814a99..98852671 100644 --- a/demo_pyramid/demo_pyramid/views.py +++ b/demo_pyramid/demo_pyramid/views.py @@ -1,12 +1,16 @@ import os -from pyramid.httpexceptions import (HTTPFound, HTTPInternalServerError, HTTPOk,) +from pyramid.httpexceptions import ( + HTTPFound, + HTTPInternalServerError, + HTTPOk, +) from pyramid.view import view_config from onelogin.saml2.auth import OneLogin_Saml2_Auth from onelogin.saml2.utils import OneLogin_Saml2_Utils -SAML_PATH = os.path.join(os.path.dirname(__file__), 'saml') +SAML_PATH = os.path.join(os.path.dirname(__file__), "saml") def init_saml_auth(req): @@ -15,20 +19,25 @@ def init_saml_auth(req): def prepare_pyramid_request(request): - # If server is behind proxys or balancers use the HTTP_X_FORWARDED fields + # Uncomment this portion to set the request.scheme + # based on the supplied `X-Forwarded` headers. + # Useful for running behind reverse proxies or balancers. + # + # if 'X-Forwarded-Proto' in request.headers: + # request.scheme = request.headers['X-Forwarded-Proto'] + return { - 'https': 'on' if request.scheme == 'https' else 'off', - 'http_host': request.host, - 'server_port': request.server_port, - 'script_name': request.path, - 'get_data': request.GET.copy(), + "https": "on" if request.scheme == "https" else "off", + "http_host": request.host, + "script_name": request.path, + "get_data": request.GET.copy(), # Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144 # 'lowercase_urlencoding': True, - 'post_data': request.POST.copy(), + "post_data": request.POST.copy(), } -@view_config(route_name='index', renderer='templates/index.jinja2') +@view_config(route_name="index", renderer="templates/index.jinja2") def index(request): req = prepare_pyramid_request(request) auth = init_saml_auth(req) @@ -41,77 +50,81 @@ def index(request): session = request.session - if 'sso' in request.GET: + if "sso" in request.GET: return HTTPFound(auth.login()) - elif 'sso2' in request.GET: - return_to = '%s/attrs/' % request.host_url + elif "sso2" in request.GET: + return_to = "%s/attrs/" % request.host_url return HTTPFound(auth.login(return_to)) - elif 'slo' in request.GET: + elif "slo" in request.GET: name_id = None session_index = None - if 'samlNameId' in session: - name_id = session['samlNameId'] - if 'samlSessionIndex' in session: - session_index = session['samlSessionIndex'] + if "samlNameId" in session: + name_id = session["samlNameId"] + if "samlSessionIndex" in session: + session_index = session["samlSessionIndex"] return HTTPFound(auth.logout(name_id=name_id, session_index=session_index)) - elif 'acs' in request.GET: + elif "acs" in request.GET: auth.process_response() errors = auth.get_errors() not_auth_warn = not auth.is_authenticated() if len(errors) == 0: - session['samlUserdata'] = auth.get_attributes() - session['samlNameId'] = auth.get_nameid() - session['samlSessionIndex'] = auth.get_session_index() + session["samlUserdata"] = auth.get_attributes() + session["samlNameId"] = auth.get_nameid() + session["samlSessionIndex"] = auth.get_session_index() self_url = OneLogin_Saml2_Utils.get_self_url(req) - if 'RelayState' in request.POST and self_url != request.POST['RelayState']: - return HTTPFound(auth.redirect_to(request.POST['RelayState'])) + if "RelayState" in request.POST and self_url != request.POST["RelayState"]: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the request.POST['RelayState'] is a trusted URL. + return HTTPFound(auth.redirect_to(request.POST["RelayState"])) else: error_reason = auth.get_last_error_reason() - elif 'sls' in request.GET: + elif "sls" in request.GET: dscb = lambda: session.clear() url = auth.process_slo(delete_session_cb=dscb) errors = auth.get_errors() if len(errors) == 0: if url is not None: + # To avoid 'Open Redirect' attacks, before execute the redirection confirm + # the value of the url is a trusted URL. return HTTPFound(url) else: success_slo = True - if 'samlUserdata' in session: + if "samlUserdata" in session: paint_logout = True - if len(session['samlUserdata']) > 0: - attributes = session['samlUserdata'].items() + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() return { - 'errors': errors, - 'error_reason': error_reason, - 'not_auth_warn': not_auth_warn, - 'success_slo': success_slo, - 'attributes': attributes, - 'paint_logout': paint_logout, + "errors": errors, + "error_reason": error_reason, + "not_auth_warn": not_auth_warn, + "success_slo": success_slo, + "attributes": attributes, + "paint_logout": paint_logout, } -@view_config(route_name='attrs', renderer='templates/attrs.jinja2') +@view_config(route_name="attrs", renderer="templates/attrs.jinja2") def attrs(request): paint_logout = False attributes = False session = request.session - if 'samlUserdata' in session: + if "samlUserdata" in session: paint_logout = True - if len(session['samlUserdata']) > 0: - attributes = session['samlUserdata'].items() + if len(session["samlUserdata"]) > 0: + attributes = session["samlUserdata"].items() return { - 'paint_logout': paint_logout, - 'attributes': attributes, + "paint_logout": paint_logout, + "attributes": attributes, } -@view_config(route_name='metadata', renderer='html') +@view_config(route_name="metadata", renderer="html") def metadata(request): req = prepare_pyramid_request(request) auth = init_saml_auth(req) @@ -120,7 +133,7 @@ def metadata(request): errors = settings.validate_metadata(metadata) if len(errors) == 0: - resp = HTTPOk(body=metadata, headers={'Content-Type': 'text/xml'}) + resp = HTTPOk(body=metadata, headers={"Content-Type": "text/xml"}) else: - resp = HTTPInternalServerError(body=', '.join(errors)) + resp = HTTPInternalServerError(body=", ".join(errors)) return resp diff --git a/demo_pyramid/setup.py b/demo_pyramid/setup.py index 50291385..1c61bcbc 100644 --- a/demo_pyramid/setup.py +++ b/demo_pyramid/setup.py @@ -3,52 +3,52 @@ from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: +with open(os.path.join(here, "README.txt")) as f: README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: +with open(os.path.join(here, "CHANGES.txt")) as f: CHANGES = f.read() requires = [ - 'pyramid', - 'pyramid_jinja2', - 'pyramid_debugtoolbar', - 'waitress', - 'xmlsec', - 'isodate', - 'python3-saml', + "pyramid", + "pyramid_jinja2", + "pyramid_debugtoolbar", + "waitress", + "xmlsec", + "isodate", + "python3-saml", ] tests_require = [ - 'WebTest >= 1.3.1', # py3 compat - 'pytest', - 'pytest-cov', + "WebTest >= 1.3.1", # py3 compat + "pytest", + "pytest-cov", ] setup( - name='demo_pyramid', - version='0.0', - description='demo_pyramid', - long_description=README + '\n\n' + CHANGES, + name="demo_pyramid", + version="0.0", + description="demo_pyramid", + long_description=README + "\n\n" + CHANGES, classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', + "Programming Language :: Python", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', + author="", + author_email="", + url="", + keywords="web pyramid pylons", packages=find_packages(), include_package_data=True, zip_safe=False, extras_require={ - 'testing': tests_require, + "testing": tests_require, }, install_requires=requires, entry_points={ - 'paste.app_factory': [ - 'main = demo_pyramid:main', + "paste.app_factory": [ + "main = demo_pyramid:main", ], }, ) diff --git a/docs/SAML_Python3_Toolkit_Guide.pdf b/docs/SAML_Python3_Toolkit_Guide.pdf new file mode 100644 index 00000000..3425fb19 Binary files /dev/null and b/docs/SAML_Python3_Toolkit_Guide.pdf differ diff --git a/docs/saml2/.buildinfo b/docs/saml2/.buildinfo deleted file mode 100644 index 5e197dbf..00000000 --- a/docs/saml2/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e10660514f5c62e16e90878c60a15170 -tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/docs/saml2/_modules/index.html b/docs/saml2/_modules/index.html index d672e465..decb1d07 100644 --- a/docs/saml2/_modules/index.html +++ b/docs/saml2/_modules/index.html @@ -1,101 +1,116 @@ + + + + + + Overview: module code — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + +
    + - - - - - Overview: module code — OneLogin SAML Python library classes and methods - - - - - - - - - - - - +
    -
    -
    -
    -
    - + -
    -
    - - -
    -
    -
    -
    - - - +
    +
    + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/auth.html b/docs/saml2/_modules/onelogin/saml2/auth.html new file mode 100644 index 00000000..b202bed0 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/auth.html @@ -0,0 +1,865 @@ + + + + + + onelogin.saml2.auth — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.auth

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Auth class
    +
    +
    +Main class of SAML Python Toolkit.
    +
    +Initializes the SP SAML instance
    +
    +"""
    +
    +import xmlsec
    +
    +from onelogin.saml2 import compat
    +from onelogin.saml2.authn_request import OneLogin_Saml2_Authn_Request
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.logout_request import OneLogin_Saml2_Logout_Request
    +from onelogin.saml2.logout_response import OneLogin_Saml2_Logout_Response
    +from onelogin.saml2.response import OneLogin_Saml2_Response
    +from onelogin.saml2.settings import OneLogin_Saml2_Settings
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
    +from onelogin.saml2.xmlparser import tostring
    +
    +
    +
    [docs]class OneLogin_Saml2_Auth(object): + """ + + This class implements the SP SAML instance. + + Defines the methods that you can invoke in your application in + order to add SAML support (initiates SSO, initiates SLO, processes a + SAML Response, a Logout Request or a Logout Response). + """ + + authn_request_class = OneLogin_Saml2_Authn_Request + logout_request_class = OneLogin_Saml2_Logout_Request + logout_response_class = OneLogin_Saml2_Logout_Response + response_class = OneLogin_Saml2_Response + + def __init__(self, request_data, old_settings=None, custom_base_path=None): + """ + Initializes the SP SAML instance. + + :param request_data: Request Data + :type request_data: dict + + :param old_settings: Optional. SAML Toolkit Settings + :type old_settings: dict + + :param custom_base_path: Optional. Path where are stored the settings file and the cert folder + :type custom_base_path: string + """ + self._request_data = request_data + if isinstance(old_settings, OneLogin_Saml2_Settings): + self._settings = old_settings + else: + self._settings = OneLogin_Saml2_Settings(old_settings, custom_base_path) + self._attributes = dict() + self._friendlyname_attributes = dict() + self._nameid = None + self._nameid_format = None + self._nameid_nq = None + self._nameid_spnq = None + self._session_index = None + self._session_expiration = None + self._authenticated = False + self._errors = [] + self._error_reason = None + self._last_request_id = None + self._last_message_id = None + self._last_assertion_id = None + self._last_assertion_issue_instant = None + self._last_authn_contexts = [] + self._last_request = None + self._last_response = None + self._last_response_in_response_to = None + self._last_assertion_not_on_or_after = None + +
    [docs] def get_settings(self): + """ + Returns the settings info + :return: Setting info + :rtype: OneLogin_Saml2_Setting object + """ + return self._settings
    + +
    [docs] def set_strict(self, value): + """ + Set the strict mode active/disable + + :param value: + :type value: bool + """ + assert isinstance(value, bool) + self._settings.set_strict(value)
    + +
    [docs] def store_valid_response(self, response): + self._attributes = response.get_attributes() + self._friendlyname_attributes = response.get_friendlyname_attributes() + self._nameid = response.get_nameid() + self._nameid_format = response.get_nameid_format() + self._nameid_nq = response.get_nameid_nq() + self._nameid_spnq = response.get_nameid_spnq() + self._session_index = response.get_session_index() + self._session_expiration = response.get_session_not_on_or_after() + self._last_message_id = response.get_id() + self._last_assertion_id = response.get_assertion_id() + self._last_assertion_issue_instant = response.get_assertion_issue_instant() + self._last_authn_contexts = response.get_authn_contexts() + self._authenticated = True + self._last_response_in_response_to = response.get_in_response_to() + self._last_assertion_not_on_or_after = response.get_assertion_not_on_or_after()
    + +
    [docs] def process_response(self, request_id=None): + """ + Process the SAML Response sent by the IdP. + + :param request_id: Is an optional argument. Is the ID of the AuthNRequest sent by this SP to the IdP. + :type request_id: string + + :raises: OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND, when a POST with a SAMLResponse is not found + """ + self._errors = [] + self._error_reason = None + + if 'post_data' in self._request_data and 'SAMLResponse' in self._request_data['post_data']: + # AuthnResponse -- HTTP_POST Binding + response = self.response_class(self._settings, self._request_data['post_data']['SAMLResponse']) + self._last_response = response.get_xml_document() + + if response.is_valid(self._request_data, request_id): + self.store_valid_response(response) + else: + self._errors.append('invalid_response') + self._error_reason = response.get_error() + + else: + self._errors.append('invalid_binding') + raise OneLogin_Saml2_Error( + 'SAML Response not found, Only supported HTTP_POST Binding', + OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND + )
    + +
    [docs] def process_slo(self, keep_local_session=False, request_id=None, delete_session_cb=None): + """ + Process the SAML Logout Response / Logout Request sent by the IdP. + + :param keep_local_session: When false will destroy the local session, otherwise will destroy it + :type keep_local_session: bool + + :param request_id: The ID of the LogoutRequest sent by this SP to the IdP + :type request_id: string + + :returns: Redirection url + """ + self._errors = [] + self._error_reason = None + + get_data = 'get_data' in self._request_data and self._request_data['get_data'] + if get_data and 'SAMLResponse' in get_data: + logout_response = self.logout_response_class(self._settings, get_data['SAMLResponse']) + self._last_response = logout_response.get_xml() + if not self.validate_response_signature(get_data): + self._errors.append('invalid_logout_response_signature') + self._errors.append('Signature validation failed. Logout Response rejected') + elif not logout_response.is_valid(self._request_data, request_id): + self._errors.append('invalid_logout_response') + elif logout_response.get_status() != OneLogin_Saml2_Constants.STATUS_SUCCESS: + self._errors.append('logout_not_success') + else: + self._last_message_id = logout_response.id + if not keep_local_session: + OneLogin_Saml2_Utils.delete_local_session(delete_session_cb) + + elif get_data and 'SAMLRequest' in get_data: + logout_request = self.logout_request_class(self._settings, get_data['SAMLRequest']) + self._last_request = logout_request.get_xml() + if not self.validate_request_signature(get_data): + self._errors.append("invalid_logout_request_signature") + self._errors.append('Signature validation failed. Logout Request rejected') + elif not logout_request.is_valid(self._request_data): + self._errors.append('invalid_logout_request') + else: + if not keep_local_session: + OneLogin_Saml2_Utils.delete_local_session(delete_session_cb) + + in_response_to = logout_request.id + self._last_message_id = logout_request.id + response_builder = self.logout_response_class(self._settings) + response_builder.build(in_response_to) + self._last_response = response_builder.get_xml() + logout_response = response_builder.get_response() + + parameters = {'SAMLResponse': logout_response} + if 'RelayState' in self._request_data['get_data']: + parameters['RelayState'] = self._request_data['get_data']['RelayState'] + + security = self._settings.get_security_data() + if security['logoutResponseSigned']: + self.add_response_signature(parameters, security['signatureAlgorithm']) + + return self.redirect_to(self.get_slo_response_url(), parameters) + else: + self._errors.append('invalid_binding') + raise OneLogin_Saml2_Error( + 'SAML LogoutRequest/LogoutResponse not found. Only supported HTTP_REDIRECT Binding', + OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND + )
    + +
    [docs] def redirect_to(self, url=None, parameters={}): + """ + Redirects the user to the URL passed by parameter or to the URL that we defined in our SSO Request. + + :param url: The target URL to redirect the user + :type url: string + :param parameters: Extra parameters to be passed as part of the URL + :type parameters: dict + + :returns: Redirection URL + """ + if url is None and 'RelayState' in self._request_data['get_data']: + url = self._request_data['get_data']['RelayState'] + return OneLogin_Saml2_Utils.redirect(url, parameters, request_data=self._request_data)
    + +
    [docs] def is_authenticated(self): + """ + Checks if the user is authenticated or not. + + :returns: True if is authenticated, False if not + :rtype: bool + """ + return self._authenticated
    + +
    [docs] def get_attributes(self): + """ + Returns the set of SAML attributes. + + :returns: SAML attributes + :rtype: dict + """ + return self._attributes
    + +
    [docs] def get_friendlyname_attributes(self): + """ + Returns the set of SAML attributes indexed by FiendlyName. + + :returns: SAML attributes + :rtype: dict + """ + return self._friendlyname_attributes
    + +
    [docs] def get_nameid(self): + """ + Returns the nameID. + + :returns: NameID + :rtype: string|None + """ + return self._nameid
    + +
    [docs] def get_nameid_format(self): + """ + Returns the nameID Format. + + :returns: NameID Format + :rtype: string|None + """ + return self._nameid_format
    + +
    [docs] def get_nameid_nq(self): + """ + Returns the nameID NameQualifier of the Assertion. + + :returns: NameID NameQualifier + :rtype: string|None + """ + return self._nameid_nq
    + +
    [docs] def get_nameid_spnq(self): + """ + Returns the nameID SP NameQualifier of the Assertion. + + :returns: NameID SP NameQualifier + :rtype: string|None + """ + return self._nameid_spnq
    + +
    [docs] def get_session_index(self): + """ + Returns the SessionIndex from the AuthnStatement. + :returns: The SessionIndex of the assertion + :rtype: string + """ + return self._session_index
    + +
    [docs] def get_session_expiration(self): + """ + Returns the SessionNotOnOrAfter from the AuthnStatement. + :returns: The SessionNotOnOrAfter of the assertion + :rtype: unix/posix timestamp|None + """ + return self._session_expiration
    + +
    [docs] def get_last_assertion_not_on_or_after(self): + """ + The NotOnOrAfter value of the valid SubjectConfirmationData node + (if any) of the last assertion processed + """ + return self._last_assertion_not_on_or_after
    + +
    [docs] def get_errors(self): + """ + Returns a list with code errors if something went wrong + + :returns: List of errors + :rtype: list + """ + return self._errors
    + +
    [docs] def get_last_error_reason(self): + """ + Returns the reason for the last error + + :returns: Reason of the last error + :rtype: None | string + """ + return self._error_reason
    + +
    [docs] def get_attribute(self, name): + """ + Returns the requested SAML attribute. + + :param name: Name of the attribute + :type name: string + + :returns: Attribute value(s) if exists or None + :rtype: list + """ + assert isinstance(name, compat.str_type) + return self._attributes.get(name)
    + +
    [docs] def get_friendlyname_attribute(self, friendlyname): + """ + Returns the requested SAML attribute searched by FriendlyName. + + :param friendlyname: FriendlyName of the attribute + :type friendlyname: string + + :returns: Attribute value(s) if exists or None + :rtype: list + """ + assert isinstance(friendlyname, compat.str_type) + return self._friendlyname_attributes.get(friendlyname)
    + +
    [docs] def get_last_request_id(self): + """ + :returns: The ID of the last Request SAML message generated. + :rtype: string + """ + return self._last_request_id
    + +
    [docs] def get_last_message_id(self): + """ + :returns: The ID of the last Response SAML message processed. + :rtype: string + """ + return self._last_message_id
    + +
    [docs] def get_last_assertion_id(self): + """ + :returns: The ID of the last assertion processed. + :rtype: string + """ + return self._last_assertion_id
    + +
    [docs] def get_last_assertion_issue_instant(self): + """ + :returns: The IssueInstant of the last assertion processed. + :rtype: unix/posix timestamp|None + """ + return self._last_assertion_issue_instant
    + +
    [docs] def get_last_authn_contexts(self): + """ + :returns: The list of authentication contexts sent in the last SAML Response. + :rtype: list + """ + return self._last_authn_contexts
    + +
    [docs] def get_last_response_in_response_to(self): + """ + :returns: InResponseTo attribute of the last Response SAML processed or None if it is not present. + :rtype: string + """ + return self._last_response_in_response_to
    + +
    [docs] def login(self, return_to=None, force_authn=False, is_passive=False, set_nameid_policy=True, name_id_value_req=None): + """ + Initiates the SSO process. + + :param return_to: Optional argument. The target URL the user should be redirected to after login. + :type return_to: string + + :param force_authn: Optional argument. When true the AuthNRequest will set the ForceAuthn='true'. + :type force_authn: bool + + :param is_passive: Optional argument. When true the AuthNRequest will set the Ispassive='true'. + :type is_passive: bool + + :param set_nameid_policy: Optional argument. When true the AuthNRequest will set a nameIdPolicy element. + :type set_nameid_policy: bool + + :param name_id_value_req: Optional argument. Indicates to the IdP the subject that should be authenticated + :type name_id_value_req: string + + :returns: Redirection URL + :rtype: string + """ + authn_request = self.authn_request_class(self._settings, force_authn, is_passive, set_nameid_policy, name_id_value_req) + self._last_request = authn_request.get_xml() + self._last_request_id = authn_request.get_id() + + saml_request = authn_request.get_request() + parameters = {'SAMLRequest': saml_request} + + if return_to is not None: + parameters['RelayState'] = return_to + else: + parameters['RelayState'] = OneLogin_Saml2_Utils.get_self_url_no_query(self._request_data) + + security = self._settings.get_security_data() + if security.get('authnRequestsSigned', False): + self.add_request_signature(parameters, security['signatureAlgorithm']) + return self.redirect_to(self.get_sso_url(), parameters)
    + +
    [docs] def logout(self, return_to=None, name_id=None, session_index=None, nq=None, name_id_format=None, spnq=None): + """ + Initiates the SLO process. + + :param return_to: Optional argument. The target URL the user should be redirected to after logout. + :type return_to: string + + :param name_id: The NameID that will be set in the LogoutRequest. + :type name_id: string + + :param session_index: SessionIndex that identifies the session of the user. + :type session_index: string + + :param nq: IDP Name Qualifier + :type: string + + :param name_id_format: The NameID Format that will be set in the LogoutRequest. + :type: string + + :param spnq: SP Name Qualifier + :type: string + + :returns: Redirection URL + """ + slo_url = self.get_slo_url() + if slo_url is None: + raise OneLogin_Saml2_Error( + 'The IdP does not support Single Log Out', + OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED + ) + + if name_id is None and self._nameid is not None: + name_id = self._nameid + + if name_id_format is None and self._nameid_format is not None: + name_id_format = self._nameid_format + + logout_request = self.logout_request_class( + self._settings, + name_id=name_id, + session_index=session_index, + nq=nq, + name_id_format=name_id_format, + spnq=spnq + ) + self._last_request = logout_request.get_xml() + self._last_request_id = logout_request.id + + parameters = {'SAMLRequest': logout_request.get_request()} + if return_to is not None: + parameters['RelayState'] = return_to + else: + parameters['RelayState'] = OneLogin_Saml2_Utils.get_self_url_no_query(self._request_data) + + security = self._settings.get_security_data() + if security.get('logoutRequestSigned', False): + self.add_request_signature(parameters, security['signatureAlgorithm']) + return self.redirect_to(slo_url, parameters)
    + +
    [docs] def get_sso_url(self): + """ + Gets the SSO URL. + + :returns: An URL, the SSO endpoint of the IdP + :rtype: string + """ + return self._settings.get_idp_sso_url()
    + +
    [docs] def get_slo_url(self): + """ + Gets the SLO URL. + + :returns: An URL, the SLO endpoint of the IdP + :rtype: string + """ + return self._settings.get_idp_slo_url()
    + +
    [docs] def get_slo_response_url(self): + """ + Gets the SLO return URL for IdP-initiated logout. + + :returns: an URL, the SLO return endpoint of the IdP + :rtype: string + """ + return self._settings.get_idp_slo_response_url()
    + +
    [docs] def add_request_signature(self, request_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256): + """ + Builds the Signature of the SAML Request. + + :param request_data: The Request parameters + :type request_data: dict + + :param sign_algorithm: Signature algorithm method + :type sign_algorithm: string + """ + return self._build_signature(request_data, 'SAMLRequest', sign_algorithm)
    + +
    [docs] def add_response_signature(self, response_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256): + """ + Builds the Signature of the SAML Response. + :param response_data: The Response parameters + :type response_data: dict + + :param sign_algorithm: Signature algorithm method + :type sign_algorithm: string + """ + return self._build_signature(response_data, 'SAMLResponse', sign_algorithm)
    + + @staticmethod + def _build_sign_query_from_qs(query_string, saml_type): + """ + Build sign query from query string + + :param query_string: The query string + :type query_string: str + + :param saml_type: The target URL the user should be redirected to + :type saml_type: string SAMLRequest | SAMLResponse + """ + args = ('%s=' % saml_type, 'RelayState=', 'SigAlg=') + parts = query_string.split('&') + # Join in the order of arguments rather than the original order of parts. + return '&'.join(part for arg in args for part in parts if part.startswith(arg)) + + @staticmethod + def _build_sign_query(saml_data, relay_state, algorithm, saml_type, lowercase_urlencoding=False): + """ + Build sign query + + :param saml_data: The Request data + :type saml_data: str + + :param relay_state: The Relay State + :type relay_state: str + + :param algorithm: The Signature Algorithm + :type algorithm: str + + :param saml_type: The target URL the user should be redirected to + :type saml_type: string SAMLRequest | SAMLResponse + + :param lowercase_urlencoding: lowercase or no + :type lowercase_urlencoding: boolean + """ + sign_data = ['%s=%s' % (saml_type, OneLogin_Saml2_Utils.escape_url(saml_data, lowercase_urlencoding))] + if relay_state is not None: + sign_data.append('RelayState=%s' % OneLogin_Saml2_Utils.escape_url(relay_state, lowercase_urlencoding)) + sign_data.append('SigAlg=%s' % OneLogin_Saml2_Utils.escape_url(algorithm, lowercase_urlencoding)) + return '&'.join(sign_data) + + def _build_signature(self, data, saml_type, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256): + """ + Builds the Signature + :param data: The Request data + :type data: dict + + :param saml_type: The target URL the user should be redirected to + :type saml_type: string SAMLRequest | SAMLResponse + + :param sign_algorithm: Signature algorithm method + :type sign_algorithm: string + """ + assert saml_type in ('SAMLRequest', 'SAMLResponse') + key = self.get_settings().get_sp_key() + + if not key: + raise OneLogin_Saml2_Error( + "Trying to sign the %s but can't load the SP private key." % saml_type, + OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND + ) + + msg = self._build_sign_query(data[saml_type], + data.get('RelayState', None), + sign_algorithm, + saml_type) + + sign_algorithm_transform_map = { + OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.Transform.DSA_SHA1, + OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1, + OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256, + OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384, + OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512 + } + sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA256) + + signature = OneLogin_Saml2_Utils.sign_binary(msg, key, sign_algorithm_transform, self._settings.is_debug_active()) + data['Signature'] = OneLogin_Saml2_Utils.b64encode(signature) + data['SigAlg'] = sign_algorithm + +
    [docs] def validate_request_signature(self, request_data): + """ + Validate Request Signature + + :param request_data: The Request data + :type request_data: dict + + """ + + return self._validate_signature(request_data, 'SAMLRequest')
    + +
    [docs] def validate_response_signature(self, request_data): + """ + Validate Response Signature + + :param request_data: The Request data + :type request_data: dict + + """ + + return self._validate_signature(request_data, 'SAMLResponse')
    + + def _validate_signature(self, data, saml_type, raise_exceptions=False): + """ + Validate Signature + + :param data: The Request data + :type data: dict + + :param cert: The certificate to check signature + :type cert: str + + :param saml_type: The target URL the user should be redirected to + :type saml_type: string SAMLRequest | SAMLResponse + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + """ + try: + signature = data.get('Signature', None) + if signature is None: + if self._settings.is_strict() and self._settings.get_security_data().get('wantMessagesSigned', False): + raise OneLogin_Saml2_ValidationError( + 'The %s is not signed. Rejected.' % saml_type, + OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE + ) + return True + + idp_data = self.get_settings().get_idp_data() + + exists_x509cert = self.get_settings().get_idp_cert() is not None + exists_multix509sign = 'x509certMulti' in idp_data and \ + 'signing' in idp_data['x509certMulti'] and \ + idp_data['x509certMulti']['signing'] + + if not (exists_x509cert or exists_multix509sign): + error_msg = 'In order to validate the sign on the %s, the x509cert of the IdP is required' % saml_type + self._errors.append(error_msg) + raise OneLogin_Saml2_Error( + error_msg, + OneLogin_Saml2_Error.CERT_NOT_FOUND + ) + + sign_alg = data.get('SigAlg', OneLogin_Saml2_Constants.RSA_SHA1) + if isinstance(sign_alg, bytes): + sign_alg = sign_alg.decode('utf8') + + security = self._settings.get_security_data() + reject_deprecated_alg = security.get('rejectDeprecatedAlgorithm', False) + if reject_deprecated_alg: + if sign_alg in OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS: + raise OneLogin_Saml2_ValidationError( + 'Deprecated signature algorithm found: %s' % sign_alg, + OneLogin_Saml2_ValidationError.DEPRECATED_SIGNATURE_METHOD + ) + + query_string = self._request_data.get('query_string') + if query_string and self._request_data.get('validate_signature_from_qs'): + signed_query = self._build_sign_query_from_qs(query_string, saml_type) + else: + lowercase_urlencoding = self._request_data.get('lowercase_urlencoding', False) + signed_query = self._build_sign_query(data[saml_type], + data.get('RelayState'), + sign_alg, + saml_type, + lowercase_urlencoding) + + if exists_multix509sign: + for cert in idp_data['x509certMulti']['signing']: + if OneLogin_Saml2_Utils.validate_binary_sign(signed_query, + OneLogin_Saml2_Utils.b64decode(signature), + cert, + sign_alg): + return True + raise OneLogin_Saml2_ValidationError( + 'Signature validation failed. %s rejected' % saml_type, + OneLogin_Saml2_ValidationError.INVALID_SIGNATURE + ) + else: + cert = self.get_settings().get_idp_cert() + + if not OneLogin_Saml2_Utils.validate_binary_sign(signed_query, + OneLogin_Saml2_Utils.b64decode(signature), + cert, + sign_alg, + self._settings.is_debug_active()): + raise OneLogin_Saml2_ValidationError( + 'Signature validation failed. %s rejected' % saml_type, + OneLogin_Saml2_ValidationError.INVALID_SIGNATURE + ) + return True + except Exception as e: + self._error_reason = str(e) + if raise_exceptions: + raise e + return False + +
    [docs] def get_last_response_xml(self, pretty_print_if_possible=False): + """ + Retrieves the raw XML (decrypted) of the last SAML response, + or the last Logout Response generated or processed + :returns: SAML response XML + :rtype: string|None + """ + response = None + if self._last_response is not None: + if isinstance(self._last_response, compat.str_type): + response = self._last_response + else: + response = tostring(self._last_response, encoding='unicode', pretty_print=pretty_print_if_possible) + return response
    + +
    [docs] def get_last_request_xml(self): + """ + Retrieves the raw XML sent in the last SAML request + :returns: SAML request XML + :rtype: string|None + """ + return self._last_request or None
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/authn_request.html b/docs/saml2/_modules/onelogin/saml2/authn_request.html new file mode 100644 index 00000000..b72bd675 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/authn_request.html @@ -0,0 +1,265 @@ + + + + + + onelogin.saml2.authn_request — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.authn_request

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Authn_Request class
    +
    +
    +AuthNRequest class of SAML Python Toolkit.
    +
    +"""
    +
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils
    +from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
    +
    +
    +
    [docs]class OneLogin_Saml2_Authn_Request(object): + """ + + This class handles an AuthNRequest. It builds an + AuthNRequest object. + + """ + + def __init__(self, settings, force_authn=False, is_passive=False, set_nameid_policy=True, name_id_value_req=None): + """ + Constructs the AuthnRequest object. + + :param settings: OSetting data + :type settings: OneLogin_Saml2_Settings + + :param force_authn: Optional argument. When true the AuthNRequest will set the ForceAuthn='true'. + :type force_authn: bool + + :param is_passive: Optional argument. When true the AuthNRequest will set the Ispassive='true'. + :type is_passive: bool + + :param set_nameid_policy: Optional argument. When true the AuthNRequest will set a nameIdPolicy element. + :type set_nameid_policy: bool + + :param name_id_value_req: Optional argument. Indicates to the IdP the subject that should be authenticated + :type name_id_value_req: string + """ + self._settings = settings + + sp_data = self._settings.get_sp_data() + idp_data = self._settings.get_idp_data() + security = self._settings.get_security_data() + + self._id = self._generate_request_id() + issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now()) + + destination = idp_data['singleSignOnService']['url'] + + provider_name_str = '' + organization_data = settings.get_organization() + if isinstance(organization_data, dict) and organization_data: + langs = organization_data + if 'en-US' in langs: + lang = 'en-US' + else: + lang = sorted(langs)[0] + + display_name = 'displayname' in organization_data[lang] and organization_data[lang]['displayname'] + if display_name: + provider_name_str = "\n" + ' ProviderName="%s"' % organization_data[lang]['displayname'] + + force_authn_str = '' + if force_authn is True: + force_authn_str = "\n" + ' ForceAuthn="true"' + + is_passive_str = '' + if is_passive is True: + is_passive_str = "\n" + ' IsPassive="true"' + + subject_str = '' + if name_id_value_req: + subject_str = """ + <saml:Subject> + <saml:NameID Format="%s">%s</saml:NameID> + <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"></saml:SubjectConfirmation> + </saml:Subject>""" % (sp_data['NameIDFormat'], name_id_value_req) + + nameid_policy_str = '' + if set_nameid_policy: + name_id_policy_format = sp_data['NameIDFormat'] + if security['wantNameIdEncrypted']: + name_id_policy_format = OneLogin_Saml2_Constants.NAMEID_ENCRYPTED + + nameid_policy_str = """ + <samlp:NameIDPolicy + Format="%s" + AllowCreate="true" />""" % name_id_policy_format + + requested_authn_context_str = '' + if security['requestedAuthnContext'] is not False: + authn_comparison = security['requestedAuthnContextComparison'] + + if security['requestedAuthnContext'] is True: + requested_authn_context_str = """ <samlp:RequestedAuthnContext Comparison="%s"> + <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> + </samlp:RequestedAuthnContext>""" % authn_comparison + else: + requested_authn_context_str = ' <samlp:RequestedAuthnContext Comparison="%s">' % authn_comparison + for authn_context in security['requestedAuthnContext']: + requested_authn_context_str += '<saml:AuthnContextClassRef>%s</saml:AuthnContextClassRef>' % authn_context + requested_authn_context_str += ' </samlp:RequestedAuthnContext>' + + attr_consuming_service_str = '' + if 'attributeConsumingService' in sp_data and sp_data['attributeConsumingService']: + attr_consuming_service_str = "\n AttributeConsumingServiceIndex=\"%s\"" % sp_data['attributeConsumingService'].get('index', '1') + + request = OneLogin_Saml2_Templates.AUTHN_REQUEST % \ + { + 'id': self._id, + 'provider_name': provider_name_str, + 'force_authn_str': force_authn_str, + 'is_passive_str': is_passive_str, + 'issue_instant': issue_instant, + 'destination': destination, + 'assertion_url': sp_data['assertionConsumerService']['url'], + 'entity_id': sp_data['entityId'], + 'subject_str': subject_str, + 'nameid_policy_str': nameid_policy_str, + 'requested_authn_context_str': requested_authn_context_str, + 'attr_consuming_service_str': attr_consuming_service_str, + 'acs_binding': sp_data['assertionConsumerService'].get('binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST') + } + + self._authn_request = request + + def _generate_request_id(self): + """ + Generate an unique request ID. + """ + return OneLogin_Saml2_Utils.generate_unique_id() + +
    [docs] def get_request(self, deflate=True): + """ + Returns unsigned AuthnRequest. + :param deflate: It makes the deflate process optional + :type: bool + :return: AuthnRequest maybe deflated and base64 encoded + :rtype: str object + """ + if deflate: + request = OneLogin_Saml2_Utils.deflate_and_base64_encode(self._authn_request) + else: + request = OneLogin_Saml2_Utils.b64encode(self._authn_request) + return request
    + +
    [docs] def get_id(self): + """ + Returns the AuthNRequest ID. + :return: AuthNRequest ID + :rtype: string + """ + return self._id
    + +
    [docs] def get_xml(self): + """ + Returns the XML that will be sent as part of the request + :return: XML request body + :rtype: string + """ + return self._authn_request
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/compat.html b/docs/saml2/_modules/onelogin/saml2/compat.html new file mode 100644 index 00000000..0497cf19 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/compat.html @@ -0,0 +1,166 @@ + + + + + + onelogin.saml2.compat — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.compat

    +# -*- coding: utf-8 -*-
    +
    +""" py3 compatibility class
    +
    +
    +"""
    +
    +from __future__ import absolute_import, print_function, with_statement
    +
    +try:
    +    basestring
    +except NameError:
    +    basestring = str
    +
    +try:
    +    unicode
    +except NameError:
    +    unicode = str
    +
    +
    +if isinstance(b'', type('')):  # py 2.x
    +    text_types = (basestring,)  # noqa
    +    bytes_type = bytes
    +    str_type = basestring  # noqa
    +
    +    def utf8(data):
    +        """  return utf8-encoded string """
    +        if isinstance(data, basestring):
    +            return data.decode("utf8")
    +        return unicode(data)
    +
    +    def to_string(data):
    +        """ return string """
    +        if isinstance(data, unicode):
    +            return data.encode("utf8")
    +        return str(data)
    +
    +    def to_bytes(data):
    +        """ return bytes """
    +        if isinstance(data, unicode):
    +            return data.encode("utf8")
    +        return str(data)
    +
    +else:  # py 3.x
    +    text_types = (bytes, str)
    +    bytes_type = bytes
    +    str_type = str
    +
    +
    [docs] def utf8(data): + """ return utf8-encoded string """ + if isinstance(data, bytes): + return data.decode("utf8") + return str(data)
    + +
    [docs] def to_string(data): + """convert to string""" + if isinstance(data, bytes): + return data.decode("utf8") + return str(data)
    + +
    [docs] def to_bytes(data): + """return bytes""" + if isinstance(data, str): + return data.encode("utf8") + return bytes(data)
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/constants.html b/docs/saml2/_modules/onelogin/saml2/constants.html new file mode 100644 index 00000000..299831bb --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/constants.html @@ -0,0 +1,218 @@ + + + + + + onelogin.saml2.constants — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.constants

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Constants class
    +
    +
    +Constants class of SAML Python Toolkit.
    +
    +"""
    +
    +
    +
    [docs]class OneLogin_Saml2_Constants(object): + """ + + This class defines all the constants that will be used + in the SAML Python Toolkit. + + """ + + # Value added to the current time in time condition validations + ALLOWED_CLOCK_DRIFT = 300 + + # NameID Formats + NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' + NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName' + NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName' + NAMEID_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' + NAMEID_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos' + NAMEID_ENTITY = 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity' + NAMEID_TRANSIENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' + NAMEID_PERSISTENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' + NAMEID_ENCRYPTED = 'urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted' + + # Attribute Name Formats + ATTRNAME_FORMAT_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' + ATTRNAME_FORMAT_URI = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri' + ATTRNAME_FORMAT_BASIC = 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' + + # Namespaces + NS_SAML = 'urn:oasis:names:tc:SAML:2.0:assertion' + NS_SAMLP = 'urn:oasis:names:tc:SAML:2.0:protocol' + NS_SOAP = 'http://schemas.xmlsoap.org/soap/envelope/' + NS_MD = 'urn:oasis:names:tc:SAML:2.0:metadata' + NS_XS = 'http://www.w3.org/2001/XMLSchema' + NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance' + NS_XENC = 'http://www.w3.org/2001/04/xmlenc#' + NS_DS = 'http://www.w3.org/2000/09/xmldsig#' + + # Namespace Prefixes + NS_PREFIX_SAML = 'saml' + NS_PREFIX_SAMLP = 'samlp' + NS_PREFIX_MD = 'md' + NS_PREFIX_XS = 'xs' + NS_PREFIX_XSI = 'xsi' + NS_PREFIX_XSD = 'xsd' + NS_PREFIX_XENC = 'xenc' + NS_PREFIX_DS = 'ds' + + # Prefix:Namespace Mappings + NSMAP = { + NS_PREFIX_SAMLP: NS_SAMLP, + NS_PREFIX_SAML: NS_SAML, + NS_PREFIX_DS: NS_DS, + NS_PREFIX_XENC: NS_XENC, + NS_PREFIX_MD: NS_MD + } + + # Bindings + BINDING_HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' + BINDING_HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' + BINDING_HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact' + BINDING_SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP' + BINDING_DEFLATE = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE' + + # Auth Context Class + AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified' + AC_PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password' + AC_PASSWORD_PROTECTED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' + AC_X509 = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509' + AC_SMARTCARD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard' + AC_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos' + + # Subject Confirmation + CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer' + CM_HOLDER_KEY = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key' + CM_SENDER_VOUCHES = 'urn:oasis:names:tc:SAML:2.0:cm:sender-vouches' + + # Status Codes + STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success' + STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester' + STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder' + STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch' + STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive' + STATUS_PARTIAL_LOGOUT = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout' + STATUS_PROXY_COUNT_EXCEEDED = 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded' + + # Sign & Crypto + SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1' + SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256' + SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384' + SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512' + + DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1' + RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' + RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' + RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384' + RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512' + + # Enc + TRIPLEDES_CBC = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc' + AES128_CBC = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc' + AES192_CBC = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc' + AES256_CBC = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' + RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' + RSA_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' + + # Define here the deprecated algorithms + DEPRECATED_ALGORITHMS = [DSA_SHA1, RSA_SHA1, SHA1]
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/errors.html b/docs/saml2/_modules/onelogin/saml2/errors.html new file mode 100644 index 00000000..77b1c1f7 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/errors.html @@ -0,0 +1,228 @@ + + + + + + onelogin.saml2.errors — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.errors

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Error class
    +
    +
    +Error class of SAML Python Toolkit.
    +
    +Defines common Error codes and has a custom initializator.
    +
    +"""
    +
    +
    +
    [docs]class OneLogin_Saml2_Error(Exception): + """ + + This class implements a custom Exception handler. + Defines custom error codes. + + """ + + # Errors + SETTINGS_FILE_NOT_FOUND = 0 + SETTINGS_INVALID_SYNTAX = 1 + SETTINGS_INVALID = 2 + METADATA_SP_INVALID = 3 + # SP_CERTS_NOT_FOUND is deprecated, use CERT_NOT_FOUND instead + SP_CERTS_NOT_FOUND = 4 + CERT_NOT_FOUND = 4 + REDIRECT_INVALID_URL = 5 + PUBLIC_CERT_FILE_NOT_FOUND = 6 + PRIVATE_KEY_FILE_NOT_FOUND = 7 + SAML_RESPONSE_NOT_FOUND = 8 + SAML_LOGOUTMESSAGE_NOT_FOUND = 9 + SAML_LOGOUTREQUEST_INVALID = 10 + SAML_LOGOUTRESPONSE_INVALID = 11 + SAML_SINGLE_LOGOUT_NOT_SUPPORTED = 12 + PRIVATE_KEY_NOT_FOUND = 13 + UNSUPPORTED_SETTINGS_OBJECT = 14 + + def __init__(self, message, code=0, errors=None): + """ + Initializes the Exception instance. + + Arguments are: + * (str) message. Describes the error. + * (int) code. The code error (defined in the error class). + """ + assert isinstance(code, int) + + if errors is not None: + message = message % errors + + Exception.__init__(self, message) + self.code = code
    + + +
    [docs]class OneLogin_Saml2_ValidationError(Exception): + """ + This class implements another custom Exception handler, related + to exceptions that happens during validation process. + Defines custom error codes . + """ + + # Validation Errors + UNSUPPORTED_SAML_VERSION = 0 + MISSING_ID = 1 + WRONG_NUMBER_OF_ASSERTIONS = 2 + MISSING_STATUS = 3 + MISSING_STATUS_CODE = 4 + STATUS_CODE_IS_NOT_SUCCESS = 5 + WRONG_SIGNED_ELEMENT = 6 + ID_NOT_FOUND_IN_SIGNED_ELEMENT = 7 + DUPLICATED_ID_IN_SIGNED_ELEMENTS = 8 + INVALID_SIGNED_ELEMENT = 9 + DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS = 10 + UNEXPECTED_SIGNED_ELEMENTS = 11 + WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE = 12 + WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION = 13 + INVALID_XML_FORMAT = 14 + WRONG_INRESPONSETO = 15 + NO_ENCRYPTED_ASSERTION = 16 + NO_ENCRYPTED_NAMEID = 17 + MISSING_CONDITIONS = 18 + ASSERTION_TOO_EARLY = 19 + ASSERTION_EXPIRED = 20 + WRONG_NUMBER_OF_AUTHSTATEMENTS = 21 + NO_ATTRIBUTESTATEMENT = 22 + ENCRYPTED_ATTRIBUTES = 23 + WRONG_DESTINATION = 24 + EMPTY_DESTINATION = 25 + WRONG_AUDIENCE = 26 + ISSUER_MULTIPLE_IN_RESPONSE = 27 + ISSUER_NOT_FOUND_IN_ASSERTION = 28 + WRONG_ISSUER = 29 + SESSION_EXPIRED = 30 + WRONG_SUBJECTCONFIRMATION = 31 + NO_SIGNED_MESSAGE = 32 + NO_SIGNED_ASSERTION = 33 + NO_SIGNATURE_FOUND = 34 + KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA = 35 + CHILDREN_NODE_NOT_FOUND_IN_KEYINFO = 36 + UNSUPPORTED_RETRIEVAL_METHOD = 37 + NO_NAMEID = 38 + EMPTY_NAMEID = 39 + SP_NAME_QUALIFIER_NAME_MISMATCH = 40 + DUPLICATED_ATTRIBUTE_NAME_FOUND = 41 + INVALID_SIGNATURE = 42 + WRONG_NUMBER_OF_SIGNATURES = 43 + RESPONSE_EXPIRED = 44 + AUTHN_CONTEXT_MISMATCH = 45 + DEPRECATED_SIGNATURE_METHOD = 46 + DEPRECATED_DIGEST_METHOD = 47 + + def __init__(self, message, code=0, errors=None): + """ + Initializes the Exception instance. + Arguments are: + * (str) message. Describes the error. + * (int) code. The code error (defined in the error class). + """ + assert isinstance(code, int) + + if errors is not None: + message = message % errors + + Exception.__init__(self, message) + self.code = code
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/idp_metadata_parser.html b/docs/saml2/_modules/onelogin/saml2/idp_metadata_parser.html new file mode 100644 index 00000000..a4ee1098 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/idp_metadata_parser.html @@ -0,0 +1,380 @@ + + + + + + onelogin.saml2.idp_metadata_parser — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    +
      +
    • + + +
    • +
    • +
    +
    +
    +
    +
    + +

    Source code for onelogin.saml2.idp_metadata_parser

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_IdPMetadataParser class
    +Metadata class of SAML Python Toolkit.
    +"""
    +
    +
    +from copy import deepcopy
    +
    +try:
    +    import urllib.request as urllib2
    +except ImportError:
    +    import urllib2
    +
    +import ssl
    +
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +
    +
    [docs]class OneLogin_Saml2_IdPMetadataParser(object): + """ + A class that contain methods related to obtaining and parsing metadata from IdP + + This class does not validate in any way the URL that is introduced, + make sure to validate it properly before use it in a get_metadata method. + """ + +
    [docs] @classmethod + def get_metadata(cls, url, validate_cert=True, timeout=None, headers=None): + """ + Gets the metadata XML from the provided URL + :param url: Url where the XML of the Identity Provider Metadata is published. + :type url: string + + :param validate_cert: If the url uses https schema, that flag enables or not the verification of the associated certificate. + :type validate_cert: bool + + :param timeout: Timeout in seconds to wait for metadata response + :type timeout: int + :param headers: Extra headers to send in the request + :type headers: dict + + :returns: metadata XML + :rtype: string + """ + valid = False + + request = urllib2.Request(url, headers=headers or {}) + + if validate_cert: + response = urllib2.urlopen(request, timeout=timeout) + else: + ctx = ssl.create_default_context() + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE + response = urllib2.urlopen(request, context=ctx, timeout=timeout) + xml = response.read() + + if xml: + try: + dom = OneLogin_Saml2_XML.to_etree(xml) + idp_descriptor_nodes = OneLogin_Saml2_XML.query(dom, '//md:IDPSSODescriptor') + if idp_descriptor_nodes: + valid = True + except Exception: + pass + + if not valid: + raise Exception('Not valid IdP XML found from URL: %s' % (url)) + + return xml
    + +
    [docs] @classmethod + def parse_remote(cls, url, validate_cert=True, entity_id=None, timeout=None, **kwargs): + """ + Gets the metadata XML from the provided URL and parse it, returning a dict with extracted data + :param url: Url where the XML of the Identity Provider Metadata is published. + :type url: string + + :param validate_cert: If the url uses https schema, that flag enables or not the verification of the associated certificate. + :type validate_cert: bool + + :param entity_id: Specify the entity_id of the EntityDescriptor that you want to parse a XML + that contains multiple EntityDescriptor. + :type entity_id: string + + :param timeout: Timeout in seconds to wait for metadata response + :type timeout: int + + :returns: settings dict with extracted data + :rtype: dict + """ + idp_metadata = cls.get_metadata(url, validate_cert, timeout, headers=kwargs.pop('headers', None)) + return cls.parse(idp_metadata, entity_id=entity_id, **kwargs)
    + +
    [docs] @classmethod + def parse( + cls, + idp_metadata, + required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, + required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, + entity_id=None): + """ + Parses the Identity Provider metadata and return a dict with extracted data. + + If there are multiple <IDPSSODescriptor> tags, parse only the first. + + Parses only those SSO endpoints with the same binding as given by + the `required_sso_binding` parameter. + + Parses only those SLO endpoints with the same binding as given by + the `required_slo_binding` parameter. + + If the metadata specifies multiple SSO endpoints with the required + binding, extract only the first (the same holds true for SLO + endpoints). + + :param idp_metadata: XML of the Identity Provider Metadata. + :type idp_metadata: string + + :param required_sso_binding: Parse only POST or REDIRECT SSO endpoints. + :type required_sso_binding: one of OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT + or OneLogin_Saml2_Constants.BINDING_HTTP_POST + + :param required_slo_binding: Parse only POST or REDIRECT SLO endpoints. + :type required_slo_binding: one of OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT + or OneLogin_Saml2_Constants.BINDING_HTTP_POST + + :param entity_id: Specify the entity_id of the EntityDescriptor that you want to parse a XML + that contains multiple EntityDescriptor. + :type entity_id: string + + :returns: settings dict with extracted data + :rtype: dict + """ + data = {} + + dom = OneLogin_Saml2_XML.to_etree(idp_metadata) + idp_entity_id = want_authn_requests_signed = idp_name_id_format = idp_sso_url = idp_slo_url = certs = None + + entity_desc_path = '//md:EntityDescriptor' + if entity_id: + entity_desc_path += "[@entityID='%s']" % entity_id + entity_descriptor_nodes = OneLogin_Saml2_XML.query(dom, entity_desc_path) + + if len(entity_descriptor_nodes) > 0: + entity_descriptor_node = entity_descriptor_nodes[0] + idp_descriptor_nodes = OneLogin_Saml2_XML.query(entity_descriptor_node, './md:IDPSSODescriptor') + if len(idp_descriptor_nodes) > 0: + idp_descriptor_node = idp_descriptor_nodes[0] + + idp_entity_id = entity_descriptor_node.get('entityID', None) + + want_authn_requests_signed = idp_descriptor_node.get('WantAuthnRequestsSigned', None) + + name_id_format_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, './md:NameIDFormat') + if len(name_id_format_nodes) > 0: + idp_name_id_format = OneLogin_Saml2_XML.element_text(name_id_format_nodes[0]) + + sso_nodes = OneLogin_Saml2_XML.query( + idp_descriptor_node, + "./md:SingleSignOnService[@Binding='%s']" % required_sso_binding + ) + + if len(sso_nodes) > 0: + idp_sso_url = sso_nodes[0].get('Location', None) + + slo_nodes = OneLogin_Saml2_XML.query( + idp_descriptor_node, + "./md:SingleLogoutService[@Binding='%s']" % required_slo_binding + ) + + if len(slo_nodes) > 0: + idp_slo_url = slo_nodes[0].get('Location', None) + + signing_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:KeyDescriptor[not(contains(@use, 'encryption'))]/ds:KeyInfo/ds:X509Data/ds:X509Certificate") + encryption_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:KeyDescriptor[not(contains(@use, 'signing'))]/ds:KeyInfo/ds:X509Data/ds:X509Certificate") + + if len(signing_nodes) > 0 or len(encryption_nodes) > 0: + certs = {} + if len(signing_nodes) > 0: + certs['signing'] = [] + for cert_node in signing_nodes: + certs['signing'].append(''.join(OneLogin_Saml2_XML.element_text(cert_node).split())) + if len(encryption_nodes) > 0: + certs['encryption'] = [] + for cert_node in encryption_nodes: + certs['encryption'].append(''.join(OneLogin_Saml2_XML.element_text(cert_node).split())) + + data['idp'] = {} + + if idp_entity_id is not None: + data['idp']['entityId'] = idp_entity_id + + if idp_sso_url is not None: + data['idp']['singleSignOnService'] = {} + data['idp']['singleSignOnService']['url'] = idp_sso_url + data['idp']['singleSignOnService']['binding'] = required_sso_binding + + if idp_slo_url is not None: + data['idp']['singleLogoutService'] = {} + data['idp']['singleLogoutService']['url'] = idp_slo_url + data['idp']['singleLogoutService']['binding'] = required_slo_binding + + if want_authn_requests_signed is not None: + data['security'] = {} + data['security']['authnRequestsSigned'] = want_authn_requests_signed == "true" + + if idp_name_id_format: + data['sp'] = {} + data['sp']['NameIDFormat'] = idp_name_id_format + + if certs is not None: + if (len(certs) == 1 and + (('signing' in certs and len(certs['signing']) == 1) or + ('encryption' in certs and len(certs['encryption']) == 1))) or \ + (('signing' in certs and len(certs['signing']) == 1) and + ('encryption' in certs and len(certs['encryption']) == 1 and + certs['signing'][0] == certs['encryption'][0])): + if 'signing' in certs: + data['idp']['x509cert'] = certs['signing'][0] + else: + data['idp']['x509cert'] = certs['encryption'][0] + else: + data['idp']['x509certMulti'] = certs + return data
    + +
    [docs] @staticmethod + def merge_settings(settings, new_metadata_settings): + """ + Will update the settings with the provided new settings data extracted from the IdP metadata + :param settings: Current settings dict data + :type settings: dict + :param new_metadata_settings: Settings to be merged (extracted from IdP metadata after parsing) + :type new_metadata_settings: dict + :returns: merged settings + :rtype: dict + """ + for d in (settings, new_metadata_settings): + if not isinstance(d, dict): + raise TypeError('Both arguments must be dictionaries.') + + # Guarantee to not modify original data (`settings.copy()` would not + # be sufficient, as it's just a shallow copy). + result_settings = deepcopy(settings) + + # previously I will take care of cert stuff + if 'idp' in new_metadata_settings and 'idp' in result_settings: + if new_metadata_settings['idp'].get('x509cert', None) and result_settings['idp'].get('x509certMulti', None): + del result_settings['idp']['x509certMulti'] + if new_metadata_settings['idp'].get('x509certMulti', None) and result_settings['idp'].get('x509cert', None): + del result_settings['idp']['x509cert'] + + # Merge `new_metadata_settings` into `result_settings`. + dict_deep_merge(result_settings, new_metadata_settings) + return result_settings
    + + +
    [docs]def dict_deep_merge(a, b, path=None): + """Deep-merge dictionary `b` into dictionary `a`. + + Kudos to http://stackoverflow.com/a/7205107/145400 + """ + if path is None: + path = [] + for key in b: + if key in a: + if isinstance(a[key], dict) and isinstance(b[key], dict): + dict_deep_merge(a[key], b[key], path + [str(key)]) + elif a[key] == b[key]: + # Key conflict, but equal value. + pass + else: + # Key/value conflict. Prioritize b over a. + a[key] = b[key] + else: + a[key] = b[key] + return a
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/logout_request.html b/docs/saml2/_modules/onelogin/saml2/logout_request.html new file mode 100644 index 00000000..bdc48e77 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/logout_request.html @@ -0,0 +1,465 @@ + + + + + + onelogin.saml2.logout_request — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    +
      +
    • + + +
    • +
    • +
    +
    +
    +
    +
    + +

    Source code for onelogin.saml2.logout_request

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Logout_Request class
    +
    +
    +Logout Request class of SAML Python Toolkit.
    +
    +"""
    +
    +from onelogin.saml2 import compat
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
    +from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +
    +
    [docs]class OneLogin_Saml2_Logout_Request(object): + """ + + This class handles a Logout Request. + + Builds a Logout Response object and validates it. + + """ + + def __init__(self, settings, request=None, name_id=None, session_index=None, nq=None, name_id_format=None, spnq=None): + """ + Constructs the Logout Request object. + + :param settings: Setting data + :type settings: OneLogin_Saml2_Settings + + :param request: Optional. A LogoutRequest to be loaded instead build one. + :type request: string + + :param name_id: The NameID that will be set in the LogoutRequest. + :type name_id: string + + :param session_index: SessionIndex that identifies the session of the user. + :type session_index: string + + :param nq: IDP Name Qualifier + :type: string + + :param name_id_format: The NameID Format that will be set in the LogoutRequest. + :type: string + + :param spnq: SP Name Qualifier + :type: string + """ + self._settings = settings + self._error = None + self.id = None + + if request is None: + sp_data = self._settings.get_sp_data() + idp_data = self._settings.get_idp_data() + security = self._settings.get_security_data() + + self.id = self._generate_request_id() + + issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now()) + + cert = None + if security['nameIdEncrypted']: + exists_multix509enc = 'x509certMulti' in idp_data and \ + 'encryption' in idp_data['x509certMulti'] and \ + idp_data['x509certMulti']['encryption'] + if exists_multix509enc: + cert = idp_data['x509certMulti']['encryption'][0] + else: + cert = self._settings.get_idp_cert() + + if name_id is not None: + if not name_id_format and sp_data['NameIDFormat'] != OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED: + name_id_format = sp_data['NameIDFormat'] + else: + name_id = idp_data['entityId'] + name_id_format = OneLogin_Saml2_Constants.NAMEID_ENTITY + + # From saml-core-2.0-os 8.3.6, when the entity Format is used: + # "The NameQualifier, SPNameQualifier, and SPProvidedID attributes + # MUST be omitted. + if name_id_format and name_id_format == OneLogin_Saml2_Constants.NAMEID_ENTITY: + nq = None + spnq = None + + # NameID Format UNSPECIFIED omitted + if name_id_format and name_id_format == OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED: + name_id_format = None + + name_id_obj = OneLogin_Saml2_Utils.generate_name_id( + name_id, + spnq, + name_id_format, + cert, + False, + nq + ) + + if session_index: + session_index_str = '<samlp:SessionIndex>%s</samlp:SessionIndex>' % session_index + else: + session_index_str = '' + + logout_request = OneLogin_Saml2_Templates.LOGOUT_REQUEST % \ + { + 'id': self.id, + 'issue_instant': issue_instant, + 'single_logout_url': self._settings.get_idp_slo_url(), + 'entity_id': sp_data['entityId'], + 'name_id': name_id_obj, + 'session_index': session_index_str, + } + else: + logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(request, ignore_zip=True) + self.id = self.get_id(logout_request) + + self._logout_request = compat.to_string(logout_request) + +
    [docs] def get_request(self, deflate=True): + """ + Returns the Logout Request deflated, base64encoded + :param deflate: It makes the deflate process optional + :type: bool + :return: Logout Request maybe deflated and base64 encoded + :rtype: str object + """ + if deflate: + request = OneLogin_Saml2_Utils.deflate_and_base64_encode(self._logout_request) + else: + request = OneLogin_Saml2_Utils.b64encode(self._logout_request) + return request
    + +
    [docs] def get_xml(self): + """ + Returns the XML that will be sent as part of the request + or that was received at the SP + :return: XML request body + :rtype: string + """ + return self._logout_request
    + +
    [docs] @classmethod + def get_id(cls, request): + """ + Returns the ID of the Logout Request + :param request: Logout Request Message + :type request: string|DOMDocument + :return: string ID + :rtype: str object + """ + + elem = OneLogin_Saml2_XML.to_etree(request) + return elem.get('ID', None)
    + +
    [docs] @classmethod + def get_nameid_data(cls, request, key=None): + """ + Gets the NameID Data of the the Logout Request + :param request: Logout Request Message + :type request: string|DOMDocument + :param key: The SP key + :type key: string + :return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier) + :rtype: dict + """ + elem = OneLogin_Saml2_XML.to_etree(request) + name_id = None + encrypted_entries = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:EncryptedID') + + if len(encrypted_entries) == 1: + if key is None: + raise OneLogin_Saml2_Error( + 'Private Key is required in order to decrypt the NameID, check settings', + OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND + ) + + encrypted_data_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:EncryptedID/xenc:EncryptedData') + if len(encrypted_data_nodes) == 1: + encrypted_data = encrypted_data_nodes[0] + name_id = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key) + else: + entries = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:NameID') + if len(entries) == 1: + name_id = entries[0] + + if name_id is None: + raise OneLogin_Saml2_ValidationError( + 'NameID not found in the Logout Request', + OneLogin_Saml2_ValidationError.NO_NAMEID + ) + + name_id_data = { + 'Value': OneLogin_Saml2_XML.element_text(name_id) + } + for attr in ['Format', 'SPNameQualifier', 'NameQualifier']: + if attr in name_id.attrib: + name_id_data[attr] = name_id.attrib[attr] + + return name_id_data
    + +
    [docs] @classmethod + def get_nameid(cls, request, key=None): + """ + Gets the NameID of the Logout Request Message + :param request: Logout Request Message + :type request: string|DOMDocument + :param key: The SP key + :type key: string + :return: Name ID Value + :rtype: string + """ + name_id = cls.get_nameid_data(request, key) + return name_id['Value']
    + +
    [docs] @classmethod + def get_nameid_format(cls, request, key=None): + """ + Gets the NameID Format of the Logout Request Message + :param request: Logout Request Message + :type request: string|DOMDocument + :param key: The SP key + :type key: string + :return: Name ID Format + :rtype: string + """ + name_id_format = None + name_id_data = cls.get_nameid_data(request, key) + if name_id_data and 'Format' in name_id_data.keys(): + name_id_format = name_id_data['Format'] + return name_id_format
    + +
    [docs] @classmethod + def get_issuer(cls, request): + """ + Gets the Issuer of the Logout Request Message + :param request: Logout Request Message + :type request: string|DOMDocument + :return: The Issuer + :rtype: string + """ + + elem = OneLogin_Saml2_XML.to_etree(request) + issuer = None + issuer_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:Issuer') + if len(issuer_nodes) == 1: + issuer = OneLogin_Saml2_XML.element_text(issuer_nodes[0]) + return issuer
    + +
    [docs] @classmethod + def get_session_indexes(cls, request): + """ + Gets the SessionIndexes from the Logout Request + :param request: Logout Request Message + :type request: string|DOMDocument + :return: The SessionIndex value + :rtype: list + """ + + elem = OneLogin_Saml2_XML.to_etree(request) + session_indexes = [] + session_index_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/samlp:SessionIndex') + for session_index_node in session_index_nodes: + session_indexes.append(OneLogin_Saml2_XML.element_text(session_index_node)) + return session_indexes
    + +
    [docs] def is_valid(self, request_data, raise_exceptions=False): + """ + Checks if the Logout Request received is valid + :param request_data: Request Data + :type request_data: dict + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + + :return: If the Logout Request is or not valid + :rtype: boolean + """ + self._error = None + try: + root = OneLogin_Saml2_XML.to_etree(self._logout_request) + + idp_data = self._settings.get_idp_data() + idp_entity_id = idp_data['entityId'] + + get_data = ('get_data' in request_data and request_data['get_data']) or dict() + + if self._settings.is_strict(): + res = OneLogin_Saml2_XML.validate_xml(root, 'saml-schema-protocol-2.0.xsd', self._settings.is_debug_active()) + if isinstance(res, str): + raise OneLogin_Saml2_ValidationError( + 'Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd', + OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT + ) + + security = self._settings.get_security_data() + + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) + + # Check NotOnOrAfter + if root.get('NotOnOrAfter', None): + na = OneLogin_Saml2_Utils.parse_SAML_to_time(root.get('NotOnOrAfter')) + if na <= OneLogin_Saml2_Utils.now(): + raise OneLogin_Saml2_ValidationError( + 'Could not validate timestamp: expired. Check system clock.)', + OneLogin_Saml2_ValidationError.RESPONSE_EXPIRED + ) + + # Check destination + destination = root.get('Destination', None) + if destination: + if not OneLogin_Saml2_Utils.normalize_url(url=destination).startswith(OneLogin_Saml2_Utils.normalize_url(url=current_url)): + raise OneLogin_Saml2_ValidationError( + 'The LogoutRequest was received at ' + '%(currentURL)s instead of %(destination)s' % + { + 'currentURL': current_url, + 'destination': destination, + }, + OneLogin_Saml2_ValidationError.WRONG_DESTINATION + ) + + # Check issuer + issuer = self.get_issuer(root) + if issuer is not None and issuer != idp_entity_id: + raise OneLogin_Saml2_ValidationError( + 'Invalid issuer in the Logout Request (expected %(idpEntityId)s, got %(issuer)s)' % + { + 'idpEntityId': idp_entity_id, + 'issuer': issuer + }, + OneLogin_Saml2_ValidationError.WRONG_ISSUER + ) + + if security['wantMessagesSigned']: + if 'Signature' not in get_data: + raise OneLogin_Saml2_ValidationError( + 'The Message of the Logout Request is not signed and the SP require it', + OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE + ) + + return True + except Exception as err: + # pylint: disable=R0801 + self._error = str(err) + debug = self._settings.is_debug_active() + if debug: + print(err) + if raise_exceptions: + raise + return False
    + +
    [docs] def get_error(self): + """ + After executing a validation process, if it fails this method returns the cause + """ + return self._error
    + + def _generate_request_id(self): + """ + Generate an unique logout request ID. + """ + return OneLogin_Saml2_Utils.generate_unique_id()
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/logout_response.html b/docs/saml2/_modules/onelogin/saml2/logout_response.html new file mode 100644 index 00000000..a403dc35 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/logout_response.html @@ -0,0 +1,321 @@ + + + + + + onelogin.saml2.logout_response — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    +
      +
    • + + +
    • +
    • +
    +
    +
    +
    +
    + +

    Source code for onelogin.saml2.logout_response

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Logout_Response class
    +
    +
    +Logout Response class of SAML Python Toolkit.
    +
    +"""
    +
    +from onelogin.saml2 import compat
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_ValidationError
    +from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +
    +
    [docs]class OneLogin_Saml2_Logout_Response(object): + """ + + This class handles a Logout Response. It Builds or parses a Logout Response object + and validates it. + + """ + + def __init__(self, settings, response=None): + """ + Constructs a Logout Response object (Initialize params from settings + and if provided load the Logout Response. + + Arguments are: + * (OneLogin_Saml2_Settings) settings. Setting data + * (string) response. An UUEncoded SAML Logout + response from the IdP. + """ + self._settings = settings + self._error = None + self.id = None + + if response is not None: + self._logout_response = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(response, ignore_zip=True)) + self.document = OneLogin_Saml2_XML.to_etree(self._logout_response) + self.id = self.document.get('ID', None) + +
    [docs] def get_issuer(self): + """ + Gets the Issuer of the Logout Response Message + :return: The Issuer + :rtype: string + """ + issuer = None + issuer_nodes = self._query('/samlp:LogoutResponse/saml:Issuer') + if len(issuer_nodes) == 1: + issuer = OneLogin_Saml2_XML.element_text(issuer_nodes[0]) + return issuer
    + +
    [docs] def get_status(self): + """ + Gets the Status + :return: The Status + :rtype: string + """ + entries = self._query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode') + if len(entries) == 0: + return None + status = entries[0].attrib['Value'] + return status
    + +
    [docs] def is_valid(self, request_data, request_id=None, raise_exceptions=False): + """ + Determines if the SAML LogoutResponse is valid + :param request_id: The ID of the LogoutRequest sent by this SP to the IdP + :type request_id: string + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + + :return: Returns if the SAML LogoutResponse is or not valid + :rtype: boolean + """ + self._error = None + try: + idp_data = self._settings.get_idp_data() + idp_entity_id = idp_data['entityId'] + get_data = request_data['get_data'] + + if self._settings.is_strict(): + res = OneLogin_Saml2_XML.validate_xml(self.document, 'saml-schema-protocol-2.0.xsd', self._settings.is_debug_active()) + if isinstance(res, str): + raise OneLogin_Saml2_ValidationError( + 'Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd', + OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT + ) + + security = self._settings.get_security_data() + + # Check if the InResponseTo of the Logout Response matches the ID of the Logout Request (requestId) if provided + in_response_to = self.get_in_response_to() + if request_id is not None and in_response_to and in_response_to != request_id: + raise OneLogin_Saml2_ValidationError( + 'The InResponseTo of the Logout Response: %s, does not match the ID of the Logout request sent by the SP: %s' % (in_response_to, request_id), + OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO + ) + + # Check issuer + issuer = self.get_issuer() + if issuer is not None and issuer != idp_entity_id: + raise OneLogin_Saml2_ValidationError( + 'Invalid issuer in the Logout Response (expected %(idpEntityId)s, got %(issuer)s)' % + { + 'idpEntityId': idp_entity_id, + 'issuer': issuer + }, + OneLogin_Saml2_ValidationError.WRONG_ISSUER + ) + + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) + + # Check destination + destination = self.document.get('Destination', None) + if destination: + if not OneLogin_Saml2_Utils.normalize_url(url=destination).startswith(OneLogin_Saml2_Utils.normalize_url(url=current_url)): + raise OneLogin_Saml2_ValidationError( + 'The LogoutResponse was received at %s instead of %s' % (current_url, destination), + OneLogin_Saml2_ValidationError.WRONG_DESTINATION + ) + + if security['wantMessagesSigned']: + if 'Signature' not in get_data: + raise OneLogin_Saml2_ValidationError( + 'The Message of the Logout Response is not signed and the SP require it', + OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE + ) + return True + # pylint: disable=R0801 + except Exception as err: + self._error = str(err) + debug = self._settings.is_debug_active() + if debug: + print(err) + if raise_exceptions: + raise + return False
    + + def _query(self, query): + """ + Extracts a node from the Etree (Logout Response Message) + :param query: Xpath Expression + :type query: string + :return: The queried node + :rtype: Element + """ + return OneLogin_Saml2_XML.query(self.document, query) + +
    [docs] def build(self, in_response_to, status=OneLogin_Saml2_Constants.STATUS_SUCCESS): + """ + Creates a Logout Response object. + :param in_response_to: InResponseTo value for the Logout Response. + :type in_response_to: string + :param: status: The status of the response + :type: status: string + """ + sp_data = self._settings.get_sp_data() + + self.id = self._generate_request_id() + + issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now()) + + logout_response = OneLogin_Saml2_Templates.LOGOUT_RESPONSE % { + "id": self.id, + "issue_instant": issue_instant, + "destination": self._settings.get_idp_slo_response_url(), + "in_response_to": in_response_to, + "entity_id": sp_data["entityId"], + "status": status, + } + + self._logout_response = logout_response
    + +
    [docs] def get_in_response_to(self): + """ + Gets the ID of the LogoutRequest which this response is in response to + :returns: ID of LogoutRequest this LogoutResponse is in response to or None if it is not present + :rtype: str + """ + return self.document.get('InResponseTo')
    + +
    [docs] def get_response(self, deflate=True): + """ + Returns a Logout Response object. + :param deflate: It makes the deflate process optional + :type: bool + :return: Logout Response maybe deflated and base64 encoded + :rtype: string + """ + if deflate: + response = OneLogin_Saml2_Utils.deflate_and_base64_encode(self._logout_response) + else: + response = OneLogin_Saml2_Utils.b64encode(self._logout_response) + return response
    + +
    [docs] def get_error(self): + """ + After executing a validation process, if it fails this method returns the cause + """ + return self._error
    + +
    [docs] def get_xml(self): + """ + Returns the XML that will be sent as part of the response + or that was received at the SP + :return: XML response body + :rtype: string + """ + return self._logout_response
    + + def _generate_request_id(self): + """ + Generate an unique logout response ID. + """ + return OneLogin_Saml2_Utils.generate_unique_id()
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/metadata.html b/docs/saml2/_modules/onelogin/saml2/metadata.html new file mode 100644 index 00000000..cf74b78c --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/metadata.html @@ -0,0 +1,365 @@ + + + + + + onelogin.saml2.metadata — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.metadata

    +# -*- coding: utf-8 -*-
    +
    +""" OneLoginSaml2Metadata class
    +
    +
    +Metadata class of SAML Python Toolkit.
    +
    +"""
    +
    +from time import gmtime, strftime, time
    +from datetime import datetime
    +
    +from onelogin.saml2 import compat
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils
    +from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +try:
    +    basestring
    +except NameError:
    +    basestring = str
    +
    +
    +
    [docs]class OneLogin_Saml2_Metadata(object): + """ + + A class that contains methods related to the metadata of the SP + + """ + + TIME_VALID = 172800 # 2 days + TIME_CACHED = 604800 # 1 week + +
    [docs] @classmethod + def builder(cls, sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None): + """ + Builds the metadata of the SP + + :param sp: The SP data + :type sp: string + + :param authnsign: authnRequestsSigned attribute + :type authnsign: string + + :param wsign: wantAssertionsSigned attribute + :type wsign: string + + :param valid_until: Metadata's expiry date + :type valid_until: string|DateTime|Timestamp + + :param cache_duration: Duration of the cache in seconds + :type cache_duration: int|string + + :param contacts: Contacts info + :type contacts: dict + + :param organization: Organization info + :type organization: dict + """ + if valid_until is None: + valid_until = int(time()) + cls.TIME_VALID + if not isinstance(valid_until, basestring): + if isinstance(valid_until, datetime): + valid_until_time = valid_until.timetuple() + else: + valid_until_time = gmtime(valid_until) + valid_until_str = strftime(r'%Y-%m-%dT%H:%M:%SZ', valid_until_time) + else: + valid_until_str = valid_until + + if cache_duration is None: + cache_duration = cls.TIME_CACHED + if not isinstance(cache_duration, compat.str_type): + cache_duration_str = 'PT%sS' % cache_duration # Period of Time x Seconds + else: + cache_duration_str = cache_duration + + if contacts is None: + contacts = {} + if organization is None: + organization = {} + + sls = '' + if 'singleLogoutService' in sp and 'url' in sp['singleLogoutService']: + sls = OneLogin_Saml2_Templates.MD_SLS % \ + { + 'binding': sp['singleLogoutService']['binding'], + 'location': sp['singleLogoutService']['url'], + } + + str_authnsign = 'true' if authnsign else 'false' + str_wsign = 'true' if wsign else 'false' + + str_organization = '' + if len(organization) > 0: + organization_names = [] + organization_displaynames = [] + organization_urls = [] + for (lang, info) in organization.items(): + organization_names.append(""" <md:OrganizationName xml:lang="%s">%s</md:OrganizationName>""" % (lang, info['name'])) + organization_displaynames.append(""" <md:OrganizationDisplayName xml:lang="%s">%s</md:OrganizationDisplayName>""" % (lang, info['displayname'])) + organization_urls.append(""" <md:OrganizationURL xml:lang="%s">%s</md:OrganizationURL>""" % (lang, info['url'])) + org_data = '\n'.join(organization_names) + '\n' + '\n'.join(organization_displaynames) + '\n' + '\n'.join(organization_urls) + str_organization = """ <md:Organization>\n%(org)s\n </md:Organization>""" % {'org': org_data} + + str_contacts = '' + if len(contacts) > 0: + contacts_info = [] + for (ctype, info) in contacts.items(): + contact = OneLogin_Saml2_Templates.MD_CONTACT_PERSON % \ + { + 'type': ctype, + 'name': info['givenName'], + 'email': info['emailAddress'], + } + contacts_info.append(contact) + str_contacts = '\n'.join(contacts_info) + + str_attribute_consuming_service = '' + if 'attributeConsumingService' in sp and len(sp['attributeConsumingService']): + attr_cs_desc_str = '' + if "serviceDescription" in sp['attributeConsumingService']: + attr_cs_desc_str = """ <md:ServiceDescription xml:lang="en">%s</md:ServiceDescription> +""" % sp['attributeConsumingService']['serviceDescription'] + + requested_attribute_data = [] + for req_attribs in sp['attributeConsumingService']['requestedAttributes']: + req_attr_nameformat_str = req_attr_friendlyname_str = req_attr_isrequired_str = '' + req_attr_aux_str = ' />' + + if 'nameFormat' in req_attribs.keys() and req_attribs['nameFormat']: + req_attr_nameformat_str = " NameFormat=\"%s\"" % req_attribs['nameFormat'] + if 'friendlyName' in req_attribs.keys() and req_attribs['friendlyName']: + req_attr_friendlyname_str = " FriendlyName=\"%s\"" % req_attribs['friendlyName'] + if 'isRequired' in req_attribs.keys() and req_attribs['isRequired']: + req_attr_isrequired_str = " isRequired=\"%s\"" % 'true' if req_attribs['isRequired'] else 'false' + if 'attributeValue' in req_attribs.keys() and req_attribs['attributeValue']: + if isinstance(req_attribs['attributeValue'], basestring): + req_attribs['attributeValue'] = [req_attribs['attributeValue']] + + req_attr_aux_str = ">" + for attrValue in req_attribs['attributeValue']: + req_attr_aux_str += """ + <saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">%(attributeValue)s</saml:AttributeValue>""" % \ + { + 'attributeValue': attrValue + } + req_attr_aux_str += """ + </md:RequestedAttribute>""" + + requested_attribute = """ <md:RequestedAttribute Name="%(req_attr_name)s"%(req_attr_nameformat_str)s%(req_attr_friendlyname_str)s%(req_attr_isrequired_str)s%(req_attr_aux_str)s""" % \ + { + 'req_attr_name': req_attribs['name'], + 'req_attr_nameformat_str': req_attr_nameformat_str, + 'req_attr_friendlyname_str': req_attr_friendlyname_str, + 'req_attr_isrequired_str': req_attr_isrequired_str, + 'req_attr_aux_str': req_attr_aux_str + } + + requested_attribute_data.append(requested_attribute) + + str_attribute_consuming_service = """ <md:AttributeConsumingService index="%(attribute_consuming_service_index)s"> + <md:ServiceName xml:lang="en">%(service_name)s</md:ServiceName> +%(attr_cs_desc)s%(requested_attribute_str)s + </md:AttributeConsumingService> +""" % \ + { + 'service_name': sp['attributeConsumingService']['serviceName'], + 'attr_cs_desc': attr_cs_desc_str, + 'attribute_consuming_service_index': sp['attributeConsumingService'].get('index', '1'), + 'requested_attribute_str': '\n'.join(requested_attribute_data) + } + + metadata = OneLogin_Saml2_Templates.MD_ENTITY_DESCRIPTOR % \ + { + 'valid': ('validUntil="%s"' % valid_until_str) if valid_until_str else '', + 'cache': ('cacheDuration="%s"' % cache_duration_str) if cache_duration_str else '', + 'entity_id': sp['entityId'], + 'authnsign': str_authnsign, + 'wsign': str_wsign, + 'name_id_format': sp['NameIDFormat'], + 'binding': sp['assertionConsumerService']['binding'], + 'location': sp['assertionConsumerService']['url'], + 'sls': sls, + 'organization': str_organization, + 'contacts': str_contacts, + 'attribute_consuming_service': str_attribute_consuming_service + } + + return metadata
    + +
    [docs] @staticmethod + def sign_metadata(metadata, key, cert, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256, digest_algorithm=OneLogin_Saml2_Constants.SHA256): + """ + Signs the metadata with the key/cert provided + + :param metadata: SAML Metadata XML + :type metadata: string + + :param key: x509 key + :type key: string + + :param cert: x509 cert + :type cert: string + + :returns: Signed Metadata + :rtype: string + + :param sign_algorithm: Signature algorithm method + :type sign_algorithm: string + + :param digest_algorithm: Digest algorithm method + :type digest_algorithm: string + """ + return OneLogin_Saml2_Utils.add_sign(metadata, key, cert, False, sign_algorithm, digest_algorithm)
    + + @staticmethod + def _add_x509_key_descriptors(root, cert, signing): + key_descriptor = OneLogin_Saml2_XML.make_child(root, '{%s}KeyDescriptor' % OneLogin_Saml2_Constants.NS_MD) + root.remove(key_descriptor) + root.insert(0, key_descriptor) + key_info = OneLogin_Saml2_XML.make_child(key_descriptor, '{%s}KeyInfo' % OneLogin_Saml2_Constants.NS_DS) + key_data = OneLogin_Saml2_XML.make_child(key_info, '{%s}X509Data' % OneLogin_Saml2_Constants.NS_DS) + + x509_certificate = OneLogin_Saml2_XML.make_child(key_data, '{%s}X509Certificate' % OneLogin_Saml2_Constants.NS_DS) + x509_certificate.text = OneLogin_Saml2_Utils.format_cert(cert, False) + key_descriptor.set('use', ('encryption', 'signing')[signing]) + +
    [docs] @classmethod + def add_x509_key_descriptors(cls, metadata, cert=None, add_encryption=True): + """ + Adds the x509 descriptors (sign/encryption) to the metadata + The same cert will be used for sign/encrypt + + :param metadata: SAML Metadata XML + :type metadata: string + + :param cert: x509 cert + :type cert: string + + :param add_encryption: Determines if the KeyDescriptor[use="encryption"] should be added. + :type add_encryption: boolean + + :returns: Metadata with KeyDescriptors + :rtype: string + """ + if cert is None or cert == '': + return metadata + try: + root = OneLogin_Saml2_XML.to_etree(metadata) + except Exception as e: + raise Exception('Error parsing metadata. ' + str(e)) + + assert root.tag == '{%s}EntityDescriptor' % OneLogin_Saml2_Constants.NS_MD + try: + sp_sso_descriptor = next(root.iterfind('.//md:SPSSODescriptor', namespaces=OneLogin_Saml2_Constants.NSMAP)) + except StopIteration: + raise Exception('Malformed metadata.') + + if add_encryption: + cls._add_x509_key_descriptors(sp_sso_descriptor, cert, False) + cls._add_x509_key_descriptors(sp_sso_descriptor, cert, True) + return OneLogin_Saml2_XML.to_string(root)
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/response.html b/docs/saml2/_modules/onelogin/saml2/response.html new file mode 100644 index 00000000..5babc977 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/response.html @@ -0,0 +1,1054 @@ + + + + + + onelogin.saml2.response — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.response

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Response class
    +
    +
    +SAML Response class of SAML Python Toolkit.
    +
    +"""
    +
    +from copy import deepcopy
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError, return_false_on_exception
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +
    +
    [docs]class OneLogin_Saml2_Response(object): + """ + + This class handles a SAML Response. It parses or validates + a Logout Response object. + + """ + + def __init__(self, settings, response): + """ + Constructs the response object. + + :param settings: The setting info + :type settings: OneLogin_Saml2_Setting object + + :param response: The base64 encoded, XML string containing the samlp:Response + :type response: string + """ + self._settings = settings + self._error = None + self.response = OneLogin_Saml2_Utils.b64decode(response) + self.document = OneLogin_Saml2_XML.to_etree(self.response) + self.decrypted_document = None + self.encrypted = None + self.valid_scd_not_on_or_after = None + + # Quick check for the presence of EncryptedAssertion + encrypted_assertion_nodes = self._query('/samlp:Response/saml:EncryptedAssertion') + if encrypted_assertion_nodes: + decrypted_document = deepcopy(self.document) + self.encrypted = True + self.decrypted_document = self._decrypt_assertion(decrypted_document) + +
    [docs] def is_valid(self, request_data, request_id=None, raise_exceptions=False): + """ + Validates the response object. + + :param request_data: Request Data + :type request_data: dict + + :param request_id: Optional argument. The ID of the AuthNRequest sent by this SP to the IdP + :type request_id: string + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + + :returns: True if the SAML Response is valid, False if not + :rtype: bool + """ + self._error = None + try: + # Checks SAML version + if self.document.get('Version', None) != '2.0': + raise OneLogin_Saml2_ValidationError( + 'Unsupported SAML version', + OneLogin_Saml2_ValidationError.UNSUPPORTED_SAML_VERSION + ) + + # Checks that ID exists + if self.document.get('ID', None) is None: + raise OneLogin_Saml2_ValidationError( + 'Missing ID attribute on SAML Response', + OneLogin_Saml2_ValidationError.MISSING_ID + ) + + # Checks that the response has the SUCCESS status + self.check_status() + + # Checks that the response only has one assertion + if not self.validate_num_assertions(): + raise OneLogin_Saml2_ValidationError( + 'SAML Response must contain 1 assertion', + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS + ) + + idp_data = self._settings.get_idp_data() + idp_entity_id = idp_data['entityId'] + sp_data = self._settings.get_sp_data() + sp_entity_id = sp_data['entityId'] + + signed_elements = self.process_signed_elements() + + has_signed_response = '{%s}Response' % OneLogin_Saml2_Constants.NS_SAMLP in signed_elements + has_signed_assertion = '{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML in signed_elements + + if self._settings.is_strict(): + no_valid_xml_msg = 'Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd' + res = OneLogin_Saml2_XML.validate_xml(self.document, 'saml-schema-protocol-2.0.xsd', self._settings.is_debug_active()) + if isinstance(res, str): + raise OneLogin_Saml2_ValidationError( + no_valid_xml_msg, + OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT + ) + + # If encrypted, check also the decrypted document + if self.encrypted: + res = OneLogin_Saml2_XML.validate_xml(self.decrypted_document, 'saml-schema-protocol-2.0.xsd', self._settings.is_debug_active()) + if isinstance(res, str): + raise OneLogin_Saml2_ValidationError( + no_valid_xml_msg, + OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT + ) + + security = self._settings.get_security_data() + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) + + # Check if the InResponseTo of the Response matchs the ID of the AuthNRequest (requestId) if provided + in_response_to = self.get_in_response_to() + if in_response_to is not None and request_id is not None: + if in_response_to != request_id: + raise OneLogin_Saml2_ValidationError( + 'The InResponseTo of the Response: %s, does not match the ID of the AuthNRequest sent by the SP: %s' % (in_response_to, request_id), + OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO + ) + + if not self.encrypted and security['wantAssertionsEncrypted']: + raise OneLogin_Saml2_ValidationError( + 'The assertion of the Response is not encrypted and the SP require it', + OneLogin_Saml2_ValidationError.NO_ENCRYPTED_ASSERTION + ) + + if security['wantNameIdEncrypted']: + encrypted_nameid_nodes = self._query_assertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData') + if len(encrypted_nameid_nodes) != 1: + raise OneLogin_Saml2_ValidationError( + 'The NameID of the Response is not encrypted and the SP require it', + OneLogin_Saml2_ValidationError.NO_ENCRYPTED_NAMEID + ) + + # Checks that a Conditions element exists + if not self.check_one_condition(): + raise OneLogin_Saml2_ValidationError( + 'The Assertion must include a Conditions element', + OneLogin_Saml2_ValidationError.MISSING_CONDITIONS + ) + + # Validates Assertion timestamps + self.validate_timestamps(raise_exceptions=True) + + # Checks that an AuthnStatement element exists and is unique + if not self.check_one_authnstatement(): + raise OneLogin_Saml2_ValidationError( + 'The Assertion must include an AuthnStatement element', + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_AUTHSTATEMENTS + ) + + # Checks that the response has all of the AuthnContexts that we provided in the request. + # Only check if failOnAuthnContextMismatch is true and requestedAuthnContext is set to a list. + requested_authn_contexts = security['requestedAuthnContext'] + if security['failOnAuthnContextMismatch'] and requested_authn_contexts and requested_authn_contexts is not True: + authn_contexts = self.get_authn_contexts() + unmatched_contexts = set(authn_contexts).difference(requested_authn_contexts) + if unmatched_contexts: + raise OneLogin_Saml2_ValidationError( + 'The AuthnContext "%s" was not a requested context "%s"' % (', '.join(unmatched_contexts), ', '.join(requested_authn_contexts)), + OneLogin_Saml2_ValidationError.AUTHN_CONTEXT_MISMATCH + ) + + # Checks that there is at least one AttributeStatement if required + attribute_statement_nodes = self._query_assertion('/saml:AttributeStatement') + if security.get('wantAttributeStatement', True) and not attribute_statement_nodes: + raise OneLogin_Saml2_ValidationError( + 'There is no AttributeStatement on the Response', + OneLogin_Saml2_ValidationError.NO_ATTRIBUTESTATEMENT + ) + + encrypted_attributes_nodes = self._query_assertion('/saml:AttributeStatement/saml:EncryptedAttribute') + if encrypted_attributes_nodes: + raise OneLogin_Saml2_ValidationError( + 'There is an EncryptedAttribute in the Response and this SP not support them', + OneLogin_Saml2_ValidationError.ENCRYPTED_ATTRIBUTES + ) + + # Checks destination + destination = self.document.get('Destination', None) + if destination: + if not OneLogin_Saml2_Utils.normalize_url(url=destination).startswith(OneLogin_Saml2_Utils.normalize_url(url=current_url)): + # TODO: Review if following lines are required, since we can control the + # request_data + # current_url_routed = OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data) + # if not destination.startswith(current_url_routed): + raise OneLogin_Saml2_ValidationError( + 'The response was received at %s instead of %s' % (current_url, destination), + OneLogin_Saml2_ValidationError.WRONG_DESTINATION + ) + elif destination == '': + raise OneLogin_Saml2_ValidationError( + 'The response has an empty Destination value', + OneLogin_Saml2_ValidationError.EMPTY_DESTINATION + ) + # Checks audience + valid_audiences = self.get_audiences() + if valid_audiences and sp_entity_id not in valid_audiences: + raise OneLogin_Saml2_ValidationError( + '%s is not a valid audience for this Response' % sp_entity_id, + OneLogin_Saml2_ValidationError.WRONG_AUDIENCE + ) + + # Checks the issuers + issuers = self.get_issuers() + for issuer in issuers: + if issuer is None or issuer != idp_entity_id: + raise OneLogin_Saml2_ValidationError( + 'Invalid issuer in the Assertion/Response (expected %(idpEntityId)s, got %(issuer)s)' % + { + 'idpEntityId': idp_entity_id, + 'issuer': issuer + }, + OneLogin_Saml2_ValidationError.WRONG_ISSUER + ) + + # Checks the session Expiration + session_expiration = self.get_session_not_on_or_after() + if session_expiration and session_expiration <= OneLogin_Saml2_Utils.now(): + raise OneLogin_Saml2_ValidationError( + 'The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response', + OneLogin_Saml2_ValidationError.SESSION_EXPIRED + ) + + # Checks the SubjectConfirmation, at least one SubjectConfirmation must be valid + any_subject_confirmation = False + subject_confirmation_nodes = self._query_assertion('/saml:Subject/saml:SubjectConfirmation') + + for scn in subject_confirmation_nodes: + method = scn.get('Method', None) + if method and method != OneLogin_Saml2_Constants.CM_BEARER: + continue + sc_data = scn.find('saml:SubjectConfirmationData', namespaces=OneLogin_Saml2_Constants.NSMAP) + if sc_data is None: + continue + else: + irt = sc_data.get('InResponseTo', None) + if in_response_to and irt and irt != in_response_to: + continue + recipient = sc_data.get('Recipient', None) + if recipient and current_url not in recipient: + continue + nooa = sc_data.get('NotOnOrAfter', None) + if nooa: + parsed_nooa = OneLogin_Saml2_Utils.parse_SAML_to_time(nooa) + if parsed_nooa <= OneLogin_Saml2_Utils.now(): + continue + nb = sc_data.get('NotBefore', None) + if nb: + parsed_nb = OneLogin_Saml2_Utils.parse_SAML_to_time(nb) + if parsed_nb > OneLogin_Saml2_Utils.now(): + continue + + if nooa: + self.valid_scd_not_on_or_after = OneLogin_Saml2_Utils.parse_SAML_to_time(nooa) + + any_subject_confirmation = True + break + + if not any_subject_confirmation: + raise OneLogin_Saml2_ValidationError( + 'A valid SubjectConfirmation was not found on this Response', + OneLogin_Saml2_ValidationError.WRONG_SUBJECTCONFIRMATION + ) + + if security['wantAssertionsSigned'] and not has_signed_assertion: + raise OneLogin_Saml2_ValidationError( + 'The Assertion of the Response is not signed and the SP require it', + OneLogin_Saml2_ValidationError.NO_SIGNED_ASSERTION + ) + + if security['wantMessagesSigned'] and not has_signed_response: + raise OneLogin_Saml2_ValidationError( + 'The Message of the Response is not signed and the SP require it', + OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE + ) + + if not signed_elements or (not has_signed_response and not has_signed_assertion): + raise OneLogin_Saml2_ValidationError( + 'No Signature found. SAML Response rejected', + OneLogin_Saml2_ValidationError.NO_SIGNATURE_FOUND + ) + else: + cert = self._settings.get_idp_cert() + fingerprint = idp_data.get('certFingerprint', None) + if fingerprint: + fingerprint = OneLogin_Saml2_Utils.format_finger_print(fingerprint) + fingerprintalg = idp_data.get('certFingerprintAlgorithm', None) + + multicerts = None + if 'x509certMulti' in idp_data and 'signing' in idp_data['x509certMulti'] and idp_data['x509certMulti']['signing']: + multicerts = idp_data['x509certMulti']['signing'] + + # If find a Signature on the Response, validates it checking the original response + if has_signed_response and not OneLogin_Saml2_Utils.validate_sign(self.document, cert, fingerprint, fingerprintalg, xpath=OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH, multicerts=multicerts, raise_exceptions=False): + raise OneLogin_Saml2_ValidationError( + 'Signature validation failed. SAML Response rejected', + OneLogin_Saml2_ValidationError.INVALID_SIGNATURE + ) + + document_check_assertion = self.decrypted_document if self.encrypted else self.document + if has_signed_assertion and not OneLogin_Saml2_Utils.validate_sign(document_check_assertion, cert, fingerprint, fingerprintalg, xpath=OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH, multicerts=multicerts, raise_exceptions=False): + raise OneLogin_Saml2_ValidationError( + 'Signature validation failed. SAML Response rejected', + OneLogin_Saml2_ValidationError.INVALID_SIGNATURE + ) + + return True + except Exception as err: + self._error = str(err) + debug = self._settings.is_debug_active() + if debug: + print(err) + if raise_exceptions: + raise + return False
    + +
    [docs] def check_status(self): + """ + Check if the status of the response is success or not + + :raises: Exception. If the status is not success + """ + status = OneLogin_Saml2_Utils.get_status(self.document) + code = status.get('code', None) + if code and code != OneLogin_Saml2_Constants.STATUS_SUCCESS: + splited_code = code.split(':') + printable_code = splited_code.pop() + status_exception_msg = 'The status code of the Response was not Success, was %s' % printable_code + status_msg = status.get('msg', None) + if status_msg: + status_exception_msg += ' -> ' + status_msg + raise OneLogin_Saml2_ValidationError( + status_exception_msg, + OneLogin_Saml2_ValidationError.STATUS_CODE_IS_NOT_SUCCESS + )
    + +
    [docs] def check_one_condition(self): + """ + Checks that the samlp:Response/saml:Assertion/saml:Conditions element exists and is unique. + """ + condition_nodes = self._query_assertion('/saml:Conditions') + if len(condition_nodes) == 1: + return True + else: + return False
    + +
    [docs] def check_one_authnstatement(self): + """ + Checks that the samlp:Response/saml:Assertion/saml:AuthnStatement element exists and is unique. + """ + authnstatement_nodes = self._query_assertion('/saml:AuthnStatement') + if len(authnstatement_nodes) == 1: + return True + else: + return False
    + +
    [docs] def get_audiences(self): + """ + Gets the audiences + + :returns: The valid audiences for the SAML Response + :rtype: list + """ + audience_nodes = self._query_assertion('/saml:Conditions/saml:AudienceRestriction/saml:Audience') + return [OneLogin_Saml2_XML.element_text(node) for node in audience_nodes if OneLogin_Saml2_XML.element_text(node) is not None]
    + +
    [docs] def get_authn_contexts(self): + """ + Gets the authentication contexts + + :returns: The authentication classes for the SAML Response + :rtype: list + """ + authn_context_nodes = self._query_assertion('/saml:AuthnStatement/saml:AuthnContext/saml:AuthnContextClassRef') + return [OneLogin_Saml2_XML.element_text(node) for node in authn_context_nodes]
    + +
    [docs] def get_in_response_to(self): + """ + Gets the ID of the request which this response is in response to + :returns: ID of AuthNRequest this Response is in response to or None if it is not present + :rtype: str + """ + return self.document.get('InResponseTo')
    + +
    [docs] def get_issuers(self): + """ + Gets the issuers (from message and from assertion) + + :returns: The issuers + :rtype: list + """ + issuers = set() + + message_issuer_nodes = OneLogin_Saml2_XML.query(self.document, '/samlp:Response/saml:Issuer') + if len(message_issuer_nodes) > 0: + if len(message_issuer_nodes) == 1: + issuer_value = OneLogin_Saml2_XML.element_text(message_issuer_nodes[0]) + if issuer_value: + issuers.add(issuer_value) + else: + raise OneLogin_Saml2_ValidationError( + 'Issuer of the Response is multiple.', + OneLogin_Saml2_ValidationError.ISSUER_MULTIPLE_IN_RESPONSE + ) + + assertion_issuer_nodes = self._query_assertion('/saml:Issuer') + if len(assertion_issuer_nodes) == 1: + issuer_value = OneLogin_Saml2_XML.element_text(assertion_issuer_nodes[0]) + if issuer_value: + issuers.add(issuer_value) + else: + raise OneLogin_Saml2_ValidationError( + 'Issuer of the Assertion not found or multiple.', + OneLogin_Saml2_ValidationError.ISSUER_NOT_FOUND_IN_ASSERTION + ) + + return list(set(issuers))
    + +
    [docs] def get_nameid_data(self): + """ + Gets the NameID Data provided by the SAML Response from the IdP + + :returns: Name ID Data (Value, Format, NameQualifier, SPNameQualifier) + :rtype: dict + """ + nameid = None + nameid_data = {} + + encrypted_id_data_nodes = self._query_assertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData') + if encrypted_id_data_nodes: + encrypted_data = encrypted_id_data_nodes[0] + key = self._settings.get_sp_key() + nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key) + else: + nameid_nodes = self._query_assertion('/saml:Subject/saml:NameID') + if nameid_nodes: + nameid = nameid_nodes[0] + + is_strict = self._settings.is_strict() + want_nameid = self._settings.get_security_data().get('wantNameId', True) + if nameid is None: + if is_strict and want_nameid: + raise OneLogin_Saml2_ValidationError( + 'NameID not found in the assertion of the Response', + OneLogin_Saml2_ValidationError.NO_NAMEID + ) + else: + if is_strict and want_nameid and not OneLogin_Saml2_XML.element_text(nameid): + raise OneLogin_Saml2_ValidationError( + 'An empty NameID value found', + OneLogin_Saml2_ValidationError.EMPTY_NAMEID + ) + + nameid_data = {'Value': OneLogin_Saml2_XML.element_text(nameid)} + for attr in ['Format', 'SPNameQualifier', 'NameQualifier']: + value = nameid.get(attr, None) + if value: + if is_strict and attr == 'SPNameQualifier': + sp_data = self._settings.get_sp_data() + sp_entity_id = sp_data.get('entityId', '') + if sp_entity_id != value: + raise OneLogin_Saml2_ValidationError( + 'The SPNameQualifier value mistmatch the SP entityID value.', + OneLogin_Saml2_ValidationError.SP_NAME_QUALIFIER_NAME_MISMATCH + ) + + nameid_data[attr] = value + return nameid_data
    + +
    [docs] def get_nameid(self): + """ + Gets the NameID provided by the SAML Response from the IdP + + :returns: NameID (value) + :rtype: string|None + """ + nameid_value = None + nameid_data = self.get_nameid_data() + if nameid_data and 'Value' in nameid_data.keys(): + nameid_value = nameid_data['Value'] + return nameid_value
    + +
    [docs] def get_nameid_format(self): + """ + Gets the NameID Format provided by the SAML Response from the IdP + + :returns: NameID Format + :rtype: string|None + """ + nameid_format = None + nameid_data = self.get_nameid_data() + if nameid_data and 'Format' in nameid_data.keys(): + nameid_format = nameid_data['Format'] + return nameid_format
    + +
    [docs] def get_nameid_nq(self): + """ + Gets the NameID NameQualifier provided by the SAML Response from the IdP + + :returns: NameID NameQualifier + :rtype: string|None + """ + nameid_nq = None + nameid_data = self.get_nameid_data() + if nameid_data and 'NameQualifier' in nameid_data.keys(): + nameid_nq = nameid_data['NameQualifier'] + return nameid_nq
    + +
    [docs] def get_nameid_spnq(self): + """ + Gets the NameID SP NameQualifier provided by the SAML response from the IdP. + + :returns: NameID SP NameQualifier + :rtype: string|None + """ + nameid_spnq = None + nameid_data = self.get_nameid_data() + if nameid_data and 'SPNameQualifier' in nameid_data.keys(): + nameid_spnq = nameid_data['SPNameQualifier'] + return nameid_spnq
    + +
    [docs] def get_session_not_on_or_after(self): + """ + Gets the SessionNotOnOrAfter from the AuthnStatement + Could be used to set the local session expiration + + :returns: The SessionNotOnOrAfter value + :rtype: time|None + """ + not_on_or_after = None + authn_statement_nodes = self._query_assertion('/saml:AuthnStatement[@SessionNotOnOrAfter]') + if authn_statement_nodes: + not_on_or_after = OneLogin_Saml2_Utils.parse_SAML_to_time(authn_statement_nodes[0].get('SessionNotOnOrAfter')) + return not_on_or_after
    + +
    [docs] def get_assertion_not_on_or_after(self): + """ + Returns the NotOnOrAfter value of the valid SubjectConfirmationData node if any + """ + return self.valid_scd_not_on_or_after
    + +
    [docs] def get_session_index(self): + """ + Gets the SessionIndex from the AuthnStatement + Could be used to be stored in the local session in order + to be used in a future Logout Request that the SP could + send to the SP, to set what specific session must be deleted + + :returns: The SessionIndex value + :rtype: string|None + """ + session_index = None + authn_statement_nodes = self._query_assertion('/saml:AuthnStatement[@SessionIndex]') + if authn_statement_nodes: + session_index = authn_statement_nodes[0].get('SessionIndex') + return session_index
    + +
    [docs] def get_attributes(self): + """ + Gets the Attributes from the AttributeStatement element. + EncryptedAttributes are not supported + """ + return self._get_attributes('Name')
    + +
    [docs] def get_friendlyname_attributes(self): + """ + Gets the Attributes from the AttributeStatement element indexed by FiendlyName. + EncryptedAttributes are not supported + """ + return self._get_attributes('FriendlyName')
    + + def _get_attributes(self, attr_name): + allow_duplicates = self._settings.get_security_data().get('allowRepeatAttributeName', False) + attributes = {} + attribute_nodes = self._query_assertion('/saml:AttributeStatement/saml:Attribute') + for attribute_node in attribute_nodes: + attr_key = attribute_node.get(attr_name) + if attr_key: + if not allow_duplicates and attr_key in attributes: + raise OneLogin_Saml2_ValidationError( + 'Found an Attribute element with duplicated ' + attr_name, + OneLogin_Saml2_ValidationError.DUPLICATED_ATTRIBUTE_NAME_FOUND + ) + + values = [] + for attr in attribute_node.iterchildren('{%s}AttributeValue' % OneLogin_Saml2_Constants.NSMAP['saml']): + attr_text = OneLogin_Saml2_XML.element_text(attr) + if attr_text: + attr_text = attr_text.strip() + if attr_text: + values.append(attr_text) + + # Parse any nested NameID children + for nameid in attr.iterchildren('{%s}NameID' % OneLogin_Saml2_Constants.NSMAP['saml']): + values.append({ + 'NameID': { + 'Format': nameid.get('Format'), + 'NameQualifier': nameid.get('NameQualifier'), + 'value': nameid.text + } + }) + if attr_key in attributes: + attributes[attr_key].extend(values) + else: + attributes[attr_key] = values + return attributes + +
    [docs] def validate_num_assertions(self): + """ + Verifies that the document only contains a single Assertion (encrypted or not) + + :returns: True if only 1 assertion encrypted or not + :rtype: bool + """ + encrypted_assertion_nodes = OneLogin_Saml2_XML.query(self.document, '//saml:EncryptedAssertion') + assertion_nodes = OneLogin_Saml2_XML.query(self.document, '//saml:Assertion') + + valid = len(encrypted_assertion_nodes) + len(assertion_nodes) == 1 + + if (self.encrypted): + assertion_nodes = OneLogin_Saml2_XML.query(self.decrypted_document, '//saml:Assertion') + valid = valid and len(assertion_nodes) == 1 + + return valid
    + +
    [docs] def process_signed_elements(self): + """ + Verifies the signature nodes: + - Checks that are Response or Assertion + - Check that IDs and reference URI are unique and consistent. + + :returns: The signed elements tag names + :rtype: list + """ + sign_nodes = self._query('//ds:Signature') + + signed_elements = [] + verified_seis = [] + verified_ids = [] + response_tag = '{%s}Response' % OneLogin_Saml2_Constants.NS_SAMLP + assertion_tag = '{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML + + security = self._settings.get_security_data() + reject_deprecated_alg = security.get('rejectDeprecatedAlgorithm', False) + + for sign_node in sign_nodes: + signed_element = sign_node.getparent().tag + if signed_element != response_tag and signed_element != assertion_tag: + raise OneLogin_Saml2_ValidationError( + 'Invalid Signature Element %s SAML Response rejected' % signed_element, + OneLogin_Saml2_ValidationError.WRONG_SIGNED_ELEMENT + ) + + if not sign_node.getparent().get('ID'): + raise OneLogin_Saml2_ValidationError( + 'Signed Element must contain an ID. SAML Response rejected', + OneLogin_Saml2_ValidationError.ID_NOT_FOUND_IN_SIGNED_ELEMENT + ) + + id_value = sign_node.getparent().get('ID') + if id_value in verified_ids: + raise OneLogin_Saml2_ValidationError( + 'Duplicated ID. SAML Response rejected', + OneLogin_Saml2_ValidationError.DUPLICATED_ID_IN_SIGNED_ELEMENTS + ) + verified_ids.append(id_value) + + # Check that reference URI matches the parent ID and no duplicate References or IDs + ref = OneLogin_Saml2_XML.query(sign_node, './/ds:Reference') + if ref: + ref = ref[0] + if ref.get('URI'): + sei = ref.get('URI')[1:] + + if sei != id_value: + raise OneLogin_Saml2_ValidationError( + 'Found an invalid Signed Element. SAML Response rejected', + OneLogin_Saml2_ValidationError.INVALID_SIGNED_ELEMENT + ) + + if sei in verified_seis: + raise OneLogin_Saml2_ValidationError( + 'Duplicated Reference URI. SAML Response rejected', + OneLogin_Saml2_ValidationError.DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS + ) + verified_seis.append(sei) + + # Check the signature and digest algorithm + if reject_deprecated_alg: + sig_method_node = OneLogin_Saml2_XML.query(sign_node, './/ds:SignatureMethod') + if sig_method_node: + sig_method = sig_method_node[0].get("Algorithm") + if sig_method in OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS: + raise OneLogin_Saml2_ValidationError( + 'Deprecated signature algorithm found: %s' % sig_method, + OneLogin_Saml2_ValidationError.DEPRECATED_SIGNATURE_METHOD + ) + + dig_method_node = OneLogin_Saml2_XML.query(sign_node, './/ds:DigestMethod') + if dig_method_node: + dig_method = dig_method_node[0].get("Algorithm") + if dig_method in OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS: + raise OneLogin_Saml2_ValidationError( + 'Deprecated digest algorithm found: %s' % dig_method, + OneLogin_Saml2_ValidationError.DEPRECATED_DIGEST_METHOD + ) + + signed_elements.append(signed_element) + + if signed_elements: + if not self.validate_signed_elements(signed_elements, raise_exceptions=True): + raise OneLogin_Saml2_ValidationError( + 'Found an unexpected Signature Element. SAML Response rejected', + OneLogin_Saml2_ValidationError.UNEXPECTED_SIGNED_ELEMENTS + ) + return signed_elements
    + +
    [docs] @return_false_on_exception + def validate_signed_elements(self, signed_elements): + """ + Verifies that the document has the expected signed nodes. + + :param signed_elements: The signed elements to be checked + :type signed_elements: list + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + """ + if len(signed_elements) > 2: + return False + + response_tag = '{%s}Response' % OneLogin_Saml2_Constants.NS_SAMLP + assertion_tag = '{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML + + if (response_tag in signed_elements and signed_elements.count(response_tag) > 1) or \ + (assertion_tag in signed_elements and signed_elements.count(assertion_tag) > 1) or \ + (response_tag not in signed_elements and assertion_tag not in signed_elements): + return False + + # Check that the signed elements found here, are the ones that will be verified + # by OneLogin_Saml2_Utils.validate_sign + if response_tag in signed_elements: + expected_signature_nodes = OneLogin_Saml2_XML.query(self.document, OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH) + if len(expected_signature_nodes) != 1: + raise OneLogin_Saml2_ValidationError( + 'Unexpected number of Response signatures found. SAML Response rejected.', + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE + ) + + if assertion_tag in signed_elements: + expected_signature_nodes = self._query(OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH) + if len(expected_signature_nodes) != 1: + raise OneLogin_Saml2_ValidationError( + 'Unexpected number of Assertion signatures found. SAML Response rejected.', + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION + ) + + return True
    + +
    [docs] @return_false_on_exception + def validate_timestamps(self): + """ + Verifies that the document is valid according to Conditions Element + + :returns: True if the condition is valid, False otherwise + :rtype: bool + """ + conditions_nodes = self._query_assertion('/saml:Conditions') + + for conditions_node in conditions_nodes: + nb_attr = conditions_node.get('NotBefore') + nooa_attr = conditions_node.get('NotOnOrAfter') + if nb_attr and OneLogin_Saml2_Utils.parse_SAML_to_time(nb_attr) > OneLogin_Saml2_Utils.now() + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT: + raise OneLogin_Saml2_ValidationError( + 'Could not validate timestamp: not yet valid. Check system clock.', + OneLogin_Saml2_ValidationError.ASSERTION_TOO_EARLY + ) + if nooa_attr and OneLogin_Saml2_Utils.parse_SAML_to_time(nooa_attr) + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT <= OneLogin_Saml2_Utils.now(): + raise OneLogin_Saml2_ValidationError( + 'Could not validate timestamp: expired. Check system clock.', + OneLogin_Saml2_ValidationError.ASSERTION_EXPIRED + ) + return True
    + + def _query_assertion(self, xpath_expr): + """ + Extracts nodes that match the query from the Assertion + + :param xpath_expr: Xpath Expresion + :type xpath_expr: String + + :returns: The queried nodes + :rtype: list + """ + + assertion_expr = '/saml:Assertion' + signature_expr = '/ds:Signature/ds:SignedInfo/ds:Reference' + signed_assertion_query = '/samlp:Response' + assertion_expr + signature_expr + assertion_reference_nodes = self._query(signed_assertion_query) + tagid = None + + if not assertion_reference_nodes: + # Check if the message is signed + signed_message_query = '/samlp:Response' + signature_expr + message_reference_nodes = self._query(signed_message_query) + if message_reference_nodes: + message_id = message_reference_nodes[0].get('URI') + final_query = "/samlp:Response[@ID=$tagid]/" + tagid = message_id[1:] + else: + final_query = "/samlp:Response" + final_query += assertion_expr + else: + assertion_id = assertion_reference_nodes[0].get('URI') + final_query = '/samlp:Response' + assertion_expr + "[@ID=$tagid]" + tagid = assertion_id[1:] + final_query += xpath_expr + return self._query(final_query, tagid) + + def _query(self, query, tagid=None): + """ + Extracts nodes that match the query from the Response + + :param query: Xpath Expresion + :type query: String + + :param tagid: Tag ID + :type query: String + + :returns: The queried nodes + :rtype: list + """ + if self.encrypted: + document = self.decrypted_document + else: + document = self.document + return OneLogin_Saml2_XML.query(document, query, None, tagid) + + def _decrypt_assertion(self, xml): + """ + Decrypts the Assertion + + :raises: Exception if no private key available + :param xml: Encrypted Assertion + :type xml: Element + :returns: Decrypted Assertion + :rtype: Element + """ + key = self._settings.get_sp_key() + debug = self._settings.is_debug_active() + + if not key: + raise OneLogin_Saml2_Error( + 'No private key available to decrypt the assertion, check settings', + OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND + ) + + encrypted_assertion_nodes = OneLogin_Saml2_XML.query(xml, '/samlp:Response/saml:EncryptedAssertion') + if encrypted_assertion_nodes: + encrypted_data_nodes = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], '//saml:EncryptedAssertion/xenc:EncryptedData') + if encrypted_data_nodes: + keyinfo = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], '//saml:EncryptedAssertion/xenc:EncryptedData/ds:KeyInfo') + if not keyinfo: + raise OneLogin_Saml2_ValidationError( + 'No KeyInfo present, invalid Assertion', + OneLogin_Saml2_ValidationError.KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA + ) + keyinfo = keyinfo[0] + children = keyinfo.getchildren() + if not children: + raise OneLogin_Saml2_ValidationError( + 'KeyInfo has no children nodes, invalid Assertion', + OneLogin_Saml2_ValidationError.CHILDREN_NODE_NOT_FOUND_IN_KEYINFO + ) + for child in children: + if 'RetrievalMethod' in child.tag: + if child.attrib['Type'] != 'http://www.w3.org/2001/04/xmlenc#EncryptedKey': + raise OneLogin_Saml2_ValidationError( + 'Unsupported Retrieval Method found', + OneLogin_Saml2_ValidationError.UNSUPPORTED_RETRIEVAL_METHOD + ) + uri = child.attrib['URI'] + if not uri.startswith('#'): + break + uri = uri.split('#')[1] + encrypted_key = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], './xenc:EncryptedKey[@Id=$tagid]', None, uri) + if encrypted_key: + keyinfo.append(encrypted_key[0]) + + encrypted_data = encrypted_data_nodes[0] + decrypted = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key, debug=debug, inplace=True) + xml.replace(encrypted_assertion_nodes[0], decrypted) + return xml + +
    [docs] def get_error(self): + """ + After executing a validation process, if it fails this method returns the cause + """ + return self._error
    + +
    [docs] def get_xml_document(self): + """ + Returns the SAML Response document (If contains an encrypted assertion, decrypts it) + + :return: Decrypted XML response document + :rtype: DOMDocument + """ + if self.encrypted: + return self.decrypted_document + else: + return self.document
    + +
    [docs] def get_id(self): + """ + :returns: the ID of the response + :rtype: string + """ + return self.document.get('ID', None)
    + +
    [docs] def get_assertion_id(self): + """ + :returns: the ID of the assertion in the response + :rtype: string + """ + if not self.validate_num_assertions(): + raise OneLogin_Saml2_ValidationError( + 'SAML Response must contain 1 assertion', + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS + ) + return self._query_assertion('')[0].get('ID', None)
    + +
    [docs] def get_assertion_issue_instant(self): + """ + :returns: the IssueInstant of the assertion in the response + :rtype: unix/posix timestamp|None + """ + if not self.validate_num_assertions(): + raise OneLogin_Saml2_ValidationError( + 'SAML Response must contain 1 assertion', + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS + ) + issue_instant = self._query_assertion('')[0].get('IssueInstant', None) + return OneLogin_Saml2_Utils.parse_SAML_to_time(issue_instant)
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/settings.html b/docs/saml2/_modules/onelogin/saml2/settings.html new file mode 100644 index 00000000..70185c17 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/settings.html @@ -0,0 +1,961 @@ + + + + + + onelogin.saml2.settings — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.settings

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Settings class
    +
    +Copyright (c) 2010-2021 OneLogin, Inc.
    +MIT License
    +
    +Setting class of OneLogin's Python Toolkit.
    +
    +"""
    +from time import time
    +import re
    +from os.path import dirname, exists, join, sep
    +
    +from onelogin.saml2 import compat
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.errors import OneLogin_Saml2_Error
    +from onelogin.saml2.metadata import OneLogin_Saml2_Metadata
    +from onelogin.saml2.utils import OneLogin_Saml2_Utils
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +try:
    +    import ujson as json
    +except ImportError:
    +    import json
    +
    +try:
    +    basestring
    +except NameError:
    +    basestring = str
    +
    +# Regex from Django Software Foundation and individual contributors.
    +# Released under a BSD 3-Clause License
    +url_regex = re.compile(
    +    r'^(?:[a-z0-9\.\-]*)://'  # scheme is validated separately
    +    r'(?:(?:[A-Z0-9_](?:[A-Z0-9-_]{0,61}[A-Z0-9_])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'  # domain...
    +    r'localhost|'  # localhost...
    +    r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|'  # ...or ipv4
    +    r'\[?[A-F0-9]*:[A-F0-9:]+\]?)'  # ...or ipv6
    +    r'(?::\d+)?'  # optional port
    +    r'(?:/?|[/?]\S+)$', re.IGNORECASE)
    +url_regex_single_label_domain = re.compile(
    +    r'^(?:[a-z0-9\.\-]*)://'  # scheme is validated separately
    +    r'(?:(?:[A-Z0-9_](?:[A-Z0-9-_]{0,61}[A-Z0-9_])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'  # domain...
    +    r'(?:[A-Z0-9_](?:[A-Z0-9-_]{0,61}[A-Z0-9_]))|'  # single-label-domain
    +    r'localhost|'  # localhost...
    +    r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|'  # ...or ipv4
    +    r'\[?[A-F0-9]*:[A-F0-9:]+\]?)'  # ...or ipv6
    +    r'(?::\d+)?'  # optional port
    +    r'(?:/?|[/?]\S+)$', re.IGNORECASE)
    +url_schemes = ['http', 'https', 'ftp', 'ftps']
    +
    +
    +
    [docs]def validate_url(url, allow_single_label_domain=False): + """ + Auxiliary method to validate an urllib + :param url: An url to be validated + :type url: string + :param allow_single_label_domain: In order to allow or not single label domain + :type url: bool + :returns: True if the url is valid + :rtype: bool + """ + + scheme = url.split('://')[0].lower() + if scheme not in url_schemes: + return False + if allow_single_label_domain: + if not bool(url_regex_single_label_domain.search(url)): + return False + else: + if not bool(url_regex.search(url)): + return False + return True
    + + +
    [docs]class OneLogin_Saml2_Settings(object): + """ + + Handles the settings of the Python toolkits. + + """ + + metadata_class = OneLogin_Saml2_Metadata + + def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False): + """ + Initializes the settings: + - Sets the paths of the different folders + - Loads settings info from settings file or array/object provided + + :param settings: SAML Toolkit Settings + :type settings: dict + + :param custom_base_path: Path where are stored the settings file and the cert folder + :type custom_base_path: string + + :param sp_validation_only: Avoid the IdP validation + :type sp_validation_only: boolean + """ + self._sp_validation_only = sp_validation_only + self._paths = {} + self._strict = True + self._debug = False + self._sp = {} + self._idp = {} + self._security = {} + self._contacts = {} + self._organization = {} + self._errors = [] + + self._load_paths(base_path=custom_base_path) + self._update_paths(settings) + + if settings is None: + try: + valid = self._load_settings_from_file() + except Exception as e: + raise e + if not valid: + raise OneLogin_Saml2_Error( + 'Invalid dict settings at the file: %s', + OneLogin_Saml2_Error.SETTINGS_INVALID, + ','.join(self._errors) + ) + elif isinstance(settings, dict): + if not self._load_settings_from_dict(settings): + raise OneLogin_Saml2_Error( + 'Invalid dict settings: %s', + OneLogin_Saml2_Error.SETTINGS_INVALID, + ','.join(self._errors) + ) + else: + raise OneLogin_Saml2_Error( + 'Unsupported settings object', + OneLogin_Saml2_Error.UNSUPPORTED_SETTINGS_OBJECT + ) + + self.format_idp_cert() + if 'x509certMulti' in self._idp: + self.format_idp_cert_multi() + self.format_sp_cert() + if 'x509certNew' in self._sp: + self.format_sp_cert_new() + self.format_sp_key() + + def _load_paths(self, base_path=None): + """ + Set the paths of the different folders + """ + if base_path is None: + base_path = dirname(dirname(dirname(__file__))) + if not base_path.endswith(sep): + base_path += sep + self._paths = { + 'base': base_path, + 'cert': base_path + 'certs' + sep, + 'lib': dirname(__file__) + sep + } + + def _update_paths(self, settings): + """ + Set custom paths if necessary + """ + if not isinstance(settings, dict): + return + + if 'custom_base_path' in settings: + base_path = settings['custom_base_path'] + base_path = join(dirname(__file__), base_path) + self._load_paths(base_path) + +
    [docs] def get_base_path(self): + """ + Returns base path + + :return: The base toolkit folder path + :rtype: string + """ + return self._paths['base']
    + +
    [docs] def get_cert_path(self): + """ + Returns cert path + + :return: The cert folder path + :rtype: string + """ + return self._paths['cert']
    + +
    [docs] def set_cert_path(self, path): + """ + Set a new cert path + """ + self._paths['cert'] = path
    + +
    [docs] def get_lib_path(self): + """ + Returns lib path + + :return: The library folder path + :rtype: string + """ + return self._paths['lib']
    + +
    [docs] def get_schemas_path(self): + """ + Returns schema path + + :return: The schema folder path + :rtype: string + """ + return self._paths['lib'] + 'schemas/'
    + + def _load_settings_from_dict(self, settings): + """ + Loads settings info from a settings Dict + + :param settings: SAML Toolkit Settings + :type settings: dict + + :returns: True if the settings info is valid + :rtype: boolean + """ + errors = self.check_settings(settings) + if len(errors) == 0: + self._errors = [] + self._sp = settings['sp'] + self._idp = settings.get('idp', {}) + self._strict = settings.get('strict', True) + self._debug = settings.get('debug', False) + self._security = settings.get('security', {}) + self._contacts = settings.get('contactPerson', {}) + self._organization = settings.get('organization', {}) + + self._add_default_values() + return True + + self._errors = errors + return False + + def _load_settings_from_file(self): + """ + Loads settings info from the settings json file + + :returns: True if the settings info is valid + :rtype: boolean + """ + filename = self.get_base_path() + 'settings.json' + + if not exists(filename): + raise OneLogin_Saml2_Error( + 'Settings file not found: %s', + OneLogin_Saml2_Error.SETTINGS_FILE_NOT_FOUND, + filename + ) + + # In the php toolkit instead of being a json file it is a php file and + # it is directly included + with open(filename, 'r') as json_data: + settings = json.loads(json_data.read()) + + advanced_filename = self.get_base_path() + 'advanced_settings.json' + if exists(advanced_filename): + with open(advanced_filename, 'r') as json_data: + settings.update(json.loads(json_data.read())) # Merge settings + + return self._load_settings_from_dict(settings) + + def _add_default_values(self): + """ + Add default values if the settings info is not complete + """ + self._sp.setdefault('assertionConsumerService', {}) + self._sp['assertionConsumerService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_POST) + + self._sp.setdefault('attributeConsumingService', {}) + + self._sp.setdefault('singleLogoutService', {}) + self._sp['singleLogoutService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT) + + self._idp.setdefault('singleLogoutService', {}) + + # Related to nameID + self._sp.setdefault('NameIDFormat', OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED) + self._security.setdefault('nameIdEncrypted', False) + + # Metadata format + self._security.setdefault('metadataValidUntil', None) # None means use default + self._security.setdefault('metadataCacheDuration', None) # None means use default + + # Sign provided + self._security.setdefault('authnRequestsSigned', False) + self._security.setdefault('logoutRequestSigned', False) + self._security.setdefault('logoutResponseSigned', False) + self._security.setdefault('signMetadata', False) + + # Sign expected + self._security.setdefault('wantMessagesSigned', False) + self._security.setdefault('wantAssertionsSigned', False) + + # NameID element expected + self._security.setdefault('wantNameId', True) + + # Encrypt expected + self._security.setdefault('wantAssertionsEncrypted', False) + self._security.setdefault('wantNameIdEncrypted', False) + + # Signature Algorithm + self._security.setdefault('signatureAlgorithm', OneLogin_Saml2_Constants.RSA_SHA256) + + # Digest Algorithm + self._security.setdefault('digestAlgorithm', OneLogin_Saml2_Constants.SHA256) + + # Reject Deprecated Algorithms + self._security.setdefault('rejectDeprecatedAlgorithm', False) + + # AttributeStatement required by default + self._security.setdefault('wantAttributeStatement', True) + + # Disallow duplicate attribute names by default + self._security.setdefault('allowRepeatAttributeName', False) + + self._idp.setdefault('x509cert', '') + self._idp.setdefault('certFingerprint', '') + self._idp.setdefault('certFingerprintAlgorithm', 'sha1') + + self._sp.setdefault('x509cert', '') + self._sp.setdefault('privateKey', '') + + self._security.setdefault('requestedAuthnContext', True) + self._security.setdefault('requestedAuthnContextComparison', 'exact') + self._security.setdefault('failOnAuthnContextMismatch', False) + +
    [docs] def check_settings(self, settings): + """ + Checks the settings info. + + :param settings: Dict with settings data + :type settings: dict + + :returns: Errors found on the settings data + :rtype: list + """ + assert isinstance(settings, dict) + + errors = [] + if not isinstance(settings, dict) or len(settings) == 0: + errors.append('invalid_syntax') + else: + if not self._sp_validation_only: + errors += self.check_idp_settings(settings) + sp_errors = self.check_sp_settings(settings) + errors += sp_errors + + return errors
    + +
    [docs] def check_idp_settings(self, settings): + """ + Checks the IdP settings info. + :param settings: Dict with settings data + :type settings: dict + :returns: Errors found on the IdP settings data + :rtype: list + """ + assert isinstance(settings, dict) + + errors = [] + if not isinstance(settings, dict) or len(settings) == 0: + errors.append('invalid_syntax') + else: + if not settings.get('idp'): + errors.append('idp_not_found') + else: + allow_single_domain_urls = self._get_allow_single_label_domain(settings) + idp = settings['idp'] + if not idp.get('entityId'): + errors.append('idp_entityId_not_found') + + if not idp.get('singleSignOnService', {}).get('url'): + errors.append('idp_sso_not_found') + elif not validate_url(idp['singleSignOnService']['url'], allow_single_domain_urls): + errors.append('idp_sso_url_invalid') + + slo_url = idp.get('singleLogoutService', {}).get('url') + if slo_url and not validate_url(slo_url, allow_single_domain_urls): + errors.append('idp_slo_url_invalid') + + if 'security' in settings: + security = settings['security'] + + exists_x509 = bool(idp.get('x509cert')) + exists_fingerprint = bool(idp.get('certFingerprint')) + + exists_multix509sign = 'x509certMulti' in idp and \ + 'signing' in idp['x509certMulti'] and \ + idp['x509certMulti']['signing'] + exists_multix509enc = 'x509certMulti' in idp and \ + 'encryption' in idp['x509certMulti'] and \ + idp['x509certMulti']['encryption'] + + want_assert_sign = bool(security.get('wantAssertionsSigned')) + want_mes_signed = bool(security.get('wantMessagesSigned')) + nameid_enc = bool(security.get('nameIdEncrypted')) + + if (want_assert_sign or want_mes_signed) and \ + not (exists_x509 or exists_fingerprint or exists_multix509sign): + errors.append('idp_cert_or_fingerprint_not_found_and_required') + if nameid_enc and not (exists_x509 or exists_multix509enc): + errors.append('idp_cert_not_found_and_required') + return errors
    + +
    [docs] def check_sp_settings(self, settings): + """ + Checks the SP settings info. + :param settings: Dict with settings data + :type settings: dict + :returns: Errors found on the SP settings data + :rtype: list + """ + assert isinstance(settings, dict) + + errors = [] + if not isinstance(settings, dict) or not settings: + errors.append('invalid_syntax') + else: + if not settings.get('sp'): + errors.append('sp_not_found') + else: + allow_single_domain_urls = self._get_allow_single_label_domain(settings) + # check_sp_certs uses self._sp so I add it + old_sp = self._sp + self._sp = settings['sp'] + + sp = settings['sp'] + security = settings.get('security', {}) + + if not sp.get('entityId'): + errors.append('sp_entityId_not_found') + + if not sp.get('assertionConsumerService', {}).get('url'): + errors.append('sp_acs_not_found') + elif not validate_url(sp['assertionConsumerService']['url'], allow_single_domain_urls): + errors.append('sp_acs_url_invalid') + + if sp.get('attributeConsumingService'): + attributeConsumingService = sp['attributeConsumingService'] + if 'serviceName' not in attributeConsumingService: + errors.append('sp_attributeConsumingService_serviceName_not_found') + elif not isinstance(attributeConsumingService['serviceName'], basestring): + errors.append('sp_attributeConsumingService_serviceName_type_invalid') + + if 'requestedAttributes' not in attributeConsumingService: + errors.append('sp_attributeConsumingService_requestedAttributes_not_found') + elif not isinstance(attributeConsumingService['requestedAttributes'], list): + errors.append('sp_attributeConsumingService_serviceName_type_invalid') + else: + for req_attrib in attributeConsumingService['requestedAttributes']: + if 'name' not in req_attrib: + errors.append('sp_attributeConsumingService_requestedAttributes_name_not_found') + if 'name' in req_attrib and not req_attrib['name'].strip(): + errors.append('sp_attributeConsumingService_requestedAttributes_name_invalid') + if 'attributeValue' in req_attrib and type(req_attrib['attributeValue']) != list: + errors.append('sp_attributeConsumingService_requestedAttributes_attributeValue_type_invalid') + if 'isRequired' in req_attrib and type(req_attrib['isRequired']) != bool: + errors.append('sp_attributeConsumingService_requestedAttributes_isRequired_type_invalid') + + if "serviceDescription" in attributeConsumingService and not isinstance(attributeConsumingService['serviceDescription'], basestring): + errors.append('sp_attributeConsumingService_serviceDescription_type_invalid') + + slo_url = sp.get('singleLogoutService', {}).get('url') + if slo_url and not validate_url(slo_url, allow_single_domain_urls): + errors.append('sp_sls_url_invalid') + + if 'signMetadata' in security and isinstance(security['signMetadata'], dict): + if 'keyFileName' not in security['signMetadata'] or \ + 'certFileName' not in security['signMetadata']: + errors.append('sp_signMetadata_invalid') + + authn_sign = bool(security.get('authnRequestsSigned')) + logout_req_sign = bool(security.get('logoutRequestSigned')) + logout_res_sign = bool(security.get('logoutResponseSigned')) + want_assert_enc = bool(security.get('wantAssertionsEncrypted')) + want_nameid_enc = bool(security.get('wantNameIdEncrypted')) + + if not self.check_sp_certs(): + if authn_sign or logout_req_sign or logout_res_sign or \ + want_assert_enc or want_nameid_enc: + errors.append('sp_cert_not_found_and_required') + + if 'contactPerson' in settings: + types = settings['contactPerson'] + valid_types = ['technical', 'support', 'administrative', 'billing', 'other'] + for c_type in types: + if c_type not in valid_types: + errors.append('contact_type_invalid') + break + + for c_type in settings['contactPerson']: + contact = settings['contactPerson'][c_type] + if ('givenName' not in contact or len(contact['givenName']) == 0) or \ + ('emailAddress' not in contact or len(contact['emailAddress']) == 0): + errors.append('contact_not_enought_data') + break + + if 'organization' in settings: + for org in settings['organization']: + organization = settings['organization'][org] + if ('name' not in organization or len(organization['name']) == 0) or \ + ('displayname' not in organization or len(organization['displayname']) == 0) or \ + ('url' not in organization or len(organization['url']) == 0): + errors.append('organization_not_enought_data') + break + # Restores the value that had the self._sp + if 'old_sp' in locals(): + self._sp = old_sp + + return errors
    + +
    [docs] def check_sp_certs(self): + """ + Checks if the x509 certs of the SP exists and are valid. + :returns: If the x509 certs of the SP exists and are valid + :rtype: boolean + """ + key = self.get_sp_key() + cert = self.get_sp_cert() + return key is not None and cert is not None
    + +
    [docs] def get_idp_sso_url(self): + """ + Gets the IdP SSO URL. + + :returns: An URL, the SSO endpoint of the IdP + :rtype: string + """ + idp_data = self.get_idp_data() + return idp_data['singleSignOnService']['url']
    + +
    [docs] def get_idp_slo_url(self): + """ + Gets the IdP SLO URL. + + :returns: An URL, the SLO endpoint of the IdP + :rtype: string + """ + idp_data = self.get_idp_data() + if 'url' in idp_data['singleLogoutService']: + return idp_data['singleLogoutService']['url']
    + +
    [docs] def get_idp_slo_response_url(self): + """ + Gets the IdP SLO return URL for IdP-initiated logout. + + :returns: an URL, the SLO return endpoint of the IdP + :rtype: string + """ + idp_data = self.get_idp_data() + if 'url' in idp_data['singleLogoutService']: + return idp_data['singleLogoutService'].get('responseUrl', self.get_idp_slo_url())
    + +
    [docs] def get_sp_key(self): + """ + Returns the x509 private key of the SP. + :returns: SP private key + :rtype: string or None + """ + key = self._sp.get('privateKey') + key_file_name = self._paths['cert'] + 'sp.key' + + if not key and exists(key_file_name): + with open(key_file_name) as f: + key = f.read() + + return key or None
    + +
    [docs] def get_sp_cert(self): + """ + Returns the x509 public cert of the SP. + :returns: SP public cert + :rtype: string or None + """ + cert = self._sp.get('x509cert') + cert_file_name = self._paths['cert'] + 'sp.crt' + + if not cert and exists(cert_file_name): + with open(cert_file_name) as f: + cert = f.read() + + return cert or None
    + +
    [docs] def get_sp_cert_new(self): + """ + Returns the x509 public of the SP planned + to be used soon instead the other public cert + :returns: SP public cert new + :rtype: string or None + """ + cert = self._sp.get('x509certNew') + cert_file_name = self._paths['cert'] + 'sp_new.crt' + + if not cert and exists(cert_file_name): + with open(cert_file_name) as f: + cert = f.read() + + return cert or None
    + +
    [docs] def get_idp_cert(self): + """ + Returns the x509 public cert of the IdP. + :returns: IdP public cert + :rtype: string + """ + cert = self._idp.get('x509cert') + cert_file_name = self.get_cert_path() + 'idp.crt' + if not cert and exists(cert_file_name): + with open(cert_file_name) as f: + cert = f.read() + return cert or None
    + +
    [docs] def get_idp_data(self): + """ + Gets the IdP data. + + :returns: IdP info + :rtype: dict + """ + return self._idp
    + +
    [docs] def get_sp_data(self): + """ + Gets the SP data. + + :returns: SP info + :rtype: dict + """ + return self._sp
    + +
    [docs] def get_security_data(self): + """ + Gets security data. + + :returns: Security info + :rtype: dict + """ + return self._security
    + +
    [docs] def get_contacts(self): + """ + Gets contact data. + + :returns: Contacts info + :rtype: dict + """ + return self._contacts
    + +
    [docs] def get_organization(self): + """ + Gets organization data. + + :returns: Organization info + :rtype: dict + """ + return self._organization
    + +
    [docs] def get_sp_metadata(self): + """ + Gets the SP metadata. The XML representation. + :returns: SP metadata (xml) + :rtype: string + """ + metadata = self.metadata_class.builder( + self._sp, self._security['authnRequestsSigned'], + self._security['wantAssertionsSigned'], + self._security['metadataValidUntil'], + self._security['metadataCacheDuration'], + self.get_contacts(), self.get_organization() + ) + + add_encryption = self._security['wantNameIdEncrypted'] or self._security['wantAssertionsEncrypted'] + + cert_new = self.get_sp_cert_new() + metadata = self.metadata_class.add_x509_key_descriptors(metadata, cert_new, add_encryption) + + cert = self.get_sp_cert() + metadata = self.metadata_class.add_x509_key_descriptors(metadata, cert, add_encryption) + + # Sign metadata + if 'signMetadata' in self._security and self._security['signMetadata'] is not False: + if self._security['signMetadata'] is True: + # Use the SP's normal key to sign the metadata: + if not cert: + raise OneLogin_Saml2_Error( + 'Cannot sign metadata: missing SP public key certificate.', + OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND + ) + cert_metadata = cert + key_metadata = self.get_sp_key() + if not key_metadata: + raise OneLogin_Saml2_Error( + 'Cannot sign metadata: missing SP private key.', + OneLogin_Saml2_Error.PRIVATE_KEY_FILE_NOT_FOUND + ) + else: + # Use a custom key to sign the metadata: + if ('keyFileName' not in self._security['signMetadata'] or + 'certFileName' not in self._security['signMetadata']): + raise OneLogin_Saml2_Error( + 'Invalid Setting: signMetadata value of the sp is not valid', + OneLogin_Saml2_Error.SETTINGS_INVALID_SYNTAX + ) + key_file_name = self._security['signMetadata']['keyFileName'] + cert_file_name = self._security['signMetadata']['certFileName'] + key_metadata_file = self._paths['cert'] + key_file_name + cert_metadata_file = self._paths['cert'] + cert_file_name + + try: + with open(key_metadata_file, 'r') as f_metadata_key: + key_metadata = f_metadata_key.read() + except IOError: + raise OneLogin_Saml2_Error( + 'Private key file not readable: %s', + OneLogin_Saml2_Error.PRIVATE_KEY_FILE_NOT_FOUND, + key_metadata_file + ) + + try: + with open(cert_metadata_file, 'r') as f_metadata_cert: + cert_metadata = f_metadata_cert.read() + except IOError: + raise OneLogin_Saml2_Error( + 'Public cert file not readable: %s', + OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND, + cert_metadata_file + ) + + signature_algorithm = self._security['signatureAlgorithm'] + digest_algorithm = self._security['digestAlgorithm'] + + metadata = self.metadata_class.sign_metadata(metadata, key_metadata, cert_metadata, signature_algorithm, digest_algorithm) + + return metadata
    + +
    [docs] def validate_metadata(self, xml): + """ + Validates an XML SP Metadata. + + :param xml: Metadata's XML that will be validate + :type xml: string + + :returns: The list of found errors + :rtype: list + """ + + assert isinstance(xml, compat.text_types) + + if len(xml) == 0: + raise Exception('Empty string supplied as input') + + errors = [] + root = OneLogin_Saml2_XML.validate_xml(xml, 'saml-schema-metadata-2.0.xsd', self._debug) + if isinstance(root, str): + errors.append(root) + else: + if root.tag != '{%s}EntityDescriptor' % OneLogin_Saml2_Constants.NS_MD: + errors.append('noEntityDescriptor_xml') + else: + if (len(root.findall('.//md:SPSSODescriptor', namespaces=OneLogin_Saml2_Constants.NSMAP))) != 1: + errors.append('onlySPSSODescriptor_allowed_xml') + else: + valid_until, cache_duration = root.get('validUntil'), root.get('cacheDuration') + + if valid_until: + valid_until = OneLogin_Saml2_Utils.parse_SAML_to_time(valid_until) + expire_time = OneLogin_Saml2_Utils.get_expire_time(cache_duration, valid_until) + if expire_time is not None and int(time()) > int(expire_time): + errors.append('expired_xml') + + # TODO: Validate Sign + + return errors
    + +
    [docs] def format_idp_cert(self): + """ + Formats the IdP cert. + """ + self._idp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self._idp['x509cert'])
    + +
    [docs] def format_idp_cert_multi(self): + """ + Formats the Multple IdP certs. + """ + if 'x509certMulti' in self._idp: + if 'signing' in self._idp['x509certMulti']: + for idx in range(len(self._idp['x509certMulti']['signing'])): + self._idp['x509certMulti']['signing'][idx] = OneLogin_Saml2_Utils.format_cert(self._idp['x509certMulti']['signing'][idx]) + + if 'encryption' in self._idp['x509certMulti']: + for idx in range(len(self._idp['x509certMulti']['encryption'])): + self._idp['x509certMulti']['encryption'][idx] = OneLogin_Saml2_Utils.format_cert(self._idp['x509certMulti']['encryption'][idx])
    + +
    [docs] def format_sp_cert(self): + """ + Formats the SP cert. + """ + self._sp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self._sp['x509cert'])
    + +
    [docs] def format_sp_cert_new(self): + """ + Formats the SP cert. + """ + self._sp['x509certNew'] = OneLogin_Saml2_Utils.format_cert(self._sp['x509certNew'])
    + +
    [docs] def format_sp_key(self): + """ + Formats the private key. + """ + self._sp['privateKey'] = OneLogin_Saml2_Utils.format_private_key(self._sp['privateKey'])
    + +
    [docs] def get_errors(self): + """ + Returns an array with the errors, the array is empty when the settings is ok. + + :returns: Errors + :rtype: list + """ + return self._errors
    + +
    [docs] def set_strict(self, value): + """ + Activates or deactivates the strict mode. + + :param value: Strict parameter + :type value: boolean + """ + assert isinstance(value, bool) + + self._strict = value
    + +
    [docs] def is_strict(self): + """ + Returns if the 'strict' mode is active. + + :returns: Strict parameter + :rtype: boolean + """ + return self._strict
    + +
    [docs] def is_debug_active(self): + """ + Returns if the debug is active. + + :returns: Debug parameter + :rtype: boolean + """ + return self._debug
    + + def _get_allow_single_label_domain(self, settings): + security = settings.get('security', {}) + return 'allowSingleLabelDomains' in security.keys() and security['allowSingleLabelDomains']
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/utils.html b/docs/saml2/_modules/onelogin/saml2/utils.html new file mode 100644 index 00000000..623a06f6 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/utils.html @@ -0,0 +1,1173 @@ + + + + + + onelogin.saml2.utils — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.utils

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Utils class
    +
    +
    +Auxiliary class of SAML Python Toolkit.
    +
    +"""
    +
    +import base64
    +import warnings
    +from copy import deepcopy
    +import calendar
    +from datetime import datetime
    +from hashlib import sha1, sha256, sha384, sha512
    +from isodate import parse_duration as duration_parser
    +import re
    +from textwrap import wrap
    +from functools import wraps
    +from uuid import uuid4
    +from xml.dom.minidom import Element
    +import zlib
    +import xmlsec
    +
    +from onelogin.saml2 import compat
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.errors import OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
    +from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
    +
    +
    +try:
    +    from urllib.parse import quote_plus, urlsplit, urlunsplit  # py3
    +except ImportError:
    +    from urlparse import urlsplit, urlunsplit
    +    from urllib import quote_plus  # py2
    +
    +
    +
    [docs]def return_false_on_exception(func): + """ + Decorator. When applied to a function, it will, by default, suppress any exceptions + raised by that function and return False. It may be overridden by passing a + "raise_exceptions" keyword argument when calling the wrapped function. + """ + @wraps(func) + def exceptfalse(*args, **kwargs): + if not kwargs.pop('raise_exceptions', False): + try: + return func(*args, **kwargs) + except Exception: + return False + else: + return func(*args, **kwargs) + return exceptfalse
    + + +
    [docs]class OneLogin_Saml2_Utils(object): + """ + + Auxiliary class that contains several utility methods to parse time, + urls, add sign, encrypt, decrypt, sign validation, handle xml ... + + """ + + RESPONSE_SIGNATURE_XPATH = '/samlp:Response/ds:Signature' + ASSERTION_SIGNATURE_XPATH = '/samlp:Response/saml:Assertion/ds:Signature' + + TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" + TIME_FORMAT_2 = "%Y-%m-%dT%H:%M:%S.%fZ" + TIME_FORMAT_WITH_FRAGMENT = re.compile(r'^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})(\.\d*)?Z?$') + +
    [docs] @staticmethod + def escape_url(url, lowercase_urlencoding=False): + """ + escape the non-safe symbols in url + The encoding used by ADFS 3.0 is not compatible with + python's quote_plus (ADFS produces lower case hex numbers and quote_plus produces + upper case hex numbers) + :param url: the url to escape + :type url: str + + :param lowercase_urlencoding: lowercase or no + :type lowercase_urlencoding: boolean + + :return: the escaped url + :rtype str + """ + encoded = quote_plus(url) + return re.sub(r"%[A-F0-9]{2}", lambda m: m.group(0).lower(), encoded) if lowercase_urlencoding else encoded
    + +
    [docs] @staticmethod + def b64encode(data): + """base64 encode""" + return compat.to_string(base64.b64encode(compat.to_bytes(data)))
    + +
    [docs] @staticmethod + def b64decode(data): + """base64 decode""" + return base64.b64decode(data)
    + +
    [docs] @staticmethod + def decode_base64_and_inflate(value, ignore_zip=False): + """ + base64 decodes and then inflates according to RFC1951 + :param value: a deflated and encoded string + :type value: string + :param ignore_zip: ignore zip errors + :returns: the string after decoding and inflating + :rtype: string + """ + encoded = OneLogin_Saml2_Utils.b64decode(value) + try: + return zlib.decompress(encoded, -15) + except zlib.error: + if not ignore_zip: + raise + return encoded
    + +
    [docs] @staticmethod + def deflate_and_base64_encode(value): + """ + Deflates and then base64 encodes a string + :param value: The string to deflate and encode + :type value: string + :returns: The deflated and encoded string + :rtype: string + """ + return OneLogin_Saml2_Utils.b64encode(zlib.compress(compat.to_bytes(value))[2:-4])
    + +
    [docs] @staticmethod + def format_cert(cert, heads=True): + """ + Returns a x509 cert (adding header & footer if required). + + :param cert: A x509 unformatted cert + :type: string + + :param heads: True if we want to include head and footer + :type: boolean + + :returns: Formatted cert + :rtype: string + """ + x509_cert = cert.replace('\x0D', '') + x509_cert = x509_cert.replace('\r', '') + x509_cert = x509_cert.replace('\n', '') + if len(x509_cert) > 0: + x509_cert = x509_cert.replace('-----BEGIN CERTIFICATE-----', '') + x509_cert = x509_cert.replace('-----END CERTIFICATE-----', '') + x509_cert = x509_cert.replace(' ', '') + + if heads: + x509_cert = "-----BEGIN CERTIFICATE-----\n" + "\n".join(wrap(x509_cert, 64)) + "\n-----END CERTIFICATE-----\n" + + return x509_cert
    + +
    [docs] @staticmethod + def format_private_key(key, heads=True): + """ + Returns a private key (adding header & footer if required). + + :param key A private key + :type: string + + :param heads: True if we want to include head and footer + :type: boolean + + :returns: Formated private key + :rtype: string + """ + private_key = key.replace('\x0D', '') + private_key = private_key.replace('\r', '') + private_key = private_key.replace('\n', '') + if len(private_key) > 0: + if private_key.find('-----BEGIN PRIVATE KEY-----') != -1: + private_key = private_key.replace('-----BEGIN PRIVATE KEY-----', '') + private_key = private_key.replace('-----END PRIVATE KEY-----', '') + private_key = private_key.replace(' ', '') + if heads: + private_key = "-----BEGIN PRIVATE KEY-----\n" + "\n".join(wrap(private_key, 64)) + "\n-----END PRIVATE KEY-----\n" + else: + private_key = private_key.replace('-----BEGIN RSA PRIVATE KEY-----', '') + private_key = private_key.replace('-----END RSA PRIVATE KEY-----', '') + private_key = private_key.replace(' ', '') + if heads: + private_key = "-----BEGIN RSA PRIVATE KEY-----\n" + "\n".join(wrap(private_key, 64)) + "\n-----END RSA PRIVATE KEY-----\n" + return private_key
    + +
    [docs] @staticmethod + def redirect(url, parameters={}, request_data={}): + """ + Executes a redirection to the provided url (or return the target url). + + :param url: The target url + :type: string + + :param parameters: Extra parameters to be passed as part of the url + :type: dict + + :param request_data: The request as a dict + :type: dict + + :returns: Url + :rtype: string + """ + assert isinstance(url, compat.str_type) + assert isinstance(parameters, dict) + + if url.startswith('/'): + url = '%s%s' % (OneLogin_Saml2_Utils.get_self_url_host(request_data), url) + + # Verify that the URL is to a http or https site. + if re.search('^https?://', url, flags=re.IGNORECASE) is None: + raise OneLogin_Saml2_Error( + 'Redirect to invalid URL: ' + url, + OneLogin_Saml2_Error.REDIRECT_INVALID_URL + ) + + # Add encoded parameters + if url.find('?') < 0: + param_prefix = '?' + else: + param_prefix = '&' + + for name, value in parameters.items(): + + if value is None: + param = OneLogin_Saml2_Utils.escape_url(name) + elif isinstance(value, list): + param = '' + for val in value: + param += OneLogin_Saml2_Utils.escape_url(name) + '[]=' + OneLogin_Saml2_Utils.escape_url(val) + '&' + if len(param) > 0: + param = param[0:-1] + else: + param = OneLogin_Saml2_Utils.escape_url(name) + '=' + OneLogin_Saml2_Utils.escape_url(value) + + if param: + url += param_prefix + param + param_prefix = '&' + + return url
    + +
    [docs] @staticmethod + def get_self_url_host(request_data): + """ + Returns the protocol + the current host + the port (if different than + common ports). + + :param request_data: The request as a dict + :type: dict + + :return: Url + :rtype: string + """ + current_host = OneLogin_Saml2_Utils.get_self_host(request_data) + protocol = 'https' if OneLogin_Saml2_Utils.is_https(request_data) else 'http' + + if request_data.get('server_port') is not None: + warnings.warn( + 'The server_port key in request data is deprecated. ' + 'The http_host key should include a port, if required.', + category=DeprecationWarning, + ) + port_suffix = ':%s' % request_data['server_port'] + if not current_host.endswith(port_suffix): + if not ((protocol == 'https' and port_suffix == ':443') or (protocol == 'http' and port_suffix == ':80')): + current_host += port_suffix + + return '%s://%s' % (protocol, current_host)
    + +
    [docs] @staticmethod + def get_self_host(request_data): + """ + Returns the current host (which may include a port number part). + + :param request_data: The request as a dict + :type: dict + + :return: The current host + :rtype: string + """ + if 'http_host' in request_data: + return request_data['http_host'] + elif 'server_name' in request_data: + warnings.warn("The server_name key in request data is undocumented & deprecated.", category=DeprecationWarning) + return request_data['server_name'] + raise Exception('No hostname defined')
    + +
    [docs] @staticmethod + def is_https(request_data): + """ + Checks if https or http. + + :param request_data: The request as a dict + :type: dict + + :return: False if https is not active + :rtype: boolean + """ + is_https = 'https' in request_data and request_data['https'] != 'off' + # TODO: this use of server_port should be removed too + is_https = is_https or ('server_port' in request_data and str(request_data['server_port']) == '443') + return is_https
    + +
    [docs] @staticmethod + def get_self_url_no_query(request_data): + """ + Returns the URL of the current host + current view. + + :param request_data: The request as a dict + :type: dict + + :return: The url of current host + current view + :rtype: string + """ + self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) + script_name = request_data['script_name'] + if script_name: + if script_name[0] != '/': + script_name = '/' + script_name + else: + script_name = '' + self_url_no_query = self_url_host + script_name + if 'path_info' in request_data: + self_url_no_query += request_data['path_info'] + + return self_url_no_query
    + +
    [docs] @staticmethod + def get_self_routed_url_no_query(request_data): + """ + Returns the routed URL of the current host + current view. + + :param request_data: The request as a dict + :type: dict + + :return: The url of current host + current view + :rtype: string + """ + self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) + route = '' + if 'request_uri' in request_data and request_data['request_uri']: + route = request_data['request_uri'] + if 'query_string' in request_data and request_data['query_string']: + route = route.replace(request_data['query_string'], '') + + return self_url_host + route
    + +
    [docs] @staticmethod + def get_self_url(request_data): + """ + Returns the URL of the current host + current view + query. + + :param request_data: The request as a dict + :type: dict + + :return: The url of current host + current view + query + :rtype: string + """ + self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) + + request_uri = '' + if 'request_uri' in request_data: + request_uri = request_data['request_uri'] + if not request_uri.startswith('/'): + match = re.search('^https?://[^/]*(/.*)', request_uri) + if match is not None: + request_uri = match.groups()[0] + + return self_url_host + request_uri
    + +
    [docs] @staticmethod + def generate_unique_id(): + """ + Generates an unique string (used for example as ID for assertions). + + :return: A unique string + :rtype: string + """ + return 'ONELOGIN_%s' % sha1(compat.to_bytes(uuid4().hex)).hexdigest()
    + +
    [docs] @staticmethod + def parse_time_to_SAML(time): + r""" + Converts a UNIX timestamp to SAML2 timestamp on the form + yyyy-mm-ddThh:mm:ss(\.s+)?Z. + + :param time: The time we should convert (DateTime). + :type: string + + :return: SAML2 timestamp. + :rtype: string + """ + data = datetime.utcfromtimestamp(float(time)) + return data.strftime(OneLogin_Saml2_Utils.TIME_FORMAT)
    + +
    [docs] @staticmethod + def parse_SAML_to_time(timestr): + r""" + Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z + to a UNIX timestamp. The sub-second part is ignored. + + :param timestr: The time we should convert (SAML Timestamp). + :type: string + + :return: Converted to a unix timestamp. + :rtype: int + """ + try: + data = datetime.strptime(timestr, OneLogin_Saml2_Utils.TIME_FORMAT) + except ValueError: + try: + data = datetime.strptime(timestr, OneLogin_Saml2_Utils.TIME_FORMAT_2) + except ValueError: + elem = OneLogin_Saml2_Utils.TIME_FORMAT_WITH_FRAGMENT.match(timestr) + if not elem: + raise Exception("time data %s does not match format %s" % (timestr, r'yyyy-mm-ddThh:mm:ss(\.s+)?Z')) + data = datetime.strptime(elem.groups()[0] + "Z", OneLogin_Saml2_Utils.TIME_FORMAT) + + return calendar.timegm(data.utctimetuple())
    + +
    [docs] @staticmethod + def now(): + """ + :return: unix timestamp of actual time. + :rtype: int + """ + return calendar.timegm(datetime.utcnow().utctimetuple())
    + +
    [docs] @staticmethod + def parse_duration(duration, timestamp=None): + """ + Interprets a ISO8601 duration value relative to a given timestamp. + + :param duration: The duration, as a string. + :type: string + + :param timestamp: The unix timestamp we should apply the duration to. + Optional, default to the current time. + :type: string + + :return: The new timestamp, after the duration is applied. + :rtype: int + """ + assert isinstance(duration, compat.str_type) + assert timestamp is None or isinstance(timestamp, int) + + timedelta = duration_parser(duration) + if timestamp is None: + data = datetime.utcnow() + timedelta + else: + data = datetime.utcfromtimestamp(timestamp) + timedelta + return calendar.timegm(data.utctimetuple())
    + +
    [docs] @staticmethod + def get_expire_time(cache_duration=None, valid_until=None): + """ + Compares 2 dates and returns the earliest. + + :param cache_duration: The duration, as a string. + :type: string + + :param valid_until: The valid until date, as a string or as a timestamp + :type: string + + :return: The expiration time. + :rtype: int + """ + expire_time = None + + if cache_duration is not None: + expire_time = OneLogin_Saml2_Utils.parse_duration(cache_duration) + + if valid_until is not None: + if isinstance(valid_until, int): + valid_until_time = valid_until + else: + valid_until_time = OneLogin_Saml2_Utils.parse_SAML_to_time(valid_until) + if expire_time is None or expire_time > valid_until_time: + expire_time = valid_until_time + + if expire_time is not None: + return '%d' % expire_time + return None
    + +
    [docs] @staticmethod + def delete_local_session(callback=None): + """ + Deletes the local session. + """ + + if callback is not None: + callback()
    + +
    [docs] @staticmethod + def calculate_x509_fingerprint(x509_cert, alg='sha1'): + """ + Calculates the fingerprint of a formatted x509cert. + + :param x509_cert: x509 cert formatted + :type: string + + :param alg: The algorithm to build the fingerprint + :type: string + + :returns: fingerprint + :rtype: string + """ + assert isinstance(x509_cert, compat.str_type) + + lines = x509_cert.split('\n') + data = '' + inData = False + + for line in lines: + # Remove '\r' from end of line if present. + line = line.rstrip() + if not inData: + if line == '-----BEGIN CERTIFICATE-----': + inData = True + elif line == '-----BEGIN PUBLIC KEY-----' or line == '-----BEGIN RSA PRIVATE KEY-----': + # This isn't an X509 certificate. + return None + else: + if line == '-----END CERTIFICATE-----': + break + + # Append the current line to the certificate data. + data += line + + if not data: + return None + + decoded_data = base64.b64decode(compat.to_bytes(data)) + + if alg == 'sha512': + fingerprint = sha512(decoded_data) + elif alg == 'sha384': + fingerprint = sha384(decoded_data) + elif alg == 'sha256': + fingerprint = sha256(decoded_data) + else: + fingerprint = sha1(decoded_data) + + return fingerprint.hexdigest().lower()
    + +
    [docs] @staticmethod + def format_finger_print(fingerprint): + """ + Formats a fingerprint. + + :param fingerprint: fingerprint + :type: string + + :returns: Formatted fingerprint + :rtype: string + """ + formatted_fingerprint = fingerprint.replace(':', '') + return formatted_fingerprint.lower()
    + +
    [docs] @staticmethod + def generate_name_id(value, sp_nq, sp_format=None, cert=None, debug=False, nq=None): + """ + Generates a nameID. + + :param value: fingerprint + :type: string + + :param sp_nq: SP Name Qualifier + :type: string + + :param sp_format: SP Format + :type: string + + :param cert: IdP Public Cert to encrypt the nameID + :type: string + + :param debug: Activate the xmlsec debug + :type: bool + + :returns: DOMElement | XMLSec nameID + :rtype: string + + :param nq: IDP Name Qualifier + :type: string + """ + + root = OneLogin_Saml2_XML.make_root("{%s}container" % OneLogin_Saml2_Constants.NS_SAML) + name_id = OneLogin_Saml2_XML.make_child(root, '{%s}NameID' % OneLogin_Saml2_Constants.NS_SAML) + if sp_nq is not None: + name_id.set('SPNameQualifier', sp_nq) + if sp_format is not None: + name_id.set('Format', sp_format) + if nq is not None: + name_id.set('NameQualifier', nq) + name_id.text = value + + if cert is not None: + xmlsec.enable_debug_trace(debug) + + # Load the public cert + manager = xmlsec.KeysManager() + manager.add_key(xmlsec.Key.from_memory(cert, xmlsec.KeyFormat.CERT_PEM, None)) + + # Prepare for encryption + enc_data = xmlsec.template.encrypted_data_create( + root, xmlsec.Transform.AES128, type=xmlsec.EncryptionType.ELEMENT, ns="xenc") + + xmlsec.template.encrypted_data_ensure_cipher_value(enc_data) + key_info = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig") + enc_key = xmlsec.template.add_encrypted_key(key_info, xmlsec.Transform.RSA_OAEP) + xmlsec.template.encrypted_data_ensure_cipher_value(enc_key) + + # Encrypt! + enc_ctx = xmlsec.EncryptionContext(manager) + enc_ctx.key = xmlsec.Key.generate(xmlsec.KeyData.AES, 128, xmlsec.KeyDataType.SESSION) + enc_data = enc_ctx.encrypt_xml(enc_data, name_id) + return '<saml:EncryptedID>' + compat.to_string(OneLogin_Saml2_XML.to_string(enc_data)) + '</saml:EncryptedID>' + else: + return OneLogin_Saml2_XML.extract_tag_text(root, "saml:NameID")
    + +
    [docs] @staticmethod + def get_status(dom): + """ + Gets Status from a Response. + + :param dom: The Response as XML + :type: Document + + :returns: The Status, an array with the code and a message. + :rtype: dict + """ + status = {} + + status_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status') + if len(status_entry) != 1: + raise OneLogin_Saml2_ValidationError( + 'Missing Status on response', + OneLogin_Saml2_ValidationError.MISSING_STATUS + ) + + code_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status/samlp:StatusCode', status_entry[0]) + if len(code_entry) != 1: + raise OneLogin_Saml2_ValidationError( + 'Missing Status Code on response', + OneLogin_Saml2_ValidationError.MISSING_STATUS_CODE + ) + code = code_entry[0].values()[0] + status['code'] = code + + status['msg'] = '' + message_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status/samlp:StatusMessage', status_entry[0]) + if len(message_entry) == 0: + subcode_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status/samlp:StatusCode/samlp:StatusCode', status_entry[0]) + if len(subcode_entry) == 1: + status['msg'] = subcode_entry[0].values()[0] + elif len(message_entry) == 1: + status['msg'] = OneLogin_Saml2_XML.element_text(message_entry[0]) + + return status
    + +
    [docs] @staticmethod + def decrypt_element(encrypted_data, key, debug=False, inplace=False): + """ + Decrypts an encrypted element. + + :param encrypted_data: The encrypted data. + :type: lxml.etree.Element | DOMElement | basestring + + :param key: The key. + :type: string + + :param debug: Activate the xmlsec debug + :type: bool + + :param inplace: update passed data with decrypted result + :type: bool + + :returns: The decrypted element. + :rtype: lxml.etree.Element + """ + + if isinstance(encrypted_data, Element): + encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml())) + if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class): + encrypted_data = deepcopy(encrypted_data) + elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class): + encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data) + + xmlsec.enable_debug_trace(debug) + manager = xmlsec.KeysManager() + + manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None)) + enc_ctx = xmlsec.EncryptionContext(manager) + return enc_ctx.decrypt(encrypted_data)
    + +
    [docs] @staticmethod + def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256, digest_algorithm=OneLogin_Saml2_Constants.SHA256): + """ + Adds signature key and senders certificate to an element (Message or + Assertion). + + :param xml: The element we should sign + :type: string | Document + + :param key: The private key + :type: string + + :param cert: The public + :type: string + + :param debug: Activate the xmlsec debug + :type: bool + + :param sign_algorithm: Signature algorithm method + :type sign_algorithm: string + + :param digest_algorithm: Digest algorithm method + :type digest_algorithm: string + + :returns: Signed XML + :rtype: string + """ + if xml is None or xml == '': + raise Exception('Empty string supplied as input') + + elem = OneLogin_Saml2_XML.to_etree(xml) + + sign_algorithm_transform_map = { + OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.Transform.DSA_SHA1, + OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1, + OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256, + OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384, + OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512 + } + sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA256) + + signature = xmlsec.template.create(elem, xmlsec.Transform.EXCL_C14N, sign_algorithm_transform, ns='ds') + + issuer = OneLogin_Saml2_XML.query(elem, '//saml:Issuer') + if len(issuer) > 0: + issuer = issuer[0] + issuer.addnext(signature) + elem_to_sign = issuer.getparent() + else: + entity_descriptor = OneLogin_Saml2_XML.query(elem, '//md:EntityDescriptor') + if len(entity_descriptor) > 0: + elem.insert(0, signature) + else: + elem[0].insert(0, signature) + elem_to_sign = elem + + elem_id = elem_to_sign.get('ID', None) + if elem_id is not None: + if elem_id: + elem_id = '#' + elem_id + else: + generated_id = generated_id = OneLogin_Saml2_Utils.generate_unique_id() + elem_id = '#' + generated_id + elem_to_sign.attrib['ID'] = generated_id + + xmlsec.enable_debug_trace(debug) + xmlsec.tree.add_ids(elem_to_sign, ["ID"]) + + digest_algorithm_transform_map = { + OneLogin_Saml2_Constants.SHA1: xmlsec.Transform.SHA1, + OneLogin_Saml2_Constants.SHA256: xmlsec.Transform.SHA256, + OneLogin_Saml2_Constants.SHA384: xmlsec.Transform.SHA384, + OneLogin_Saml2_Constants.SHA512: xmlsec.Transform.SHA512 + } + digest_algorithm_transform = digest_algorithm_transform_map.get(digest_algorithm, xmlsec.Transform.SHA256) + + ref = xmlsec.template.add_reference(signature, digest_algorithm_transform, uri=elem_id) + xmlsec.template.add_transform(ref, xmlsec.Transform.ENVELOPED) + xmlsec.template.add_transform(ref, xmlsec.Transform.EXCL_C14N) + key_info = xmlsec.template.ensure_key_info(signature) + xmlsec.template.add_x509_data(key_info) + + dsig_ctx = xmlsec.SignatureContext() + sign_key = xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None) + sign_key.load_cert_from_memory(cert, xmlsec.KeyFormat.PEM) + + dsig_ctx.key = sign_key + dsig_ctx.sign(signature) + + return OneLogin_Saml2_XML.to_string(elem)
    + +
    [docs] @staticmethod + @return_false_on_exception + def validate_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False, xpath=None, multicerts=None): + """ + Validates a signature (Message or Assertion). + + :param xml: The element we should validate + :type: string | Document + + :param cert: The public cert + :type: string + + :param fingerprint: The fingerprint of the public cert + :type: string + + :param fingerprintalg: The algorithm used to build the fingerprint + :type: string + + :param validatecert: If true, will verify the signature and if the cert is valid. + :type: bool + + :param debug: Activate the xmlsec debug + :type: bool + + :param xpath: The xpath of the signed element + :type: string + + :param multicerts: Multiple public certs + :type: list + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + """ + if xml is None or xml == '': + raise Exception('Empty string supplied as input') + + elem = OneLogin_Saml2_XML.to_etree(xml) + xmlsec.enable_debug_trace(debug) + xmlsec.tree.add_ids(elem, ["ID"]) + + if xpath: + signature_nodes = OneLogin_Saml2_XML.query(elem, xpath) + else: + signature_nodes = OneLogin_Saml2_XML.query(elem, OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH) + + if len(signature_nodes) == 0: + signature_nodes = OneLogin_Saml2_XML.query(elem, OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH) + + if len(signature_nodes) == 1: + signature_node = signature_nodes[0] + + if not multicerts: + return OneLogin_Saml2_Utils.validate_node_sign(signature_node, elem, cert, fingerprint, fingerprintalg, validatecert, debug, raise_exceptions=True) + else: + # If multiple certs are provided, I may ignore cert and + # fingerprint provided by the method and just check the + # certs multicerts + fingerprint = fingerprintalg = None + for cert in multicerts: + if OneLogin_Saml2_Utils.validate_node_sign(signature_node, elem, cert, fingerprint, fingerprintalg, validatecert, False, raise_exceptions=False): + return True + raise OneLogin_Saml2_ValidationError( + 'Signature validation failed. SAML Response rejected.', + OneLogin_Saml2_ValidationError.INVALID_SIGNATURE + ) + else: + raise OneLogin_Saml2_ValidationError( + 'Expected exactly one signature node; got {}.'.format(len(signature_nodes)), + OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES + )
    + +
    [docs] @staticmethod + @return_false_on_exception + def validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False): + """ + Validates a signature of a EntityDescriptor. + + :param xml: The element we should validate + :type: string | Document + + :param cert: The public cert + :type: string + + :param fingerprint: The fingerprint of the public cert + :type: string + + :param fingerprintalg: The algorithm used to build the fingerprint + :type: string + + :param validatecert: If true, will verify the signature and if the cert is valid. + :type: bool + + :param debug: Activate the xmlsec debug + :type: bool + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + """ + if xml is None or xml == '': + raise Exception('Empty string supplied as input') + + elem = OneLogin_Saml2_XML.to_etree(xml) + xmlsec.enable_debug_trace(debug) + xmlsec.tree.add_ids(elem, ["ID"]) + + signature_nodes = OneLogin_Saml2_XML.query(elem, '/md:EntitiesDescriptor/ds:Signature') + + if len(signature_nodes) == 0: + signature_nodes += OneLogin_Saml2_XML.query(elem, '/md:EntityDescriptor/ds:Signature') + + if len(signature_nodes) == 0: + signature_nodes += OneLogin_Saml2_XML.query(elem, '/md:EntityDescriptor/md:SPSSODescriptor/ds:Signature') + signature_nodes += OneLogin_Saml2_XML.query(elem, '/md:EntityDescriptor/md:IDPSSODescriptor/ds:Signature') + + if len(signature_nodes) > 0: + for signature_node in signature_nodes: + # Raises exception if invalid + OneLogin_Saml2_Utils.validate_node_sign(signature_node, elem, cert, fingerprint, fingerprintalg, validatecert, debug, raise_exceptions=True) + return True + else: + raise Exception('Could not validate metadata signature: No signature nodes found.')
    + +
    [docs] @staticmethod + @return_false_on_exception + def validate_node_sign(signature_node, elem, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False): + """ + Validates a signature node. + + :param signature_node: The signature node + :type: Node + + :param xml: The element we should validate + :type: Document + + :param cert: The public cert + :type: string + + :param fingerprint: The fingerprint of the public cert + :type: string + + :param fingerprintalg: The algorithm used to build the fingerprint + :type: string + + :param validatecert: If true, will verify the signature and if the cert is valid. + :type: bool + + :param debug: Activate the xmlsec debug + :type: bool + + :param raise_exceptions: Whether to return false on failure or raise an exception + :type raise_exceptions: Boolean + """ + if (cert is None or cert == '') and fingerprint: + x509_certificate_nodes = OneLogin_Saml2_XML.query(signature_node, '//ds:Signature/ds:KeyInfo/ds:X509Data/ds:X509Certificate') + if len(x509_certificate_nodes) > 0: + x509_certificate_node = x509_certificate_nodes[0] + x509_cert_value = OneLogin_Saml2_XML.element_text(x509_certificate_node) + x509_cert_value_formatted = OneLogin_Saml2_Utils.format_cert(x509_cert_value) + x509_fingerprint_value = OneLogin_Saml2_Utils.calculate_x509_fingerprint(x509_cert_value_formatted, fingerprintalg) + if fingerprint == x509_fingerprint_value: + cert = x509_cert_value_formatted + + if cert is None or cert == '': + raise OneLogin_Saml2_Error( + 'Could not validate node signature: No certificate provided.', + OneLogin_Saml2_Error.CERT_NOT_FOUND + ) + + # Check if Reference URI is empty + # reference_elem = OneLogin_Saml2_XML.query(signature_node, '//ds:Reference') + # if len(reference_elem) > 0: + # if reference_elem[0].get('URI') == '': + # reference_elem[0].set('URI', '#%s' % signature_node.getparent().get('ID')) + + if validatecert: + manager = xmlsec.KeysManager() + manager.load_cert_from_memory(cert, xmlsec.KeyFormat.CERT_PEM, xmlsec.KeyDataType.TRUSTED) + dsig_ctx = xmlsec.SignatureContext(manager) + else: + dsig_ctx = xmlsec.SignatureContext() + dsig_ctx.key = xmlsec.Key.from_memory(cert, xmlsec.KeyFormat.CERT_PEM, None) + + dsig_ctx.set_enabled_key_data([xmlsec.KeyData.X509]) + + try: + dsig_ctx.verify(signature_node) + except Exception as err: + raise OneLogin_Saml2_ValidationError( + 'Signature validation failed. SAML Response rejected. %s', + OneLogin_Saml2_ValidationError.INVALID_SIGNATURE, + str(err) + ) + + return True
    + +
    [docs] @staticmethod + def sign_binary(msg, key, algorithm=xmlsec.Transform.RSA_SHA256, debug=False): + """ + Sign binary message + + :param msg: The element we should validate + :type: bytes + + :param key: The private key + :type: string + + :param debug: Activate the xmlsec debug + :type: bool + + :return signed message + :rtype str + """ + + if isinstance(msg, str): + msg = msg.encode('utf8') + + xmlsec.enable_debug_trace(debug) + dsig_ctx = xmlsec.SignatureContext() + dsig_ctx.key = xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None) + return dsig_ctx.sign_binary(compat.to_bytes(msg), algorithm)
    + +
    [docs] @staticmethod + def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_Saml2_Constants.RSA_SHA256, debug=False): + """ + Validates signed binary data (Used to validate GET Signature). + + :param signed_query: The element we should validate + :type: string + + + :param signature: The signature that will be validate + :type: string + + :param cert: The public cert + :type: string + + :param algorithm: Signature algorithm + :type: string + + :param debug: Activate the xmlsec debug + :type: bool + """ + try: + xmlsec.enable_debug_trace(debug) + dsig_ctx = xmlsec.SignatureContext() + dsig_ctx.key = xmlsec.Key.from_memory(cert, xmlsec.KeyFormat.CERT_PEM, None) + + sign_algorithm_transform_map = { + OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.Transform.DSA_SHA1, + OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1, + OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256, + OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384, + OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512 + } + sign_algorithm_transform = sign_algorithm_transform_map.get(algorithm, xmlsec.Transform.RSA_SHA256) + + dsig_ctx.verify_binary(compat.to_bytes(signed_query), + sign_algorithm_transform, + compat.to_bytes(signature)) + return True + except xmlsec.Error as e: + if debug: + print(e) + return False
    + +
    [docs] @staticmethod + def normalize_url(url): + """ + Returns normalized URL for comparison. + This method converts the netloc to lowercase, as it should be case-insensitive (per RFC 4343, RFC 7617) + If standardization fails, the original URL is returned + Python documentation indicates that URL split also normalizes query strings if empty query fields are present + + :param url: URL + :type url: String + + :returns: A normalized URL, or the given URL string if parsing fails + :rtype: String + """ + try: + scheme, netloc, path, query, fragment = urlsplit(url) + normalized_url = urlunsplit((scheme.lower(), netloc.lower(), path, query, fragment)) + return normalized_url + except Exception: + return url
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/xml_templates.html b/docs/saml2/_modules/onelogin/saml2/xml_templates.html new file mode 100644 index 00000000..13dd9b94 --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/xml_templates.html @@ -0,0 +1,256 @@ + + + + + + onelogin.saml2.xml_templates — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.xml_templates

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_Auth class
    +
    +
    +Main class of SAML Python Toolkit.
    +
    +Initializes the SP SAML instance
    +
    +"""
    +
    +
    +
    [docs]class OneLogin_Saml2_Templates(object): + + ATTRIBUTE = """ + <saml:Attribute Name="%s" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> + <saml:AttributeValue xsi:type="xs:string">%s</saml:AttributeValue> + </saml:Attribute>""" + + AUTHN_REQUEST = """\ +<samlp:AuthnRequest + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" + ID="%(id)s" + Version="2.0"%(provider_name)s%(force_authn_str)s%(is_passive_str)s + IssueInstant="%(issue_instant)s" + Destination="%(destination)s" + ProtocolBinding="%(acs_binding)s" + AssertionConsumerServiceURL="%(assertion_url)s"%(attr_consuming_service_str)s> + <saml:Issuer>%(entity_id)s</saml:Issuer>%(subject_str)s%(nameid_policy_str)s +%(requested_authn_context_str)s +</samlp:AuthnRequest>""" + + LOGOUT_REQUEST = """\ +<samlp:LogoutRequest + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" + ID="%(id)s" + Version="2.0" + IssueInstant="%(issue_instant)s" + Destination="%(single_logout_url)s"> + <saml:Issuer>%(entity_id)s</saml:Issuer> + %(name_id)s + %(session_index)s +</samlp:LogoutRequest>""" + + LOGOUT_RESPONSE = """\ +<samlp:LogoutResponse + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" + ID="%(id)s" + Version="2.0" + IssueInstant="%(issue_instant)s" + Destination="%(destination)s" + InResponseTo="%(in_response_to)s"> + <saml:Issuer>%(entity_id)s</saml:Issuer> + <samlp:Status> + <samlp:StatusCode Value="%(status)s" /> + </samlp:Status> +</samlp:LogoutResponse>""" + + MD_CONTACT_PERSON = """\ + <md:ContactPerson contactType="%(type)s"> + <md:GivenName>%(name)s</md:GivenName> + <md:EmailAddress>%(email)s</md:EmailAddress> + </md:ContactPerson>""" + + MD_SLS = """\ + <md:SingleLogoutService Binding="%(binding)s" + Location="%(location)s" />\n""" + + MD_REQUESTED_ATTRIBUTE = """\ + <md:RequestedAttribute Name="%(req_attr_name)s"%(req_attr_nameformat_str)s%(req_attr_isrequired_str)s%(req_attr_aux_str)s""" + + MD_ATTR_CONSUMER_SERVICE = """\ + <md:AttributeConsumingService index="1"> + <md:ServiceName xml:lang="en">%(service_name)s</md:ServiceName> +%(attr_cs_desc)s%(requested_attribute_str)s + </md:AttributeConsumingService>\n""" + + MD_ENTITY_DESCRIPTOR = """\ +<?xml version="1.0"?> +<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" + %(valid)s + %(cache)s + entityID="%(entity_id)s"> + <md:SPSSODescriptor AuthnRequestsSigned="%(authnsign)s" WantAssertionsSigned="%(wsign)s" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"> +%(sls)s <md:NameIDFormat>%(name_id_format)s</md:NameIDFormat> + <md:AssertionConsumerService Binding="%(binding)s" + Location="%(location)s" + index="1" /> +%(attribute_consuming_service)s </md:SPSSODescriptor> +%(organization)s +%(contacts)s +</md:EntityDescriptor>""" + + MD_ORGANISATION = """\ + <md:Organization> + <md:OrganizationName xml:lang="%(lang)s">%(name)s</md:OrganizationName> + <md:OrganizationDisplayName xml:lang="%(lang)s">%(display_name)s</md:OrganizationDisplayName> + <md:OrganizationURL xml:lang="%(lang)s">%(url)s</md:OrganizationURL> + </md:Organization>""" + + RESPONSE = """\ +<samlp:Response + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" + ID="%(id)s" + InResponseTo="%(in_response_to)s" + Version="2.0" + IssueInstant="%(issue_instant)s" + Destination="%(destination)s"> + <saml:Issuer>%(entity_id)s</saml:Issuer> + <samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> + <samlp:StatusCode + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + Value="%(status)s"> + </samlp:StatusCode> + </samlp:Status> + <saml:Assertion + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + Version="2.0" + ID="%(assertion_id)s" + IssueInstant="%(issue_instant)s"> + <saml:Issuer>%(entity_id)s</saml:Issuer> + <saml:Subject> + <saml:NameID + NameQualifier="%(entity_id)s" + SPNameQualifier="%(requester)s" + Format="%(name_id_policy)s">%(name_id)s</saml:NameID> + <saml:SubjectConfirmation Method="%(cm)s"> + <saml:SubjectConfirmationData + NotOnOrAfter="%(not_after)s" + InResponseTo="%(in_response_to)s" + Recipient="%(destination)s"> + </saml:SubjectConfirmationData> + </saml:SubjectConfirmation> + </saml:Subject> + <saml:Conditions NotBefore="%(not_before)s" NotOnOrAfter="%(not_after)s"> + <saml:AudienceRestriction> + <saml:Audience>%(requester)s</saml:Audience> + </saml:AudienceRestriction> + </saml:Conditions> + <saml:AuthnStatement + AuthnInstant="%(issue_instant)s" + SessionIndex="%(session_index)s" + SessionNotOnOrAfter="%(not_after)s"> +%(authn_context)s + </saml:AuthnStatement> + <saml:AttributeStatement> +%(attributes)s + </saml:AttributeStatement> + </saml:Assertion> +</samlp:Response>"""
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/xml_utils.html b/docs/saml2/_modules/onelogin/saml2/xml_utils.html new file mode 100644 index 00000000..3c26761b --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/xml_utils.html @@ -0,0 +1,276 @@ + + + + + + onelogin.saml2.xml_utils — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.xml_utils

    +# -*- coding: utf-8 -*-
    +
    +""" OneLogin_Saml2_XML class
    +
    +
    +Auxiliary class of SAML Python Toolkit.
    +
    +"""
    +
    +from os.path import join, dirname
    +from lxml import etree
    +from onelogin.saml2 import compat
    +from onelogin.saml2.constants import OneLogin_Saml2_Constants
    +from onelogin.saml2.xmlparser import tostring, fromstring
    +
    +
    +for prefix, url in OneLogin_Saml2_Constants.NSMAP.items():
    +    etree.register_namespace(prefix, url)
    +
    +
    +
    [docs]class OneLogin_Saml2_XML(object): + _element_class = type(etree.Element('root')) + _parse_etree = staticmethod(fromstring) + _schema_class = etree.XMLSchema + _text_class = compat.text_types + _bytes_class = compat.bytes_type + _unparse_etree = staticmethod(tostring) + + dump = staticmethod(etree.dump) + make_root = staticmethod(etree.Element) + make_child = staticmethod(etree.SubElement) + +
    [docs] @staticmethod + def to_string(xml, **kwargs): + """ + Serialize an element to an encoded string representation of its XML tree. + :param xml: The root node + :type xml: str|bytes|xml.dom.minidom.Document|etree.Element + :returns: string representation of xml + :rtype: string + """ + + if isinstance(xml, OneLogin_Saml2_XML._text_class): + return xml + + if isinstance(xml, OneLogin_Saml2_XML._element_class): + OneLogin_Saml2_XML.cleanup_namespaces(xml) + return OneLogin_Saml2_XML._unparse_etree(xml, **kwargs) + + raise ValueError("unsupported type %r" % type(xml))
    + +
    [docs] @staticmethod + def to_etree(xml): + """ + Parses an XML document or fragment from a string. + :param xml: the string to parse + :type xml: str|bytes|xml.dom.minidom.Document|etree.Element + :returns: the root node + :rtype: OneLogin_Saml2_XML._element_class + """ + if isinstance(xml, OneLogin_Saml2_XML._element_class): + return xml + if isinstance(xml, OneLogin_Saml2_XML._bytes_class): + return OneLogin_Saml2_XML._parse_etree(xml, forbid_dtd=True, forbid_entities=True) + if isinstance(xml, OneLogin_Saml2_XML._text_class): + return OneLogin_Saml2_XML._parse_etree(compat.to_bytes(xml), forbid_dtd=True, forbid_entities=True) + + raise ValueError('unsupported type %r' % type(xml))
    + +
    [docs] @staticmethod + def validate_xml(xml, schema, debug=False): + """ + Validates a xml against a schema + :param xml: The xml that will be validated + :type xml: str|bytes|xml.dom.minidom.Document|etree.Element + :param schema: The schema + :type schema: string + :param debug: If debug is active, the parse-errors will be showed + :type debug: bool + :returns: Error code or the DomDocument of the xml + :rtype: xml.dom.minidom.Document + """ + + assert isinstance(schema, compat.str_type) + try: + xml = OneLogin_Saml2_XML.to_etree(xml) + except Exception as e: + if debug: + print(e) + return 'unloaded_xml' + + schema_file = join(dirname(__file__), 'schemas', schema) + with open(schema_file, 'r') as f_schema: + xmlschema = OneLogin_Saml2_XML._schema_class(etree.parse(f_schema)) + + if not xmlschema.validate(xml): + if debug: + print('Errors validating the metadata: ') + for error in xmlschema.error_log: + print(error.message) + return 'invalid_xml' + return xml
    + +
    [docs] @staticmethod + def query(dom, query, context=None, tagid=None): + """ + Extracts nodes that match the query from the Element + + :param dom: The root of the lxml objet + :type: Element + + :param query: Xpath Expresion + :type: string + + :param context: Context Node + :type: DOMElement + + :param tagid: Tag ID + :type query: String + + :returns: The queried nodes + :rtype: list + """ + if context is None: + source = dom + else: + source = context + + if tagid is None: + return source.xpath(query, namespaces=OneLogin_Saml2_Constants.NSMAP) + else: + return source.xpath(query, tagid=tagid, namespaces=OneLogin_Saml2_Constants.NSMAP)
    + +
    [docs] @staticmethod + def cleanup_namespaces(tree_or_element, top_nsmap=None, keep_ns_prefixes=None): + """ + Keeps the xmlns:xs namespace intact when etree.cleanup_namespaces is invoked. + :param tree_or_element: An XML tree or element + :type tree_or_element: etree.Element + :param top_nsmap: A mapping from namespace prefixes to namespace URIs + :type top_nsmap: dict + :param keep_ns_prefixes: List of prefixes that should not be removed as part of the cleanup + :type keep_ns_prefixes: list + :returns: An XML tree or element + :rtype: etree.Element + """ + all_prefixes_to_keep = [ + OneLogin_Saml2_Constants.NS_PREFIX_XS, + OneLogin_Saml2_Constants.NS_PREFIX_XSI, + OneLogin_Saml2_Constants.NS_PREFIX_XSD + ] + + if keep_ns_prefixes: + all_prefixes_to_keep = list(set(all_prefixes_to_keep.extend(keep_ns_prefixes))) + + return etree.cleanup_namespaces(tree_or_element, keep_ns_prefixes=all_prefixes_to_keep)
    + +
    [docs] @staticmethod + def extract_tag_text(xml, tagname): + open_tag = compat.to_bytes("<%s" % tagname) + close_tag = compat.to_bytes("</%s>" % tagname) + + xml = OneLogin_Saml2_XML.to_string(xml) + start = xml.find(open_tag) + assert start != -1 + + end = xml.find(close_tag, start) + len(close_tag) + assert end != -1 + return compat.to_string(xml[start:end])
    + +
    [docs] @staticmethod + def element_text(node): + # Double check, the LXML Parser already removes comments + etree.strip_tags(node, etree.Comment) + return node.text
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/onelogin/saml2/xmlparser.html b/docs/saml2/_modules/onelogin/saml2/xmlparser.html new file mode 100644 index 00000000..7058367c --- /dev/null +++ b/docs/saml2/_modules/onelogin/saml2/xmlparser.html @@ -0,0 +1,285 @@ + + + + + + onelogin.saml2.xmlparser — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for onelogin.saml2.xmlparser

    +# -*- coding: utf-8 -*-
    +
    +# Based on the lxml example from defusedxml
    +# DTDForbidden, EntitiesForbidden, NotSupportedError are clones of the classes defined at defusedxml
    +#
    +# Copyright (c) 2013 by Christian Heimes <christian@python.org>
    +# Licensed to PSF under a Contributor Agreement.
    +# See https://www.python.org/psf/license for licensing details.
    +"""lxml.etree protection"""
    +
    +from __future__ import print_function, absolute_import
    +
    +import threading
    +
    +from lxml import etree as _etree
    +
    +LXML3 = _etree.LXML_VERSION[0] >= 3
    +
    +__origin__ = "lxml.etree"
    +
    +tostring = _etree.tostring
    +
    +
    +
    [docs]class DTDForbidden(ValueError): + """Document type definition is forbidden + """ + + def __init__(self, name, sysid, pubid): + super(DTDForbidden, self).__init__() + self.name = name + self.sysid = sysid + self.pubid = pubid + + def __str__(self): + tpl = "DTDForbidden(name='{}', system_id={!r}, public_id={!r})" + return tpl.format(self.name, self.sysid, self.pubid)
    + + +
    [docs]class EntitiesForbidden(ValueError): + """Entity definition is forbidden + """ + + def __init__(self, name, value, base, sysid, pubid, notation_name): + super(EntitiesForbidden, self).__init__() + self.name = name + self.value = value + self.base = base + self.sysid = sysid + self.pubid = pubid + self.notation_name = notation_name + + def __str__(self): + tpl = "EntitiesForbidden(name='{}', system_id={!r}, public_id={!r})" + return tpl.format(self.name, self.sysid, self.pubid)
    + + +
    [docs]class NotSupportedError(ValueError): + """The operation is not supported + """
    + + +
    [docs]class RestrictedElement(_etree.ElementBase): + """A restricted Element class that filters out instances of some classes + """ + + __slots__ = () + blacklist = (_etree._Entity, _etree._ProcessingInstruction, _etree._Comment) + + def _filter(self, iterator): + blacklist = self.blacklist + for child in iterator: + if isinstance(child, blacklist): + continue + yield child + + def __iter__(self): + iterator = super(RestrictedElement, self).__iter__() + return self._filter(iterator) + +
    [docs] def iterchildren(self, tag=None, reversed=False): + iterator = super(RestrictedElement, self).iterchildren(tag=tag, reversed=reversed) + return self._filter(iterator)
    + +
    [docs] def iter(self, tag=None, *tags): + iterator = super(RestrictedElement, self).iter(tag=tag, *tags) + return self._filter(iterator)
    + +
    [docs] def iterdescendants(self, tag=None, *tags): + iterator = super(RestrictedElement, self).iterdescendants(tag=tag, *tags) + return self._filter(iterator)
    + +
    [docs] def itersiblings(self, tag=None, preceding=False): + iterator = super(RestrictedElement, self).itersiblings(tag=tag, preceding=preceding) + return self._filter(iterator)
    + +
    [docs] def getchildren(self): + iterator = super(RestrictedElement, self).__iter__() + return list(self._filter(iterator))
    + +
    [docs] def getiterator(self, tag=None): + iterator = super(RestrictedElement, self).getiterator(tag) + return self._filter(iterator)
    + + +
    [docs]class GlobalParserTLS(threading.local): + """Thread local context for custom parser instances + """ + + parser_config = { + "resolve_entities": False, + 'remove_comments': True, + 'no_network': True, + 'remove_pis': True, + 'huge_tree': False + } + + element_class = RestrictedElement + +
    [docs] def createDefaultParser(self): + parser = _etree.XMLParser(**self.parser_config) + element_class = self.element_class + if self.element_class is not None: + lookup = _etree.ElementDefaultClassLookup(element=element_class) + parser.set_element_class_lookup(lookup) + return parser
    + +
    [docs] def setDefaultParser(self, parser): + self._default_parser = parser
    + +
    [docs] def getDefaultParser(self): + parser = getattr(self, "_default_parser", None) + if parser is None: + parser = self.createDefaultParser() + self.setDefaultParser(parser) + return parser
    + + +_parser_tls = GlobalParserTLS() +getDefaultParser = _parser_tls.getDefaultParser + + +
    [docs]def check_docinfo(elementtree, forbid_dtd=False, forbid_entities=True): + """Check docinfo of an element tree for DTD and entity declarations + The check for entity declarations needs lxml 3 or newer. lxml 2.x does + not support dtd.iterentities(). + """ + docinfo = elementtree.docinfo + if docinfo.doctype: + if forbid_dtd: + raise DTDForbidden(docinfo.doctype, docinfo.system_url, docinfo.public_id) + if forbid_entities and not LXML3: + # lxml < 3 has no iterentities() + raise NotSupportedError("Unable to check for entity declarations " "in lxml 2.x") + + if forbid_entities: + for dtd in docinfo.internalDTD, docinfo.externalDTD: + if dtd is None: + continue + for entity in dtd.iterentities(): + raise EntitiesForbidden(entity.name, entity.content, None, None, None, None)
    + + +
    [docs]def parse(source, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True): + if parser is None: + parser = getDefaultParser() + elementtree = _etree.parse(source, parser, base_url=base_url) + check_docinfo(elementtree, forbid_dtd, forbid_entities) + return elementtree
    + + +
    [docs]def fromstring(text, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True): + if parser is None: + parser = getDefaultParser() + rootelement = _etree.fromstring(text, parser, base_url=base_url) + elementtree = rootelement.getroottree() + check_docinfo(elementtree, forbid_dtd, forbid_entities) + return rootelement
    + + +XML = fromstring + + +
    [docs]def iterparse(*args, **kwargs): + raise NotSupportedError("iterparse not available")
    +
    + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/auth.html b/docs/saml2/_modules/saml2/auth.html deleted file mode 100644 index f70e70b2..00000000 --- a/docs/saml2/_modules/saml2/auth.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - - - - - - - saml2.auth — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.auth

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from base64 import b64encode
    -from urllib import urlencode, quote
    -from xml.etree.ElementTree import tostring
    -
    -import dm.xmlsec.binding as xmlsec
    -
    -from saml2.settings import OneLogin_Saml2_Settings
    -from saml2.response import OneLogin_Saml2_Response
    -from saml2.errors import OneLogin_Saml2_Error
    -from saml2.logout_response import OneLogin_Saml2_Logout_Response
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.utils import OneLogin_Saml2_Utils
    -from saml2.logout_request import OneLogin_Saml2_Logout_Request
    -from saml2.authn_request import OneLogin_Saml2_Authn_Request
    -
    -
    -
    [docs]class OneLogin_Saml2_Auth(object): - - def __init__(self, request_data, old_settings=None): - """ - Initializes the SP SAML instance. - - Arguments are: - * (dict) old_settings. Setting data - """ - self.__request_data = request_data - self.__settings = OneLogin_Saml2_Settings(old_settings) - self.__attributes = [] - self.__nameid = '' - self.__authenticated = False - self.__errors = [] - -
    [docs] def get_settings(self): - """ - Returns the settings info - :return: Setting info - :rtype: OneLogin_Saml2_Setting object - """ - return self.__settings -
    -
    [docs] def set_strict(self, value): - """ - Set the strict mode active/disable - - :param value: - :type value: bool - """ - assert isinstance(value, bool) - self.__settings.set_strict(value) -
    -
    [docs] def process_response(self, request_id=None): - """ - Process the SAML Response sent by the IdP. - - :param request_id: Is an optional argument. Is the ID of the AuthNRequest sent by this SP to the IdP. - :type request_id: string - - :raises: OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND, when a POST with a SAMLResponse is not found - """ - self.__errors = [] - - if 'post_data' in self.__request_data and 'SAMLResponse' in self.__request_data['post_data']: - # AuthnResponse -- HTTP_POST Binding - response = OneLogin_Saml2_Response(self.__settings, self.__request_data['post_data']['SAMLResponse']) - - if response.is_valid(request_id): - self.__attributes = response.get_attributes() - self.__nameid = response.get_nameid() - self.__authenticated = True - else: - self.__errors.append('invalid_response') - - else: - self.__errors.append('invalid_binding') - raise OneLogin_Saml2_Error( - 'SAML Response not found, Only supported HTTP_POST Binding', - OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND - ) -
    -
    [docs] def process_slo(self, keep_local_session=False, request_id=None, delete_session_cb=None): - """ - Process the SAML Logout Response / Logout Request sent by the IdP. - - :param keep_local_session: When false will destroy the local session, otherwise will destroy it - :type keep_local_session: bool - - :param request_id: The ID of the LogoutRequest sent by this SP to the IdP - :type request_id: string - - :returns: Redirection url - """ - self.__errors = [] - - if 'get_data' in self.__request_data and 'SAMLResponse' in self.__request_data['get_data']: - logout_response = OneLogin_Saml2_Logout_Response(self.__settings, self.__request_data['get_data']['SAMLResponse']) - if not logout_response.is_valid(self.__request_data, request_id): - self.__errors.append('invalid_logout_response') - elif logout_response.get_status() != OneLogin_Saml2_Constants.STATUS_SUCCESS: - self.__errors.append('logout_not_success') - elif not keep_local_session: - OneLogin_Saml2_Utils.delete_local_session(delete_session_cb) - - elif 'get_data' in self.__request_data and 'SAMLRequest' in self.__request_data['get_data']: - request = OneLogin_Saml2_Utils.decode_base64_and_inflate(self.__request_data['get_data']['SAMLRequest']) - if not OneLogin_Saml2_Logout_Request.is_valid(self.__settings, request, self.__request_data): - self.__errors.append('invalid_logout_request') - else: - if not keep_local_session: - OneLogin_Saml2_Utils.delete_local_session(delete_session_cb) - - in_response_to = OneLogin_Saml2_Logout_Request.get_id(request) - response_builder = OneLogin_Saml2_Logout_Response(self.__settings) - response_builder.build(in_response_to) - logout_response = response_builder.get_response() - - parameters = {'SAMLResponse': logout_response} - if 'RelayState' in self.__request_data['get_data']: - parameters['RelayState'] = self.__request_data['get_data']['RelayState'] - - security = self.__settings.get_security_data() - if 'logoutResponseSigned' in security and security['logoutResponseSigned']: - signature = self.build_response_signature(logout_response, parameters.get('RelayState', None)) - parameters['SigAlg'] = OneLogin_Saml2_Constants.RSA_SHA1 - parameters['Signature'] = signature - - return self.redirect_to(self.get_slo_url(), parameters) - - else: - self.__errors.append('invalid_binding') - raise OneLogin_Saml2_Error( - 'SAML LogoutRequest/LogoutResponse not found. Only supported HTTP_REDIRECT Binding', - OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND - ) -
    -
    [docs] def redirect_to(self, url=None, parameters={}): - """ - Redirects the user to the url past by parameter or to the url that we defined in our SSO Request. - - :param url: The target URL to redirect the user - :type url: string - :param parameters: Extra parameters to be passed as part of the url - :type parameters: dict - - :returns: Redirection url - """ - if url is None and 'RelayState' in self.__request_data['get_data']: - url = self.__request_data['get_data']['RelayState'] - return OneLogin_Saml2_Utils.redirect(url, parameters, request_data=self.__request_data) -
    -
    [docs] def is_authenticated(self): - """ - Checks if the user is authenticated or not. - - :returns: True if is authenticated, False if not - :rtype: bool - """ - return self.__authenticated -
    -
    [docs] def get_attributes(self): - """ - Returns the set of SAML attributes. - - :returns: SAML attributes - :rtype: dict - """ - return self.__attributes -
    -
    [docs] def get_nameid(self): - """ - Returns the nameID. - - :returns: NameID - :rtype: string - """ - return self.__nameid -
    -
    [docs] def get_errors(self): - """ - Returns a list with code errors if something went wrong - - :returns: List of errors - :rtype: list - """ - return self.__errors -
    -
    [docs] def get_attribute(self, name): - """ - Returns the requested SAML attribute. - - :param name: Name of the attribute - :type name: string - - :returns: Attribute value if exists or None - :rtype: string - """ - assert isinstance(name, basestring) - value = None - if name in self.__attributes.keys(): - value = self.__attributes[name] - return value -
    -
    [docs] def login(self, return_to=None): - """ - Initiates the SSO process. - - :param return_to: Optional argument. The target URL the user should be redirected to after login. - :type return_to: string - - :returns: Redirection url - """ - authn_request = OneLogin_Saml2_Authn_Request(self.__settings) - - saml_request = authn_request.get_request() - parameters = {'SAMLRequest': saml_request} - - if return_to is not None: - parameters['RelayState'] = return_to - else: - parameters['RelayState'] = OneLogin_Saml2_Utils.get_self_url_no_query(self.__request_data) - - security = self.__settings.get_security_data() - if security.get('authnRequestsSigned', False): - parameters['SigAlg'] = OneLogin_Saml2_Constants.RSA_SHA1 - parameters['Signature'] = self.build_request_signature(saml_request, parameters['RelayState']) - return self.redirect_to(self.get_sso_url(), parameters) -
    -
    [docs] def logout(self, return_to=None, name_id=None, session_index=None): - """ - Initiates the SLO process. - - :param return_to: Optional argument. The target URL the user should be redirected to after logout. - :type return_to: string - :param name_id: Optional argument. The NameID that will be set in the LogoutRequest. - :type name_id: string - :param session_index: Optional argument. SessionIndex that identifies the session of the user. - :type session_index: string - :returns: Redirection url - """ - slo_url = self.get_slo_url() - if slo_url is None: - raise OneLogin_Saml2_Error( - 'The IdP does not support Single Log Out', - OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED - ) - - logout_request = OneLogin_Saml2_Logout_Request(self.__settings) - - saml_request = logout_request.get_request() - - parameters = {'SAMLRequest': logout_request.get_request()} - if return_to is not None: - parameters['RelayState'] = return_to - else: - parameters['RelayState'] = OneLogin_Saml2_Utils.get_self_url_no_query(self.__request_data) - - security = self.__settings.get_security_data() - if security.get('logoutRequestSigned', False): - parameters['SigAlg'] = OneLogin_Saml2_Constants.RSA_SHA1 - parameters['Signature'] = self.build_request_signature(saml_request, parameters['RelayState']) - return self.redirect_to(slo_url, parameters) -
    -
    [docs] def get_sso_url(self): - """ - Gets the SSO url. - - :returns: An URL, the SSO endpoint of the IdP - :rtype: string - """ - idp_data = self.__settings.get_idp_data() - return idp_data['singleSignOnService']['url'] -
    -
    [docs] def get_slo_url(self): - """ - Gets the SLO url. - - :returns: An URL, the SLO endpoint of the IdP - :rtype: string - """ - url = None - idp_data = self.__settings.get_idp_data() - if 'singleLogoutService' in idp_data.keys() and 'url' in idp_data['singleLogoutService']: - url = idp_data['singleLogoutService']['url'] - return url -
    -
    [docs] def build_request_signature(self, saml_request, relay_state): - """ - Builds the Signature of the SAML Request. - - :param saml_request: The SAML Request - :type saml_request: string - - :param relay_state: The target URL the user should be redirected to - :type relay_state: string - """ - if not self.__settings.check_sp_certs(): - raise OneLogin_Saml2_Error( - "Trying to sign the SAML Request but can't load the SP certs", - OneLogin_Saml2_Error.SP_CERTS_NOT_FOUND - ) - - xmlsec.initialize() - - # Load the key into the xmlsec context - key = self.__settings.get_sp_key() - file_key = OneLogin_Saml2_Utils.write_temp_file(key) # FIXME avoid writing a file - - dsig_ctx = xmlsec.DSigCtx() - dsig_ctx.signKey = xmlsec.Key.load(file_key.name, xmlsec.KeyDataFormatPem, None) - file_key.close() - - data = { - 'SAMLRequest': quote(saml_request), - 'RelayState': quote(relay_state), - 'SignAlg': quote(OneLogin_Saml2_Constants.RSA_SHA1), - } - msg = urlencode(data) - signature = dsig_ctx.signBinary(msg, xmlsec.TransformRsaSha1) - return b64encode(signature) -
    -
    [docs] def build_response_signature(self, saml_response, relay_state): - """ - Builds the Signature of the SAML Response. - :param saml_request: The SAML Response - :type saml_request: string - - :param relay_state: The target URL the user should be redirected to - :type relay_state: string - """ - if not self.__settings.check_sp_certs(): - raise OneLogin_Saml2_Error( - "Trying to sign the SAML Response but can't load the SP certs", - OneLogin_Saml2_Error.SP_CERTS_NOT_FOUND - ) - - xmlsec.initialize() - - # Load the key into the xmlsec context - key = self.__settings.get_sp_key() - file_key = OneLogin_Saml2_Utils.write_temp_file(key) # FIXME avoid writing a file - - dsig_ctx = xmlsec.DSigCtx() - dsig_ctx.signKey = xmlsec.Key.load(file_key.name, xmlsec.KeyDataFormatPem, None) - file_key.close() - - data = { - 'SAMLResponse': quote(saml_response), - 'RelayState': quote(relay_state), - 'SignAlg': quote(OneLogin_Saml2_Constants.RSA_SHA1), - } - msg = urlencode(data) - import pdb; dbp.set_trace() - print msg - data2 = { - 'SAMLResponse': saml_response, - 'RelayState': relay_state, - 'SignAlg': OneLogin_Saml2_Constants.RSA_SHA1, - } - msg2 = urlencode(data2) - print msg2 - signature = dsig_ctx.signBinary(msg, xmlsec.TransformRsaSha1) - return b64encode(signature)
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/docs/saml2/_modules/saml2/authn_request.html b/docs/saml2/_modules/saml2/authn_request.html deleted file mode 100644 index 207ee7a6..00000000 --- a/docs/saml2/_modules/saml2/authn_request.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - saml2.authn_request — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.authn_request

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from base64 import b64encode
    -from datetime import datetime
    -from zlib import compress
    -
    -from saml2.utils import OneLogin_Saml2_Utils
    -from saml2.constants import OneLogin_Saml2_Constants
    -
    -
    -
    [docs]class OneLogin_Saml2_Authn_Request: - - def __init__(self, settings): - """ - Constructs the AuthnRequest object. - - Arguments are: - * (OneLogin_Saml2_Settings) settings. Setting data - """ - self.__settings = settings - - sp_data = self.__settings.get_sp_data() - security = self.__settings.get_security_data() - - uid = OneLogin_Saml2_Utils.generate_unique_id() - issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML( - int(datetime.now().strftime("%s")) - ) - - name_id_policy_format = sp_data['NameIDFormat'] - if 'wantNameIdEncrypted' in security and security['wantNameIdEncrypted']: - name_id_policy_format = OneLogin_Saml2_Constants.NAMEID_ENCRYPTED - - provider_name_str = '' - organization_data = settings.get_organization() - if isinstance(organization_data, dict): - langs = organization_data.keys() - if 'en-US' in langs: - lang = 'en-US' - else: - lang = langs[0] - if 'displayname' in organization_data[lang] and organization_data[lang]['displayname'] is not None: - provider_name_str = 'ProviderName="%s"' % organization_data[lang]['displayname'] - - request = """<samlp:AuthnRequest - xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" - xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" - ID="%(id)s" - Version="2.0" - %(provider_name)s - IssueInstant="%(issue_instant)s" - ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" - AssertionConsumerServiceURL="%(assertion_url)s"> - <saml:Issuer>%(entity_id)s</saml:Issuer> - <samlp:NameIDPolicy - Format="%(name_id_policy)s" - AllowCreate="true" /> - <samlp:RequestedAuthnContext Comparison="exact"> - <saml:AuthnContextMethodRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextMethodRef> - </samlp:RequestedAuthnContext> -</samlp:AuthnRequest>""" % { - 'id': uid, - 'provider_name': provider_name_str, - 'issue_instant': issue_instant, - 'assertion_url': sp_data['assertionConsumerService']['url'], - 'entity_id': sp_data['entityId'], - 'name_id_policy': name_id_policy_format, - } - - self.__authn_request = request - -
    [docs] def get_request(self): - """ - Returns unsigned AuthnRequest. - :return: Unsigned AuthnRequest - :rtype: str object - """ - deflated_request = compress(self.__authn_request)[2:-4] - return b64encode(deflated_request)
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/constants.html b/docs/saml2/_modules/saml2/constants.html deleted file mode 100644 index 306ec1b3..00000000 --- a/docs/saml2/_modules/saml2/constants.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - saml2.constants — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.constants

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -
    -
    [docs]class OneLogin_Saml2_Constants: - # Value added to the current time in time condition validations - ALOWED_CLOCK_DRIFT = 180 - - # NameID Formats - NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' - NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName' - NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName' - NAMEID_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos' - NAMEID_ENTITY = 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity' - NAMEID_TRANSIENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' - NAMEID_PERSISTENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' - NAMEID_ENCRYPTED = 'urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted' - - # Attribute Name Formats - ATTRNAME_FORMAT_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' - ATTRNAME_FORMAT_URI = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri' - ATTRNAME_FORMAT_BASIC = 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' - - # Namespaces - NS_SAML = 'urn:oasis:names:tc:SAML:2.0:assertion' - NS_SAMLP = 'urn:oasis:names:tc:SAML:2.0:protocol' - NS_SOAP = 'http://schemas.xmlsoap.org/soap/envelope/' - NS_MD = 'urn:oasis:names:tc:SAML:2.0:metadata' - NS_XS = 'http://www.w3.org/2001/XMLSchema' - NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance' - NS_XENC = 'http://www.w3.org/2001/04/xmlenc#' - NS_DS = 'http://www.w3.org/2000/09/xmldsig#' - - # Bindings - BINDING_HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' - BINDING_HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' - BINDING_HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact' - BINDING_SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP' - BINDING_DEFLATE = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE' - - # Auth Context Method - AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified' - AC_PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password' - AC_X509 = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509' - AC_SMARTCARD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard' - AC_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos' - - # Subject Confirmation - CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer' - CM_HOLDER_KEY = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key' - CM_SENDER_VOUCHES = 'urn:oasis:names:tc:SAML:2.0:cm:sender-vouches' - - # Status Codes - STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success' - STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester' - STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder' - STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch' - STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive' - STATUS_PARTIAL_LOGOUT = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout' - STATUS_PROXY_COUNT_EXCEEDED = 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded' - - # Crypto - RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' - - NSMAP = { - 'samlp': NS_SAMLP, - 'saml': NS_SAML, - 'ds': NS_DS, - 'xenc': NS_XENC - }
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/errors.html b/docs/saml2/_modules/saml2/errors.html deleted file mode 100644 index ef958f31..00000000 --- a/docs/saml2/_modules/saml2/errors.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - saml2.errors — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.errors

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -
    -
    [docs]class OneLogin_Saml2_Error(Exception): - - # Errors - SETTINGS_FILE_NOT_FOUND = 0 - SETTINGS_INVALID_SYNTAX = 1 - SETTINGS_INVALID = 2 - METADATA_SP_INVALID = 3 - SP_CERTS_NOT_FOUND = 4 - REDIRECT_INVALID_URL = 5 - PUBLIC_CERT_FILE_NOT_FOUND = 6 - PRIVATE_KEY_FILE_NOT_FOUND = 7 - SAML_RESPONSE_NOT_FOUND = 8 - SAML_LOGOUTMESSAGE_NOT_FOUND = 9 - SAML_LOGOUTREQUEST_INVALID = 10 - SAML_LOGOUTRESPONSE_INVALID = 11 - SAML_SINGLE_LOGOUT_NOT_SUPPORTED = 12 - - def __init__(self, message, code=0, errors=None): - """ - Initializes the Exception instance. - - Arguments are: - * (str) message. Describes the error. - * (int) code. The code error (defined in the error class). - """ - from saml2.utils import _ - - assert isinstance(message, basestring) - assert isinstance(code, int) - - if errors is not None: - message = message % errors - - Exception.__init__(self, _(message)) - self.code = code
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/logout_request.html b/docs/saml2/_modules/saml2/logout_request.html deleted file mode 100644 index 1b690dd4..00000000 --- a/docs/saml2/_modules/saml2/logout_request.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - saml2.logout_request — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.logout_request

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from base64 import b64decode
    -from datetime import datetime
    -from lxml import etree
    -from os.path import basename
    -from urllib import urlencode
    -from urlparse import parse_qs
    -from xml.dom.minidom import Document, parseString
    -
    -import dm.xmlsec.binding as xmlsec
    -
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.utils import OneLogin_Saml2_Utils
    -
    -
    -
    [docs]class OneLogin_Saml2_Logout_Request: - - def __init__(self, settings,request=None,name_id=None, session_index=None): - """ - Constructs the Logout Request object. - - Arguments are: - * (OneLogin_Saml2_Settings) settings. Setting data - """ - self.__settings = settings - - sp_data = self.__settings.get_sp_data() - idp_data = self.__settings.get_idp_data() - security = self.__settings.get_security_data() - - uid = OneLogin_Saml2_Utils.generate_unique_id() - name_id_value = OneLogin_Saml2_Utils.generate_unique_id() - issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(int(datetime.now().strftime("%s"))) - - key = None - if 'nameIdEncrypted' in security and security['nameIdEncrypted']: - key = idp_data['x509cert'] - - name_id = OneLogin_Saml2_Utils.generate_name_id( - name_id_value, - sp_data['entityId'], - sp_data['NameIDFormat'], - key - ) - - logout_request = """<samlp:LogoutRequest - xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" - xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" - ID="%(id)s" - Version="2.0" - IssueInstant="%(issue_instant)s" - Destination="%(single_logout_url)s"> - <saml:Issuer>%(entity_id)s</saml:Issuer> - %(name_id)s -</samlp:LogoutRequest>""" % { - 'id': uid, - 'issue_instant': issue_instant, - 'single_logout_url': idp_data['singleLogoutService']['url'], - 'entity_id': sp_data['entityId'], - 'name_id': name_id, - } - - self.__logout_request = logout_request - -
    [docs] def get_request(self): - """ - Returns the Logout Request defated, base64encoded - :return: Deflated base64 encoded Logout Request - :rtype: str object - """ - return OneLogin_Saml2_Utils.deflate_and_base64_encode(self.__logout_request) -
    - @staticmethod -
    [docs] def get_id(request): - """ - Returns the ID of the Logout Request - :param request: Logout Request Message - :type request: string|DOMDocument - :return: string ID - :rtype: str object - """ - if isinstance(request, Document): - dom = request - else: - dom = parseString(request) - return dom.documentElement.getAttribute('ID') -
    - @staticmethod -
    [docs] def get_name_id_data(request, key=None): - """ - Gets the NameID Data of the the Logout Request - :param request: Logout Request Message - :type request: string|DOMDocument - :param key: The SP key - :type key: string - :return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier) - :rtype: dict - """ - if isinstance(request, Document): - request = request.toxml() - dom = etree.fromstring(request) - name_id = None - - encrypted_entries = OneLogin_Saml2_Utils.query(dom, '/samlp:LogoutRequest/saml:EncryptedID') - - if len(encrypted_entries) == 1: - if key is None: - raise Exception('Key is required in order to decrypt the NameID') - - elem = parseString(etree.tostring(encrypted_entries[0])) - encrypted_data_nodes = elem.documentElement.getElementsByTagName('xenc:EncryptedData') - encrypted_data = encrypted_data_nodes[0] - - xmlsec.initialize() - - # Load the key into the xmlsec context - file_key = OneLogin_Saml2_Utils.write_temp_file(key) # FIXME avoid writing a file - enc_key = xmlsec.Key.load(file_key.name, xmlsec.KeyDataFormatPem, None) - enc_key.name = basename(file_key.name) - file_key.close() - enc_ctx = xmlsec.EncCtx() - enc_ctx.encKey = enc_key - - name_id = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, enc_ctx) - else: - entries = OneLogin_Saml2_Utils.query(dom, '/samlp:LogoutRequest/saml:NameID') - if len(entries) == 1: - name_id = entries[0] - - if name_id is None: - raise Exception('Not NameID found in the Logout Request') - - name_id_data = { - 'Value': name_id.text - } - for attr in ['Format', 'SPNameQualifier', 'NameQualifier']: - if attr in name_id.attrib.keys(): - name_id_data[attr] = name_id.attrib[attr] - - return name_id_data -
    - @staticmethod -
    [docs] def get_name_id(request, key=None): - """ - Gets the NameID of the Logout Request Message - :param request: Logout Request Message - :type request: string|DOMDocument - :param key: The SP key - :type key: string - :return: Name ID Value - :rtype: string - """ - name_id = OneLogin_Saml2_Logout_Request.get_name_id_data(request, key) - return name_id['Value'] -
    - @staticmethod -
    [docs] def get_issuer(request): - """ - Gets the Issuer of the Logout Request Message - :param request: Logout Request Message - :type request: string|DOMDocument - :return: The Issuer - :rtype: string - """ - if isinstance(request, Document): - request = request.toxml() - dom = etree.fromstring(request) - - issuer = None - issuer_nodes = OneLogin_Saml2_Utils.query(dom, '/samlp:LogoutRequest/saml:Issuer') - if len(issuer_nodes) == 1: - issuer = issuer_nodes[0].text - return issuer -
    - @staticmethod -
    [docs] def get_session_indexes(request): - """ - Gets the SessionIndexes from the Logout Request - :param request: Logout Request Message - :type request: string|DOMDocument - :return: The SessionIndex value - :rtype: list - """ - if isinstance(request, Document): - request = request.toxml() - dom = etree.fromstring(request) - - session_indexes = [] - session_index_nodes = OneLogin_Saml2_Utils.query(dom, '/samlp:LogoutRequest/samlp:SessionIndex') - for session_index_node in session_index_nodes: - session_indexes.append(session_index_node.text) - return session_indexes -
    - @staticmethod -
    [docs] def is_valid(settings, request, get_data, debug=False): - """ - Checks if the Logout Request recieved is valid - :param settings: Settings - :type settings: OneLogin_Saml2_Settings - :param request: Logout Request Message - :type request: string|DOMDocument - :return: If the Logout Request is or not valid - :rtype: boolean - """ - try: - if isinstance(request, Document): - dom = request - else: - dom = parseString(request) - - idp_data = settings.get_idp_data() - idp_entity_id = idp_data['entityId'] - - if settings.is_strict(): - res = OneLogin_Saml2_Utils.validate_xml(dom, 'saml-schema-protocol-2.0.xsd', debug) - if not isinstance(res, Document): - raise Exception('Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd') - - security = settings.get_security_data() - - current_url = OneLogin_Saml2_Utils.get_self_url_no_query(get_data) - - # Check NotOnOrAfter - if dom.documentElement.hasAttribute('NotOnOrAfter'): - na = OneLogin_Saml2_Utils.parse_SAML_to_time(dom.documentElement.getAttribute('NotOnOrAfter')) - if na <= datetime.now(): - raise Exception('Timing issues (please check your clock settings)') - - # Check destination - if dom.documentElement.hasAttribute('Destination'): - destination = dom.documentElement.getAttribute('Destination') - if destination is not None: - if current_url not in destination: - raise Exception('The LogoutRequest was received at $currentURL instead of $destination') - - # Check issuer - issuer = OneLogin_Saml2_Logout_Request.get_issuer(dom) - if issuer is None or issuer != idp_entity_id: - raise Exception('Invalid issuer in the Logout Request') - - if security['wantMessagesSigned']: - if 'Signature' not in get_data: - raise Exception('The Message of the Logout Request is not signed and the SP require it') - - if 'Signature' in get_data: - if 'SigAlg' not in get_data: - sign_alg = OneLogin_Saml2_Constants.RSA_SHA1 - else: - sign_alg = get_data['SigAlg'] - - if sign_alg != OneLogin_Saml2_Constants.RSA_SHA1: - raise Exception('Invalid signAlg in the recieved Logout Request') - - signed_query = 'SAMLRequest=%s' % urlencode(get_data['SAMLRequest']) - if 'RelayState' in get_data: - signed_query = '%s&RelayState=%s' % (signed_query, urlencode(get_data['RelayState'])) - signed_query = '%s&SigAlg=%s' % (signed_query, urlencode(sign_alg)) - - if 'x509cert' not in idp_data or idp_data['x509cert'] is None: - raise Exception('In order to validate the sign on the Logout Request, the x509cert of the IdP is required') - cert = idp_data['x509cert'] - - xmlsec.initialize() - objkey = xmlsec.Key.load(cert, xmlsec.KeyDataFormatPem, None) # FIXME is this right? - - if not objkey.verifySignature(signed_query, b64decode(get_data['Signature'])): - raise Exception('Signature validation failed. Logout Request rejected') - - return True - except Exception as e: - debug = settings.is_debug_active() - if debug: - print(e.strerror) - return False
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/logout_response.html b/docs/saml2/_modules/saml2/logout_response.html deleted file mode 100644 index 3ea3bbf7..00000000 --- a/docs/saml2/_modules/saml2/logout_response.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - saml2.logout_response — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.logout_response

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from base64 import b64decode
    -from datetime import datetime
    -from lxml import etree
    -from urllib import quote_plus
    -from xml.dom.minidom import Document, parseString
    -
    -import dm.xmlsec.binding as xmlsec
    -
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.utils import OneLogin_Saml2_Utils
    -
    -
    -
    [docs]class OneLogin_Saml2_Logout_Response(): - - def __init__(self, settings, response=None): - """ - Constructs a Logout Response object (Initialize params from settings - and if provided load the Logout Response. - - Arguments are: - * (OneLogin_Saml2_Settings) settings. Setting data - * (string) response. An UUEncoded SAML Logout - response from the IdP. - """ - self.__settings = settings - if response is not None: - self.__logout_response = OneLogin_Saml2_Utils.decode_base64_and_inflate(response) - self.document = parseString(self.__logout_response) - -
    [docs] def get_issuer(self): - """ - Gets the Issuer of the Logout Response Message - :return: The Issuer - :rtype: string - """ - issuer = None - issuer_nodes = self.__query('/samlp:LogoutResponse/saml:Issuer') - if len(issuer_nodes) == 1: - issuer = issuer_nodes[0].text - return issuer -
    -
    [docs] def get_status(self): - """ - Gets the Status - :return: The Status - :rtype: string - """ - entries = self.__query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode') - if len(entries) == 0: - return None - status = entries[0].attrib['Value'] - return status -
    -
    [docs] def is_valid(self, request_data, request_id=None): - """ - Determines if the SAML LogoutResponse is valid - :param request_id: The ID of the LogoutRequest sent by this SP to the IdP - :type request_id: string - :return: Returns if the SAML LogoutResponse is or not valid - :rtype: boolean - """ - try: - idp_data = self.__settings.get_idp_data() - idp_entity_id = idp_data['entityId'] - get_data = request_data['get_data'] - - if self.__settings.is_strict(): - res = OneLogin_Saml2_Utils.validate_xml(self.document, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active()) - if not isinstance(res, Document): - raise Exception('Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd') - - security = self.__settings.get_security_data() - - # Check if the InResponseTo of the Logout Response matchs the ID of the Logout Request (requestId) if provided - if request_id is not None and self.document.documentElement.hasAttribute('InResponseTo'): - in_response_to = self.document.documentElement.getAttribute('InResponseTo') - if request_id != in_response_to: - raise Exception('The InResponseTo of the Logout Response: %s, does not match the ID of the Logout request sent by the SP: %s' % (in_response_to, request_id)) - - # Check issuer - issuer = self.get_issuer() - if issuer is None or issuer != idp_entity_id: - raise Exception('Invalid issuer in the Logout Request') - - current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - - # Check destination - if self.document.documentElement.hasAttribute('Destination'): - destination = self.document.documentElement.getAttribute('Destination') - if destination is not None: - if current_url not in destination: - raise Exception('The LogoutRequest was received at $currentURL instead of $destination') - - if security['wantMessagesSigned']: - if 'Signature' not in get_data: - raise Exception('The Message of the Logout Response is not signed and the SP require it') - - if 'Signature' in get_data: - if 'SigAlg' not in get_data: - sign_alg = OneLogin_Saml2_Constants.RSA_SHA1 - else: - sign_alg = get_data['SigAlg'] - - if sign_alg != OneLogin_Saml2_Constants.RSA_SHA1: - raise Exception('Invalid signAlg in the recieved Logout Response') - - signed_query = 'SAMLResponse=%s' % quote_plus(get_data['SAMLResponse']) - if 'RelayState' in get_data: - signed_query = '%s&RelayState=%s' % (signed_query, quote_plus(get_data['RelayState'])) - signed_query = '%s&SigAlg=%s' % (signed_query, quote_plus(sign_alg)) - - if 'x509cert' not in idp_data or idp_data['x509cert'] is None: - raise Exception('In order to validate the sign on the Logout Response, the x509cert of the IdP is required') - cert = idp_data['x509cert'] - - xmlsec.initialize() - objkey = xmlsec.Key.load(cert, xmlsec.KeyDataFormatPem, None) # FIXME is this right? - - if not objkey.verifySignature(signed_query, b64decode(get_data['Signature'])): - raise Exception('Signature validation failed. Logout Response rejected') - - return True - except Exception as e: - debug = self.__settings.is_debug_active() - if debug: - print(e.strerror) - return False -
    - def __query(self, query): - """ - Extracts a node from the DOMDocument (Logout Response Menssage) - :param query: Xpath Expresion - :type query: string - :return: The queried node - :rtype: DOMNodeList - """ - # Switch to lxml for querying - xml = self.document.toxml() - return OneLogin_Saml2_Utils.query(etree.fromstring(xml), query) - -
    [docs] def build(self, in_response_to): - """ - Creates a Logout Response object. - :param in_response_to: InResponseTo value for the Logout Response. - :type in_response_to: string - """ - sp_data = self.__settings.get_sp_data() - idp_data = self.__settings.get_idp_data() - - uid = OneLogin_Saml2_Utils.generate_unique_id() - issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML( - int(datetime.now().strftime("%s")) - ) - - logout_response = """<samlp:LogoutResponse xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" - xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" - ID="%(id)s" - Version="2.0" - IssueInstant="%(issue_instant)s" - Destination="%(destination)s" - InResponseTo="%(in_response_to)s" -> - <saml:Issuer>%(entity_id)s</saml:Issuer> - <samlp:Status> - <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /> - </samlp:Status> -</samlp:LogoutResponse>""" % { - 'id': uid, - 'issue_instant': issue_instant, - 'destination': idp_data['singleLogoutService']['url'], - 'in_response_to': in_response_to, - 'entity_id': sp_data['entityId'], - } - - self.__logout_response = logout_response -
    -
    [docs] def get_response(self): - """ - Returns a Logout Response object. - :return: Logout Response deflated and base64 encoded - :rtype: string - """ - return OneLogin_Saml2_Utils.deflate_and_base64_encode(self.__logout_response)
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/metadata.html b/docs/saml2/_modules/saml2/metadata.html deleted file mode 100644 index 7b0a1be5..00000000 --- a/docs/saml2/_modules/saml2/metadata.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - - - saml2.metadata — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.metadata

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from time import gmtime, strftime
    -from datetime import datetime
    -from xml.dom.minidom import parseString
    -
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.utils import OneLogin_Saml2_Utils
    -
    -
    -
    [docs]class OneLogin_Saml2_Metadata: - - TIME_VALID = 172800 # 2 days - TIME_CACHED = 604800 # 1 week - - @staticmethod -
    [docs] def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None): - """ - Build the metadata of the SP - - :param sp: The SP data - :type sp: string - - :param authnsign: authnRequestsSigned attribute - :type authnsign: string - - :param wsign: wantAssertionsSigned attribute - :type wsign: string - - :param valid_until: Metadata's valid time - :type valid_until: DateTime - - :param cache_duration: Duration of the cache in seconds - :type cache_duration: Timestamp - - :param contacts: Contacts info - :type contacts: dict - - :param organization: Organization ingo - :type organization: dict - """ - if valid_until is None: - valid_until = int(datetime.now().strftime("%s")) + OneLogin_Saml2_Metadata.TIME_VALID - valid_until_time = gmtime(valid_until) - valid_until_time = strftime(r'%Y-%m-%dT%H:%M:%SZ', valid_until_time) - if cache_duration is None: - cache_duration = int(datetime.now().strftime("%s")) + OneLogin_Saml2_Metadata.TIME_CACHED - if contacts is None: - contacts = {} - if organization is None: - organization = {} - - sls = '' - if 'singleLogoutService' in sp: - sls = """<md:SingleLogoutService Binding="%(binding)s" - Location="%(location)s" />""" % { - 'binding': sp['singleLogoutService']['binding'], - 'location': sp['singleLogoutService']['url'], - } - - str_authnsign = 'true' if authnsign else 'false' - str_wsign = 'true' if wsign else 'false' - - str_organization = '' - if len(organization) > 0: - organization_info = [] - for (lang, info) in organization.items(): - organization_info.append(""" <md:Organization> - <md:OrganizationName xml:lang="%(lang)s">%(name)s</md:OrganizationName> - <md:OrganizationDisplayName xml:lang="%(lang)s">%(display_name)s</md:OrganizationDisplayName> - <md:OrganizationURL xml:lang="%(lang)s">%(url)s</md:OrganizationURL> - </md:Organization>""" % { - 'lang': lang, - 'name': info['name'], - 'display_name': info['displayname'], - 'url': info['url'], - }) - str_organization = '\n'.join(organization_info) - - str_contacts = '' - if len(contacts) > 0: - contacts_info = [] - for (ctype, info) in contacts.items(): - contacts_info.append(""" <md:ContactPerson contactType="%(type)s"> - <md:GivenName>%(name)s</md:GivenName> - <md:EmailAddress>%(email)s</md:EmailAddress> - </md:ContactPerson>""" % { - 'type': ctype, - 'name': info['givenName'], - 'email': info['emailAddress'], - }) - str_contacts = '\n'.join(contacts_info) - - metadata = """<?xml version="1.0"?> -<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" - validUntil="%(valid)s" - cacheDuration="PT%(cache)sS" - entityID="%(entity_id)s"> - <md:SPSSODescriptor AuthnRequestsSigned="%(authnsign)s" WantAssertionsSigned="%(wsign)s" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"> - <md:NameIDFormat>%(name_id_format)s</md:NameIDFormat> - <md:AssertionConsumerService Binding="%(binding)s" - Location="%(location)s" - index="1" /> -%(sls)s - </md:SPSSODescriptor> -%(organization)s -%(contacts)s -</md:EntityDescriptor>""" % { - 'valid': valid_until_time, - 'cache': cache_duration, - 'entity_id': sp['entityId'], - 'authnsign': str_authnsign, - 'wsign': str_wsign, - 'name_id_format': sp['NameIDFormat'], - 'binding': sp['assertionConsumerService']['binding'], - 'location': sp['assertionConsumerService']['url'], - 'sls': sls, - 'organization': str_organization, - 'contacts': str_contacts, - } - - return metadata -
    - @staticmethod -
    [docs] def sign_metadata(metadata, key, cert): - """ - Sign the metadata with the key/cert provided - - :param metadata: SAML Metadata XML - :type metadata: string - - :param key: x509 key - :type key: string - - :param cert: x509 cert - :type cert: string - - :returns: Signed Metadata - :rtype: string - """ - return OneLogin_Saml2_Utils.add_sign(metadata, key, cert) -
    - @staticmethod -
    [docs] def add_x509_key_descriptors(metadata, cert): - """ - Add the x509 descriptors (sign/encriptation to the metadata - The same cert will be used for sign/encrypt - - :param metadata: SAML Metadata XML - :type metadata: string - - :param cert: x509 cert - :type cert: string - - :returns: Metadata with KeyDescriptors - :rtype: string - """ - try: - xml = parseString(metadata) - except Exception as e: - raise Exception('Error parsing metadata. ' + e.message) - - formated_cert = OneLogin_Saml2_Utils.format_cert(cert, False) - x509_certificate = xml.createElementNS(OneLogin_Saml2_Constants.NS_DS, 'ds:X509Certificate') - content = xml.createTextNode(formated_cert) - x509_certificate.appendChild(content) - - key_data = xml.createElementNS(OneLogin_Saml2_Constants.NS_DS, 'ds:X509Data') - key_data.appendChild(x509_certificate) - - key_info = xml.createElementNS(OneLogin_Saml2_Constants.NS_DS, 'ds:KeyInfo') - key_info.appendChild(key_data) - - key_descriptor = xml.createElementNS(OneLogin_Saml2_Constants.NS_DS, 'md:KeyDescriptor') - - entity_descriptor = sp_sso_descriptor = xml.getElementsByTagName('md:EntityDescriptor')[0] - entity_descriptor.setAttribute('xmlns:ds', OneLogin_Saml2_Constants.NS_DS) - - sp_sso_descriptor = xml.getElementsByTagName('md:SPSSODescriptor')[0] - sp_sso_descriptor.insertBefore(key_descriptor.cloneNode(True), sp_sso_descriptor.firstChild) - sp_sso_descriptor.insertBefore(key_descriptor.cloneNode(True), sp_sso_descriptor.firstChild) - - signing = xml.getElementsByTagName('md:KeyDescriptor')[0] - signing.setAttribute('use', 'signing') - - encryption = xml.getElementsByTagName('md:KeyDescriptor')[1] - encryption.setAttribute('use', 'encryption') - - signing.appendChild(key_info) - encryption.appendChild(key_info.cloneNode(True)) - - return xml.toxml()
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/response.html b/docs/saml2/_modules/saml2/response.html deleted file mode 100644 index d3fee4e3..00000000 --- a/docs/saml2/_modules/saml2/response.html +++ /dev/null @@ -1,532 +0,0 @@ - - - - - - - - - - saml2.response — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.response

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from base64 import b64decode
    -from copy import deepcopy
    -from lxml import etree
    -from os.path import basename
    -from time import time
    -import sys
    -from xml.dom.minidom import Document
    -
    -import dm.xmlsec.binding as xmlsec
    -
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.utils import OneLogin_Saml2_Utils
    -
    -
    -
    [docs]class OneLogin_Saml2_Response(object): - - def __init__(self, settings, response): - """ - Constructs the response object. - - :param settings: The setting info - :type settings: OneLogin_Saml2_Setting object - - :param response: The base64 encoded, XML string containing the samlp:Response - :type response: string - """ - self.__settings = settings - self.response = b64decode(response) - self.document = etree.fromstring(self.response) - self.decrypted_document = None - self.encrypted = None - - # Quick check for the presence of EncryptedAssertion - encrypted_assertion_nodes = self.__query('//saml:EncryptedAssertion') - if encrypted_assertion_nodes: - decrypted_document = deepcopy(self.document) - self.encrypted = True - self.decrypted_document = self.__decrypt_assertion(decrypted_document) - -
    [docs] def is_valid(self, request_data, request_id=None): - """ - Constructs the response object. - - :param request_id: Optional argument. The ID of the AuthNRequest sent by this SP to the IdP - :type request_id: string - - :returns: True if the SAML Response is valid, False if not - :rtype: bool - """ - try: - # Checks SAML version - if self.document.get('Version', None) != '2.0': - raise Exception('Unsupported SAML version') - - # Checks that ID exists - if self.document.get('ID', None) is None: - raise Exception('Missing ID attribute on SAML Response') - - # Checks that the response only has one assertion - if not self.validate_num_assertions(): - raise Exception('Multiple assertions are not supported') - - # Checks that the response has the SUCCESS status - self.check_status() - - idp_data = self.__settings.get_idp_data() - idp_entityid = idp_data.get('entityId', '') - sp_data = self.__settings.get_sp_data() - sp_entityid = sp_data.get('entityId', '') - - sign_nodes = self.__query('//ds:Signature') - - signed_elements = [] - for sign_node in sign_nodes: - signed_elements.append(sign_node.getparent().tag) - - if self.__settings.is_strict(): - res = OneLogin_Saml2_Utils.validate_xml(etree.tostring(self.document), 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active()) - if not isinstance(res, Document): - raise Exception('Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd') - - security = self.__settings.get_security_data() - current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - - # Check if the InResponseTo of the Response matchs the ID of the AuthNRequest (requestId) if provided - in_response_to = self.document.get('InResponseTo', None) - if in_response_to and request_id: - if in_response_to != request_id: - raise Exception('The InResponseTo of the Response: %s, does not match the ID of the AuthNRequest sent by the SP: %s' % (in_response_to, request_id)) - - if not self.encrypted and security.get('wantAssertionsEncrypted', False): - raise Exception('The assertion of the Response is not encrypted and the SP require it') - - if security.get('wantNameIdEncrypted', False): - encrypted_nameid_nodes = self.__query_assertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData') - if not encrypted_nameid_nodes: - raise Exception('The NameID of the Response is not encrypted and the SP require it') - - # Checks that there is at least one AttributeStatement - attribute_statement_nodes = self.__query_assertion('/saml:AttributeStatement') - if not attribute_statement_nodes: - raise Exception('There is no AttributeStatement on the Response') - - # Validates Asserion timestamps - if not self.validate_timestamps(): - raise Exception('Timing issues (please check your clock settings)') - - encrypted_attributes_nodes = self.__query_assertion('/saml:AttributeStatement/saml:EncryptedAttribute') - if encrypted_attributes_nodes: - raise Exception('There is an EncryptedAttribute in the Response and this SP not support them') - - # Checks destination - destination = self.document.get('Destination', None) - if destination: - if destination not in current_url: - raise Exception('The response was received at %s instead of %s' % (current_url, destination)) - - # Checks audience - valid_audiences = self.get_audiences() - if valid_audiences and sp_entityid not in valid_audiences: - raise Exception('%s is not a valid audience for this Response' % sp_entityid) - - # Checks the issuers - issuers = self.get_issuers() - for issuer in issuers: - if not issuer or issuer != idp_entityid: - raise Exception('Invalid issuer in the Assertion/Response') - - # Checks the session Expiration - session_expiration = self.get_session_not_on_or_after() - if not session_expiration and session_expiration <= time(): - raise Exception('The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response') - - # Checks the SubjectConfirmation, at least one SubjectConfirmation must be valid - any_subject_confirmation = False - subject_confirmation_nodes = self.__query_assertion('/saml:Subject/saml:SubjectConfirmation') - - for scn in subject_confirmation_nodes: - method = scn.get('Method', None) - if method and method != OneLogin_Saml2_Constants.CM_BEARER: - continue - scData = scn.find('saml:SubjectConfirmationData', namespaces=OneLogin_Saml2_Constants.NSMAP) - if scData is None: - continue - else: - irt = scData.get('InResponseTo', None) - if irt != in_response_to: - continue - recipient = scData.get('Recipient', None) - if recipient not in current_url: - continue - nooa = scData.get('NotOnOrAfter', None) - if nooa: - parsed_nooa = OneLogin_Saml2_Utils.parse_SAML_to_time(nooa) - if parsed_nooa <= time(): - continue - nb = scData.get('NotBefore', None) - if nb: - parsed_nb = OneLogin_Saml2_Utils.parse_SAML_to_time(nb) - if (parsed_nb > time()): - continue - any_subject_confirmation = True - break - - if not any_subject_confirmation: - raise Exception('A valid SubjectConfirmation was not found on this Response') - - if security.get('wantAssertionsSigned', False) and 'saml:Assertion' not in signed_elements: - raise Exception('The Assertion of the Response is not signed and the SP require it') - - if security.get('wantMessagesSigned', False) and 'samlp:Response' not in signed_elements: - raise Exception('The Message of the Response is not signed and the SP require it') - - document_to_validate = None - if len(signed_elements) > 0: - cert = idp_data.get('x509cert', None) - fingerprint = idp_data.get('certFingerprint', None) - - # Only validates the first sign found - if 'samlp:Response' in signed_elements: - document_to_validate = self.document - else: - if self.encrypted: - document_to_validate = self.decrypted_document - else: - document_to_validate = self.document - - if document_to_validate is not None: - if not OneLogin_Saml2_Utils.validate_sign(document_to_validate, cert, fingerprint): - raise Exception('Signature validation failed. SAML Response rejected') - return True - except: - debug = self.__settings.is_debug_active() - if debug: - print sys.exc_info()[0] - return False -
    -
    [docs] def check_status(self): - """ - Check if the status of the response is success or not - - :raises: Exception. If the status is not success - """ - status = OneLogin_Saml2_Utils.get_status(self.document) - code = status.get('code', None) - if code and code != OneLogin_Saml2_Constants.STATUS_SUCCESS: - splited_code = code.split(':') - printable_code = splited_code.pop() - status_exception_msg = 'The status code of the Response was not Success, was %s' % printable_code - status_msg = status.get('msg', None) - if status_msg: - status_exception_msg += ' -> ' + status_msg - raise Exception(status_exception_msg) -
    -
    [docs] def get_audiences(self): - """ - Gets the audiences - - :returns: The valid audiences for the SAML Response - :rtype: list - """ - audiences = [] - - audience_nodes = self.__query_assertion('/saml:Conditions/saml:AudienceRestriction/saml:Audience') - for audience_node in audience_nodes: - audiences.append(audience_node.text) -
    -
    [docs] def get_issuers(self): - """ - Gets the issuers (from message and from assertion) - - :returns: The issuers - :rtype: list - """ - issuers = [] - - message_issuer_nodes = self.__query('/samlp:Response/saml:Issuer') - if message_issuer_nodes: - issuers.append(message_issuer_nodes[0].text) - - assertion_issuer_nodes = self.__query_assertion('/saml:Issuer') - if assertion_issuer_nodes: - issuers.append(assertion_issuer_nodes[0].text) - - return list(set(issuers)) -
    -
    [docs] def get_nameid_data(self): - """ - Gets the NameID Data provided by the SAML Response from the IdP - - :returns: Name ID Data (Value, Format, NameQualifier, SPNameQualifier) - :rtype: dict - """ - nameid = None - encrypted_id_data_nodes = self.__query_assertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData') - if encrypted_id_data_nodes: - encrypted_data = encrypted_id_data_nodes[0] - - xmlsec.initialize() - - # Load the key into the xmlsec context - key = self.__settings.get_sp_key() - file_key = OneLogin_Saml2_Utils.write_temp_file(key) # FIXME avoid writing a file - enc_key = xmlsec.Key.load(file_key.name, xmlsec.KeyDataFormatPem, None) - enc_key.name = basename(file_key.name) - file_key.close() - enc_ctx = xmlsec.EncCtx() - enc_ctx.encKey = enc_key - - nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, enc_ctx) - else: - nameid_nodes = self.__query_assertion('/saml:Subject/saml:NameID') - if nameid_nodes: - nameid = nameid_nodes[0] - if nameid is None: - raise Exception('Not NameID found in the assertion of the Response') - - nameid_data = {'Value': nameid.text} - for attr in ['Format', 'SPNameQualifier', 'NameQualifier']: - value = nameid.get(attr, None) - if value: - nameid_data[attr] = value - return nameid_data -
    -
    [docs] def get_nameid(self): - """ - Gets the NameID provided by the SAML Response from the IdP - - :returns: NameID (value) - :rtype: string - """ - nameid_data = self.get_nameid_data() - return nameid_data['Value'] -
    -
    [docs] def get_session_not_on_or_after(self): - """ - Gets the SessionNotOnOrAfter from the AuthnStatement - Could be used to set the local session expiration - - :returns: The SessionNotOnOrAfter value - :rtype: time|None - """ - not_on_or_after = None - authn_statement_nodes = self.__query_assertion('/saml:AuthnStatement[@SessionNotOnOrAfter]') - if authn_statement_nodes: - not_on_or_after = OneLogin_Saml2_Utils.parse_SAML_to_time(authn_statement_nodes[0].get('SessionNotOnOrAfter')) - return not_on_or_after -
    -
    [docs] def get_session_index(self): - """ - Gets the SessionIndex from the AuthnStatement - Could be used to be stored in the local session in order - to be used in a future Logout Request that the SP could - send to the SP, to set what specific session must be deleted - - :returns: The SessionIndex value - :rtype: string|None - """ - session_index = None - authn_statement_nodes = self.__query_assertion('/saml:AuthnStatement[@SessionIndex]') - if authn_statement_nodes: - session_index = authn_statement_nodes[0].get('SessionIndex') - return session_index -
    -
    [docs] def get_attributes(self): - """ - Gets the Attributes from the AttributeStatement element. - EncryptedAttributes are not supported - """ - attributes = {} - attribute_nodes = self.__query_assertion('/saml:AttributeStatement/saml:Attribute') - for attribute_node in attribute_nodes: - attr_name = attribute_node.get('Name') - values = [] - for attr in attribute_node.iterchildren('{%s}AttributeValue' % OneLogin_Saml2_Constants.NSMAP['saml']): - values.append(attr.text) - attributes[attr_name] = values - return attributes -
    -
    [docs] def validate_num_assertions(self): - """ - Verifies that the document only contains a single Assertion (encrypted or not) - - :returns: True if only 1 assertion encrypted or not - :rtype: bool - """ - encrypted_assertion_nodes = self.__query('//saml:EncryptedAssertion') - assertion_nodes = self.__query('//saml:Assertion') - return (len(encrypted_assertion_nodes) + len(assertion_nodes)) == 1 -
    -
    [docs] def validate_timestamps(self): - """ - Verifies that the document is valid according to Conditions Element - - :returns: True if the condition is valid, False otherwise - :rtype: bool - """ - conditions_nodes = self.__query('//saml:Conditions') - for conditions_node in conditions_nodes: - nb_attr = conditions_node.get('NotBefore') - nooa_attr = conditions_node.get('NotOnOrAfter') - if nb_attr and OneLogin_Saml2_Utils.parse_SAML_to_time(nb_attr) > time() + OneLogin_Saml2_Constants.ALOWED_CLOCK_DRIFT: - return False - if nooa_attr and OneLogin_Saml2_Utils.parse_SAML_to_time(nooa_attr) + OneLogin_Saml2_Constants.ALOWED_CLOCK_DRIFT <= time(): - return False - return True -
    - def __query_assertion(self, xpath_expr): - """ - Extracts nodes that match the query from the Assertion - - :param query: Xpath Expresion - :type query: String - - :returns: The queried nodes - :rtype: list - """ - if self.encrypted: - assertion_expr = '/saml:EncryptedAssertion/saml:Assertion' - else: - assertion_expr = '/saml:Assertion' - signature_expr = '/ds:Signature/ds:SignedInfo/ds:Reference' - signed_assertion_query = '/samlp:Response' + assertion_expr + signature_expr - assertion_reference_nodes = self.__query(signed_assertion_query) - - if not assertion_reference_nodes: - # Check if the message is signed - signed_message_query = '/samlp:Response' + signature_expr - message_reference_nodes = self.__query(signed_message_query) - if message_reference_nodes: - id = message_reference_nodes[0].get('URI') - final_query = "/samlp:Response[@ID='%s']/" % id[1:] - else: - final_query = "/samlp:Response/" - final_query += assertion_expr - else: - id = assertion_reference_nodes[0].get('URI') - final_query = '/samlp:Response' + assertion_expr + "[@ID='%s']" % id[1:] - final_query += xpath_expr - return self.__query(final_query) - - def __query(self, query): - """ - Extracts nodes that match the query from the Response - - :param query: Xpath Expresion - :type query: String - - :returns: The queried nodes - :rtype: list - """ - if self.encrypted: - document = self.decrypted_document - else: - document = self.document - return OneLogin_Saml2_Utils.query(document, query) - - def __decrypt_assertion(self, dom): - """ - Decrypts the Assertion - - :raises: Exception if no private key available - :param dom: Encrypted Assertion - :type dom: Element - :returns: Decrypted Assertion - :rtype: Element - """ - key = self.__settings.get_sp_key() - - if not key: - raise Exception('No private key available, check settings') - - # TODO Study how decrypt assertion
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/settings.html b/docs/saml2/_modules/saml2/settings.html deleted file mode 100644 index 42800b51..00000000 --- a/docs/saml2/_modules/saml2/settings.html +++ /dev/null @@ -1,695 +0,0 @@ - - - - - - - - - - saml2.settings — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.settings

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -from datetime import datetime
    -import json
    -import re
    -from os.path import dirname, exists, join, sep
    -from xml.dom.minidom import Document
    -
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.errors import OneLogin_Saml2_Error
    -from saml2.metadata import OneLogin_Saml2_Metadata
    -from saml2.utils import OneLogin_Saml2_Utils
    -
    -
    -# Regex from Django Software Foundation and individual contributors.
    -# Released under a BSD 3-Clause License
    -url_regex = re.compile(
    -    r'^(?:[a-z0-9\.\-]*)://'  # scheme is validated separately
    -    r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'  # domain...
    -    r'localhost|'  # localhost...
    -    r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|'  # ...or ipv4
    -    r'\[?[A-F0-9]*:[A-F0-9:]+\]?)'  # ...or ipv6
    -    r'(?::\d+)?'  # optional port
    -    r'(?:/?|[/?]\S+)$', re.IGNORECASE)
    -url_schemes = ['http', 'https', 'ftp', 'ftps']
    -
    -
    -
    [docs]def validate_url(url): - scheme = url.split('://')[0].lower() - if scheme not in url_schemes: - return False - if not bool(url_regex.search(url)): - return False - return True - -
    -
    [docs]class OneLogin_Saml2_Settings: - - def __init__(self, settings=None, custom_base_path=None): - """ - Initializes the settings: - - Sets the paths of the different folders - - Loads settings info from settings file or array/object provided - - :param settings: SAML Toolkit Settings - :type settings: dict|object - """ - self.__paths = {} - self.__strict = False - self.__debug = False - self.__sp = {} - self.__idp = {} - self.__contacts = {} - self.__organization = {} - self.__errors = [] - - self.__load_paths(base_path=custom_base_path) - self.__update_paths(settings) - - if settings is None: - if not self.__load_settings_from_file(): - raise OneLogin_Saml2_Error( - 'Invalid file settings: %s', - OneLogin_Saml2_Error.SETTINGS_INVALID, - ','.join(self.__errors) - ) - self.__add_default_values() - elif isinstance(settings, dict): - if not self.__load_settings_from_dict(settings): - raise OneLogin_Saml2_Error( - 'Invalid dict settings: %s', - OneLogin_Saml2_Error.SETTINGS_INVALID, - ','.join(self.__errors) - ) - else: - raise Exception('Unsupported settings object') - - self.format_idp_cert() - - def __load_paths(self, base_path=None): - """ - Sets the paths of the different folders - """ - if base_path is None: - base_path = dirname(dirname(dirname(__file__))) - base_path += sep - self.__paths = { - 'base': base_path, - 'cert': base_path + 'certs' + sep, - 'lib': base_path + 'lib' + sep, - 'extlib': base_path + 'extlib' + sep, - } - - def __update_paths(self, settings): - """ - Set custom paths if necessary - """ - if not isinstance(settings, dict): - return - - if 'custom_base_path' in settings: - base_path = settings['custom_base_path'] - base_path = join(dirname(__file__), base_path) - self.__load_paths(base_path) - -
    [docs] def get_base_path(self): - """ - Returns base path - - :return: The base toolkit folder path - :rtype: string - """ - return self.__paths['base'] -
    -
    [docs] def get_cert_path(self): - """ - Returns cert path - - :return: The cert folder path - :rtype: string - """ - return self.__paths['cert'] -
    -
    [docs] def get_lib_path(self): - """ - Returns lib path - - :return: The library folder path - :rtype: string - """ - return self.__paths['lib'] -
    -
    [docs] def get_ext_lib_path(self): - """ - Returns external lib path - - :return: The external library folder path - :rtype: string - """ - return self.__paths['extlib'] -
    -
    [docs] def get_schemas_path(self): - """ - Returns schema path - - :return: The schema folder path - :rtype: string - """ - return self.__paths['lib'] + 'schemas/' -
    - def __load_settings_from_dict(self, settings): - """ - Loads settings info from a settings Dict - - :param settings: SAML Toolkit Settings - :type settings: dict - - :returns: True if the settings info is valid - :rtype: boolean - """ - errors = self.check_settings(settings) - if len(errors) == 0: - self.__errors = [] - self.__sp = settings['sp'] - self.__idp = settings['idp'] - - if 'strict' in settings: - self.__strict = settings['strict'] - if 'debug' in settings: - self.__debug = settings['debug'] - if 'security' in settings: - self.__security = settings['security'] - if 'contactPerson' in settings: - self.__contacts = settings['contactPerson'] - if 'organization' in settings: - self.__organization = settings['organization'] - - self.__add_default_values() - return True - - self.__errors = errors - return False - - def __load_settings_from_file(self): - """ - Loads settings info from the settings json file - - :returns: True if the settings info is valid - :rtype: boolean - """ - filename = self.get_base_path() + 'settings.json' - - if not exists(filename): - raise OneLogin_Saml2_Error( - 'Settings file not found: %s', - OneLogin_Saml2_Error.SETTINGS_FILE_NOT_FOUND, - filename - ) - - # In the php toolkit instead of being a json file it is a php file and - # it is directly included - json_data = open(filename, 'r') - settings = json.load(json_data) - json_data.close() - - advanced_filename = self.get_base_path() + 'advanced_settings.json' - if exists(advanced_filename): - json_data = open(advanced_filename, 'r') - settings.update(json.load(json_data)) # Merge settings - json_data.close() - - return self.__load_settings_from_dict(settings) - - def __add_default_values(self): - """ - Add default values if the settings info is not complete - """ - if 'binding' not in self.__sp['assertionConsumerService']: - self.__sp['assertionConsumerService']['binding'] = OneLogin_Saml2_Constants.BINDING_HTTP_POST - if 'singleLogoutService' in self.__sp and 'binding' not in self.__sp['singleLogoutService']: - self.__sp['singleLogoutService']['binding'] = OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT - - # Related to nameID - if 'NameIDFormat' not in self.__sp: - self.__sp['NameIDFormat'] = OneLogin_Saml2_Constants.NAMEID_PERSISTENT - if 'nameIdEncrypted' not in self.__security: - self.__security['nameIdEncrypted'] = False - - # Sign provided - if 'authnRequestsSigned' not in self.__security: - self.__security['authnRequestsSigned'] = False - if 'logoutRequestSigned' not in self.__security: - self.__security['logoutRequestSigned'] = False - if 'logoutResponseSigned' not in self.__security: - self.__security['logoutResponseSigned'] = False - if 'signMetadata' not in self.__security: - self.__security['signMetadata'] = False - - # Sign expected - if 'wantMessagesSigned' not in self.__security: - self.__security['wantMessagesSigned'] = False - if 'wantAssertionsSigned' not in self.__security: - self.__security['wantAssertionsSigned'] = False - - # Encrypt expected - if 'wantAssertionsEncrypted' not in self.__security: - self.__security['wantAssertionsEncrypted'] = False - if 'wantNameIdEncrypted' not in self.__security: - self.__security['wantNameIdEncrypted'] = False - - if 'x509cert' not in self.__idp: - self.__idp['x509cert'] = '' - if 'certFingerprint' not in self.__idp: - self.__idp['certFingerprint'] = '' - -
    [docs] def check_settings(self, settings): - """ - Checks the settings info. - - :param settings: Dict with settings data - :type settings: dict - - :returns: Errors found on the settings data - :rtype: list - """ - assert isinstance(settings, dict) - - errors = [] - if not isinstance(settings, dict) or len(settings) == 0: - errors.append('invalid_syntax') - return errors - - if 'idp' not in settings or len(settings['idp']) == 0: - errors.append('idp_not_found') - else: - idp = settings['idp'] - if 'entityId' not in idp or len(idp['entityId']) == 0: - errors.append('idp_entityId_not_found') - - if ('singleSignOnService' not in idp or - 'url' not in idp['singleSignOnService'] or - len(idp['singleSignOnService']['url']) == 0): - errors.append('idp_sso_not_found') - elif not validate_url(idp['singleSignOnService']['url']): - errors.append('idp_sso_url_invalid') - - if ('singleLogoutService' in idp and - 'url' in idp['singleLogoutService'] and - len(idp['singleLogoutService']['url']) > 0 and - not validate_url(idp['singleLogoutService']['url'])): - errors.append('idp_slo_url_invalid') - - if 'sp' not in settings or len(settings['sp']) == 0: - errors.append('sp_not_found') - else: - sp = settings['sp'] - security = {} - if 'security' in settings: - security = settings['security'] - - if 'entityId' not in sp or len(sp['entityId']) == 0: - errors.append('sp_entityId_not_found') - - if ('assertionConsumerService' not in sp or - 'url' not in sp['assertionConsumerService'] or - len(sp['assertionConsumerService']['url']) == 0): - errors.append('sp_acs_not_found') - elif not validate_url(sp['assertionConsumerService']['url']): - errors.append('sp_acs_url_invalid') - - if ('singleLogoutService' in sp and - 'url' in sp['singleLogoutService'] and - len(sp['singleLogoutService']['url']) > 0 and - not validate_url(sp['singleLogoutService']['url'])): - errors.append('sp_sls_url_invalid') - - if 'signMetadata' in security and isinstance(security['signMetadata'], dict): - if ('keyFileName' not in security['signMetadata'] or - 'certFileName' not in security['signMetadata']): - errors.append('sp_signMetadata_invalid') - - if ((('authnRequestsSigned' in security and security['authnRequestsSigned']) or - ('logoutRequestSigned' in security and security['logoutRequestSigned']) or - ('logoutResponseSigned' in security and security['logoutResponseSigned']) or - ('wantAssertionsEncrypted' in security and security['wantAssertionsEncrypted']) or - ('wantNameIdEncrypted' in security and security['wantNameIdEncrypted'])) and - not self.check_sp_certs()): - errors.append('sp_cert_not_found_and_required') - - exists_X509 = ('idp' in settings and - 'x509cert' in settings['idp'] and - len(settings['idp']['x509cert']) > 0) - exists_fingerprint = ('idp' in settings and - 'certFingerprint' in settings['idp'] and - len(settings['idp']['certFingerprint']) > 0) - if ((('wantAssertionsSigned' in security and security['wantAssertionsSigned']) or - ('wantMessagesSigned' in security and security['wantMessagesSigned'])) and - not(exists_X509 or exists_fingerprint)): - errors.append('idp_cert_or_fingerprint_not_found_and_required') - if ('nameIdEncrypted' in security and security['nameIdEncrypted']) and not exists_X509: - errors.append('idp_cert_not_found_and_required') - - if 'contactPerson' in settings: - types = settings['contactPerson'].keys() - valid_types = ['technical', 'support', 'administrative', 'billing', 'other'] - for t in types: - if t not in valid_types: - errors.append('contact_type_invalid') - break - - for t in settings['contactPerson']: - contact = settings['contactPerson'][t] - if (('givenName' not in contact or len(contact['givenName']) == 0) or - ('emailAddress' not in contact or len(contact['emailAddress']) == 0)): - errors.append('contact_not_enought_data') - break - - if 'organization' in settings: - for o in settings['organization']: - organization = settings['organization'][o] - if (('name' not in organization or len(organization['name']) == 0) or - ('displayname' not in organization or len(organization['displayname']) == 0) or - ('url' not in organization or len(organization['url']) == 0)): - errors.append('organization_not_enought_data') - break - - return errors -
    -
    [docs] def check_sp_certs(self): - """ - Checks if the x509 certs of the SP exists and are valid. - - :returns: If the x509 certs of the SP exists and are valid - :rtype: boolean - """ - key = self.get_sp_key() - cert = self.get_sp_cert() - return key is not None and cert is not None -
    -
    [docs] def get_sp_key(self): - """ - Returns the x509 private key of the SP. - - :returns: SP private key - :rtype: string - """ - key = None - key_file = self.__paths['cert'] + 'sp.key' - - if exists(key_file): - f = open(key_file, 'r') - key = f.read() - f.close() - - return key -
    -
    [docs] def get_sp_cert(self): - """ - Returns the x509 public cert of the SP. - - :returns: SP public cert - :rtype: string - """ - cert = None - cert_file = self.__paths['cert'] + 'sp.crt' - - if exists(cert_file): - f = open(cert_file, 'r') - cert = f.read() - f.close() - - return cert -
    -
    [docs] def get_idp_data(self): - """ - Gets the IdP data. - - :returns: IdP info - :rtype: dict - """ - return self.__idp -
    -
    [docs] def get_sp_data(self): - """ - Gets the SP data. - - :returns: SP info - :rtype: dict - """ - return self.__sp -
    -
    [docs] def get_security_data(self): - """ - Gets security data. - - :returns: Security info - :rtype: dict - """ - return self.__security -
    -
    [docs] def get_contacts(self): - """ - Gets contact data. - - :returns: Contacts info - :rtype: dict - """ - return self.__contacts -
    -
    [docs] def get_organization(self): - """ - Gets organization data. - - :returns: Organization info - :rtype: dict - """ - return self.__organization -
    -
    [docs] def get_sp_metadata(self): - """ - Gets the SP metadata. The XML representation. - - :returns: SP metadata (xml) - :rtype: string - """ - metadata = OneLogin_Saml2_Metadata.builder( - self.__sp, self.__security['authnRequestsSigned'], - self.__security['wantAssertionsSigned'], None, None, - self.get_contacts(), self.get_organization() - ) - cert = self.get_sp_cert() - if cert is not None: - metadata = OneLogin_Saml2_Metadata.add_x509_key_descriptors(metadata, cert) - - # Sign metadata - if 'signMetadata' in self.__security and self.__security['signMetadata'] is not False: - if self.__security['signMetadata'] is True: - key_file_name = 'sp.key' - cert_file_name = 'sp.crt' - else: - if ('keyFileName' not in self.__security['signMetadata'] or - 'certFileName' not in self.__security['signMetadata']): - raise OneLogin_Saml2_Error( - 'Invalid Setting: signMetadata value of the sp is not valid', - OneLogin_Saml2_Error.SETTINGS_INVALID_SYNTAX - ) - key_file_name = self.__security['signMetadata']['keyFileName'] - cert_file_name = self.__security['signMetadata']['certFileName'] - key_metadata_file = self.__paths['cert'] + key_file_name - cert_metadata_file = self.__paths['cert'] + cert_file_name - - if not exists(key_metadata_file): - raise OneLogin_Saml2_Error( - 'Private key file not found: %s', - OneLogin_Saml2_Error.PRIVATE_KEY_FILE_NOT_FOUND, - key_metadata_file - ) - - if not exists(cert_metadata_file): - raise OneLogin_Saml2_Error( - 'Public cert file not found: %s', - OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND, - cert_metadata_file - ) - - f = open(key_metadata_file, 'r') - key_metadata = f.read() - f.close() - f = open(cert_metadata_file, 'r') - cert_metadata = f.read() - f.close() - metadata = OneLogin_Saml2_Metadata.sign_metadata(metadata, key_metadata, cert_metadata) - - return metadata -
    -
    [docs] def validate_metadata(self, xml): - """ - Validates an XML SP Metadata. - - :param xml: Metadata's XML that will be validate - :type xml: string - - :returns: The list of found errors - :rtype: list - """ - - assert isinstance(xml, basestring) - - if len(xml) == 0: - raise Exception('Empty string supplied as input') - - errors = [] - res = OneLogin_Saml2_Utils.validate_xml(xml, 'saml-schema-metadata-2.0.xsd', self.__debug) - if not isinstance(res, Document): - errors.append(res) - else: - dom = res - element = dom.documentElement - if element.tagName != 'md:EntityDescriptor': - errors.append('noEntityDescriptor_xml') - else: - valid_until = cache_duration = expire_time = None - - if element.hasAttribute('validUntil'): - valid_until = OneLogin_Saml2_Utils.parse_SAML_to_time(element.getAttribute('validUntil')) - if element.hasAttribute('cacheDuration'): - cache_duration = element.getAttribute('cacheDuration') - - expire_time = OneLogin_Saml2_Utils.get_expire_time(cache_duration, valid_until) - if expire_time is not None and int(datetime.now().strftime('%s')) > int(expire_time): - errors.append('expired_xml') - - return errors -
    -
    [docs] def format_idp_cert(self): - """ - Formats the IdP cert. - """ - if self.__idp['x509cert'] is not None: - self.__idp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self.__idp['x509cert']) -
    -
    [docs] def get_errors(self): - """ - Returns an array with the errors, the array is empty when the settings is ok. - - :returns: Errors - :rtype: list - """ - return self.__errors -
    -
    [docs] def set_strict(self, value): - """ - Activates or deactivates the strict mode. - - :param xml: Strict parameter - :type xml: boolean - """ - assert isinstance(value, bool) - - self.__strict = value -
    -
    [docs] def is_strict(self): - """ - Returns if the 'strict' mode is active. - - :returns: Strict parameter - :rtype: boolean - """ - return self.__strict -
    -
    [docs] def is_debug_active(self): - """ - Returns if the debug is active. - - :returns: Debug parameter - :rtype: boolean - """ - return self.__debug
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_modules/saml2/utils.html b/docs/saml2/_modules/saml2/utils.html deleted file mode 100644 index 613d2a09..00000000 --- a/docs/saml2/_modules/saml2/utils.html +++ /dev/null @@ -1,805 +0,0 @@ - - - - - - - - - - saml2.utils — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for saml2.utils

    -# -*- coding: utf-8 -*-
    -
    -# Copyright (c) 2010-2018 OneLogin, Inc.
    -# MIT License
    -
    -import base64
    -from datetime import datetime
    -import calendar
    -from hashlib import sha1
    -from isodate import parse_duration as duration_parser
    -from lxml import etree
    -from lxml.etree import ElementBase
    -from os.path import basename, dirname, join
    -import re
    -from sys import stderr
    -from tempfile import NamedTemporaryFile
    -from textwrap import wrap
    -from urllib import quote_plus
    -from uuid import uuid4
    -from xml.dom.minidom import Document, parseString, Element
    -from xml.etree.ElementTree import tostring
    -import zlib
    -
    -import dm.xmlsec.binding as xmlsec
    -from dm.xmlsec.binding.tmpl import EncData, Signature
    -from M2Crypto import X509
    -
    -from saml2.constants import OneLogin_Saml2_Constants
    -from saml2.errors import OneLogin_Saml2_Error
    -
    -
    -def _(msg):
    -    # Fixme Add i18n support
    -    return msg
    -
    -
    -
    [docs]class OneLogin_Saml2_Utils: - - @staticmethod -
    [docs] def decode_base64_and_inflate(value): - """ base64 decodes and then inflates according to RFC1951 - :param value: a deflated and encoded string - :return: the string after decoding and inflating - """ - - return zlib.decompress(base64.b64decode(value), -15) -
    - @staticmethod -
    [docs] def deflate_and_base64_encode(value): - """ - Deflates and the base64 encodes a string - :param value: The string to deflate and encode - :return: The deflated and encoded string - """ - return base64.b64encode(zlib.compress(value)[2:-4]) -
    - @staticmethod -
    [docs] def validate_xml(xml, schema, debug=False): - """ - """ - assert (isinstance(xml, basestring) or isinstance(xml, Document)) - assert isinstance(schema, basestring) - - if isinstance(xml, Document): - xml = xml.toxml() - - # Switch to lxml for schema validation - try: - dom = etree.fromstring(xml) - except Exception: - return 'unloaded_xml' - - schema_file = join(dirname(__file__), 'schemas', schema) - f = open(schema_file, 'r') - schema_doc = etree.parse(f) - f.close() - xmlschema = etree.XMLSchema(schema_doc) - - if not xmlschema.validate(dom): - xml_errors = [xmlschema.error_log] - if debug: - stderr.write('Errors validating the metadata') - stderr.write(':\n\n') - for error in xml_errors: - stderr.write('%s\n' % error.message) - - return 'invalid_xml' - - return parseString(etree.tostring(dom)) -
    - @staticmethod -
    [docs] def format_cert(cert, heads=True): - """ - Returns a x509 cert (adding header & footer if required). - - :param cert: A x509 unformated cert - :type: string - - :param heads: True if we want to include head and footer - :type: boolean - - :returns: Formated cert - :rtype: string - """ - x509_cert = cert.replace('\x0D', '') - x509_cert = x509_cert.replace('\r', '') - x509_cert = x509_cert.replace('\n', '') - if len(x509_cert) > 0: - x509_cert = x509_cert.replace('-----BEGIN CERTIFICATE-----', '') - x509_cert = x509_cert.replace('-----END CERTIFICATE-----', '') - x509_cert = x509_cert.replace(' ', '') - - if heads: - x509_cert = '-----BEGIN CERTIFICATE-----\n' + '\n'.join(wrap(x509_cert, 64)) + '\n-----END CERTIFICATE-----\n' - - return x509_cert -
    - @staticmethod -
    [docs] def redirect(url, parameters={}, request_data={}): - """ - Executes a redirection to the provided url (or return the target url). - - :param url: The target url - :type: string - - :param parameters: Extra parameters to be passed as part of the url - :type: dict - - :param request_data: The request as a dict - :type: dict - - :returns: Url - :rtype: string - """ - assert isinstance(url, basestring) - assert isinstance(parameters, dict) - - if url.startswith('/'): - url = '%s%s' % (OneLogin_Saml2_Utils.get_self_url_host(request_data), url) - - # Verify that the URL is to a http or https site. - if re.search('^https?://', url) is None: - raise OneLogin_Saml2_Error( - 'Redirect to invalid URL: ' + url, - OneLogin_Saml2_Error.REDIRECT_INVALID_URL - ) - - # Add encoded parameters - if url.find('?') < 0: - param_prefix = '?' - else: - param_prefix = '&' - - for name, value in parameters.items(): - - if value is None: - param = urlencode(name) - elif isinstance(value, list): - param = '' - for val in value: - param += quote_plus(name) + '[]=' + quote_plus(val) + '&' - if len(param) > 0: - param = param[0:-1] - else: - param = quote_plus(name) + '=' + quote_plus(value) - - url += param_prefix + param - param_prefix = '&' - - return url -
    - @staticmethod -
    [docs] def get_self_url_host(request_data): - """ - Returns the protocol + the current host + the port (if different than - common ports). - - :param request_data: The request as a dict - :type: dict - - :return: Url - :rtype: string - """ - current_host = OneLogin_Saml2_Utils.get_self_host(request_data) - port = '' - if OneLogin_Saml2_Utils.is_https(request_data): - protocol = 'https' - else: - protocol = 'http' - - if 'server_port' in request_data: - port_number = request_data['server_port'] - port = ':' + port_number - - if protocol == 'http' and port_number == '80': - port = '' - elif protocol == 'https' and port_number == '443': - port = '' - - return '%s://%s%s' % (protocol, current_host, port) -
    - @staticmethod -
    [docs] def get_self_host(request_data): - """ - Returns the current host. - - :param request_data: The request as a dict - :type: dict - - :return: The current host - :rtype: string - """ - if 'http_host' in request_data: - current_host = request_data['http_host'] - elif 'server_name' in request_data: - current_host = request_data['server_name'] - else: - raise Exception('No hostname defined') - - if ':' in current_host: - current_host_data = current_host.split(':') - possible_port = current_host_data[-1] - try: - possible_port = float(possible_port) - current_host = current_host_data[0] - except ValueError: - current_host = ':'.join(current_host_data) - - return current_host -
    - @staticmethod -
    [docs] def is_https(request_data): - """ - Checks if https or http. - - :param request_data: The request as a dict - :type: dict - - :return: False if https is not active - :rtype: boolean - """ - is_https = 'https' in request_data and request_data['https'] != 'off' - is_https = is_https or ('server_port' in request_data and request_data['server_port'] == '443') - return is_https -
    - @staticmethod -
    [docs] def get_self_url_no_query(request_data): - """ - Returns the URL of the current host + current view. - - :param request_data: The request as a dict - :type: dict - - :return: The url of current host + current view - :rtype: string - """ - self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) - script_name = request_data['script_name'] - if script_name[0] != '/': - script_name = '/' + script_name - self_url_host += script_name - if 'path_info' in request_data: - self_url_host += request_data['path_info'] - - return self_url_host -
    - @staticmethod -
    [docs] def get_self_url(request_data): - """ - Returns the URL of the current host + current view + query. - - :param request_data: The request as a dict - :type: dict - - :return: The url of current host + current view + query - :rtype: string - """ - self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) - - request_uri = '' - if 'request_uri' in request_data: - request_uri = request_data['request_uri'] - if not request_uri.startswith('/'): - match = re.search('^https?://[^/]*(/.*)', request_uri) - if match is not None: - request_uri = match.groups()[0] - - return self_url_host + request_uri -
    - @staticmethod -
    [docs] def generate_unique_id(): - """ - Generates an unique string (used for example as ID for assertions). - - :return: A unique string - :rtype: string - """ - return 'ONELOGIN_%s' % sha1(uuid4().hex).hexdigest() -
    - @staticmethod -
    [docs] def parse_time_to_SAML(time): - """ - Converts a UNIX timestamp to SAML2 timestamp on the form - yyyy-mm-ddThh:mm:ss(\.s+)?Z. - - :param time: The time we should convert (DateTime). - :type: string - - :return: SAML2 timestamp. - :rtype: string - """ - data = datetime.utcfromtimestamp(float(time)) - return data.strftime('%Y-%m-%dT%H:%M:%SZ') -
    - @staticmethod -
    [docs] def parse_SAML_to_time(timestr): - """ - Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z - to a UNIX timestamp. The sub-second part is ignored. - - :param time: The time we should convert (SAML Timestamp). - :type: string - - :return: Converted to a unix timestamp. - :rtype: int - """ - try: - data = datetime.strptime(timestr, '%Y-%m-%dT%H:%M:%SZ') - except ValueError: - data = datetime.strptime(timestr, '%Y-%m-%dT%H:%M:%S.%fZ') - return calendar.timegm(data.utctimetuple()) -
    - @staticmethod -
    [docs] def parse_duration(duration, timestamp=None): - """ - Interprets a ISO8601 duration value relative to a given timestamp. - - :param duration: The duration, as a string. - :type: string - - :param timestamp: The unix timestamp we should apply the duration to. - Optional, default to the current time. - :type: string - - :return: The new timestamp, after the duration is applied. - :rtype: int - """ - assert isinstance(duration, basestring) - assert (timestamp is None or isinstance(timestamp, int)) - - timedelta = duration_parser(duration) - if timestamp is None: - data = datetime.utcnow() + timedelta - else: - data = datetime.utcfromtimestamp(timestamp) + timedelta - return calendar.timegm(data.utctimetuple()) -
    - @staticmethod -
    [docs] def get_expire_time(cache_duration=None, valid_until=None): - """ - Compares 2 dates and returns the earliest. - - :param cache_duration: The duration, as a string. - :type: string - - :param valid_until: The valid until date, as a string or as a timestamp - :type: string - - :return: The expiration time. - :rtype: int - """ - expire_time = None - - if cache_duration is not None: - expire_time = OneLogin_Saml2_Utils.parse_duration(cache_duration) - - if valid_until is not None: - if isinstance(valid_until, int): - valid_until_time = valid_until - else: - valid_until_time = OneLogin_Saml2_Utils.parse_SAML_to_time(valid_until) - if expire_time is None or expire_time > valid_until_time: - expire_time = valid_until_time - - if expire_time is not None: - return '%d' % expire_time - return None -
    - @staticmethod -
    [docs] def query(dom, query, context=None): - """ - Extracts nodes that match the query from the Element - - :param dom: The root of the lxml objet - :type: Element - - :param query: Xpath Expresion - :type: string - - :param context: Context Node - :type: DOMElement - - :returns: The queried nodes - :rtype: list - """ - if context is None: - return dom.xpath(query, namespaces=OneLogin_Saml2_Constants.NSMAP) - else: - return context.xpath(query, namespaces=OneLogin_Saml2_Constants.NSMAP) -
    - @staticmethod -
    [docs] def delete_local_session(callback=None): - """ - Deletes the local session. - """ - - if callback is not None: - callback() -
    - @staticmethod -
    [docs] def calculate_x509_fingerprint(x509_cert): - """ - Calculates the fingerprint of a x509cert. - - :param x509_cert: x509 cert - :type: string - - :returns: Formated fingerprint - :rtype: string - """ - assert isinstance(x509_cert, basestring) - - lines = x509_cert.split('\n') - data = '' - - for line in lines: - # Remove '\r' from end of line if present. - line = line.rstrip() - if line == '-----BEGIN CERTIFICATE-----': - # Delete junk from before the certificate. - data = '' - elif line == '-----END CERTIFICATE-----': - # Ignore data after the certificate. - break - elif line == '-----BEGIN PUBLIC KEY-----' or line == '-----BEGIN RSA PRIVATE KEY-----': - # This isn't an X509 certificate. - return None - else: - # Append the current line to the certificate data. - data += line - # "data" now contains the certificate as a base64-encoded string. The - # fingerprint of the certificate is the sha1-hash of the certificate. - return sha1(base64.b64decode(data)).hexdigest().lower() -
    - @staticmethod -
    [docs] def format_finger_print(fingerprint): - """ - Formates a fingerprint. - - :param fingerprint: fingerprint - :type: string - - :returns: Formated fingerprint - :rtype: string - """ - formated_fingerprint = fingerprint.replace(':', '') - return formated_fingerprint.lower() -
    - @staticmethod -
    [docs] def generate_name_id(value, sp_nq, sp_format, key=None): - """ - Generates a nameID. - - :param value: fingerprint - :type: string - - :param sp_nq: SP Name Qualifier - :type: string - - :param sp_format: SP Format - :type: string - - :param key: SP Key to encrypt the nameID - :type: string - - :returns: DOMElement | XMLSec nameID - :rtype: string - """ - doc = Document() - - name_id = doc.createElement('saml:NameID') - name_id.setAttribute('SPNameQualifier', sp_nq) - name_id.setAttribute('Format', sp_format) - name_id.appendChild(doc.createTextNode(value)) - - doc.appendChild(name_id) - - if key is not None: - xmlsec.initialize() - - # Load the private key - mngr = xmlsec.KeysMngr() - key = OneLogin_Saml2_Utils.format_cert(key, heads=False) - file_key = OneLogin_Saml2_Utils.write_temp_file(key) - key_data = xmlsec.Key.load(file_key.name, xmlsec.KeyDataFormatPem, None) - key_data.name = key_name = basename(file_key.name) - mngr.addKey(key_data) - file_key.close() - - # Prepare for encryption - enc_data = EncData(xmlsec.TransformAes128Cbc, type=xmlsec.TypeEncElement) - enc_data.ensureCipherValue() - key_info = enc_data.ensureKeyInfo() - enc_key = key_info.addEncryptedKey(xmlsec.TransformRsaPkcs1) - enc_key.ensureCipherValue() - enc_key_info = enc_key.ensureKeyInfo() - enc_key_info.addKeyName(key_name) - - # Encrypt! - enc_ctx = xmlsec.EncCtx(mngr) - enc_ctx.enc_key = xmlsec.Key.generate(xmlsec.KeyDataAes, 128, xmlsec.KeyDataTypeSession) - ed = enc_ctx.encryptXml(enc_data, doc.getroot()) - - # Build XML with encrypted data - newdoc = Document() - encrypted_id = newdoc.createElement('saml:EncryptedID') - newdoc.appendChild(encrypted_id) - encrypted_id.appendChild(encrypted_id.ownerDocument.importNode(ed, True)) - - return newdoc.saveXML(encrypted_id) - else: - return doc.saveXML(name_id) -
    - @staticmethod -
    [docs] def get_status(dom): - """ - Gets Status from a Response. - - :param dom: The Response as XML - :type: Document - - :returns: The Status, an array with the code and a message. - :rtype: dict - """ - status = {} - - status_entry = OneLogin_Saml2_Utils.query(dom, '/samlp:Response/samlp:Status') - if len(status_entry) == 0: - raise Exception('Missing Status on response') - - code_entry = OneLogin_Saml2_Utils.query(dom, '/samlp:Response/samlp:Status/samlp:StatusCode', status_entry[0]) - if len(code_entry) == 0: - raise Exception('Missing Status Code on response') - code = code_entry[0].values()[0] - status['code'] = code - - message_entry = OneLogin_Saml2_Utils.query(dom, '/samlp:Response/samlp:Status/samlp:StatusMessage', status_entry[0]) - if len(message_entry) == 0: - status['msg'] = '' - else: - status['msg'] = message_entry[0].text - - return status -
    - @staticmethod -
    [docs] def decrypt_element(encrypted_data, enc_ctx): - """ - Decrypts an encrypted element. - - :param encrypted_data: The encrypted data. - :type: DOMElement - - :param enc_ctx: The encryption context. - :type: Encryption Context - - :returns: The decrypted element. - :rtype: DOMElement - """ - if isinstance(encrypted_data, Element): - # Minidom element - encrypted_data = etree.fromstring(encrypted_data.toxml()) - - decrypted = enc_ctx.decrypt(encrypted_data) - if isinstance(decrypted, ElementBase): - # lxml element, decrypted xml data - return tostring(decrypted.getroottree()) - else: - # decrypted binary data - return decrypted -
    - @staticmethod -
    [docs] def write_temp_file(content): - """ - Writes some content into a temporary file and returns it. - - :param content: The file content - :type: string - - :returns: The temporary file - :rtype: file-like object - """ - f = NamedTemporaryFile(delete=True) - f.file.write(content) - f.file.flush() - return f -
    - @staticmethod -
    [docs] def add_sign(xml, key, cert): - """ - Adds signature key and senders certificate to an element (Message or - Assertion). - - :param xml: The element we should sign - :type: string | Document - - :param key: The private key - :type: string - - :param cert: The public - :type: string - """ - if isinstance(xml, Document): - dom = xml - else: - if xml == '': - raise Exception('Empty string supplied as input') - - try: - dom = parseString(xml) - except Exception: - raise Exception('Error parsing xml string') - - xmlsec.initialize() - - # TODO the key and cert could be file descriptors instead - # Load the private key. - file_key = OneLogin_Saml2_Utils.write_temp_file(key) - sign_key = xmlsec.Key.load(file_key.name, xmlsec.KeyDataFormatPem, None) - file_key.close() - # Add the certificate to the signature. - file_cert = OneLogin_Saml2_Utils.write_temp_file(cert) - sign_key.loadCert(file_cert.name, xmlsec.KeyDataFormatPem) - file_cert.close() - - # Get the EntityDescriptor node we should sign. - root_node = dom.firstChild - - # Sign the metadata with our private key. - signature = Signature(xmlsec.TransformExclC14N, xmlsec.TransformRsaSha1) - ref = signature.addReference(xmlsec.TransformSha1) - ref.addTransform(xmlsec.TransformEnveloped) - - key_info = signature.ensureKeyInfo() - key_info.addX509Data() - - dsig_ctx = xmlsec.DSigCtx() - dsig_ctx.signKey = sign_key - dsig_ctx.sign(signature) - - signature = tostring(signature).replace('ns0:', 'ds:').replace(':ns0', ':ds') - signature = parseString(signature).firstChild - - insert_before = root_node.getElementsByTagName('saml:Issuer') - if len(insert_before) > 0: - insert_before = insert_before[0].nextSibling - else: - insert_before = root_node.firstChild.nextSibling.nextSibling - root_node.insertBefore(signature, insert_before) - - return dom.toxml() -
    - @staticmethod -
    [docs] def validate_sign(xml, cert=None, fingerprint=None): - """ - Validates a signature (Message or Assertion). - - :param xml: The element we should validate - :type: string | Document - - :param cert: The pubic cert - :type: string - - :param fingerprint: The fingerprint of the public cert - :type: string - """ - if isinstance(xml, Document): - dom = etree.fromstring(xml.toxml()) - else: - if xml == '': - raise Exception('Empty string supplied as input') - - try: - dom = etree.fromstring(xml) - except Exception: - raise Exception('Error parsing xml string') - - xmlsec.initialize() - - # Find signature in the dom - signature_node = OneLogin_Saml2_Utils.query(dom, 'ds:Signature')[0] - - # Prepare context and load cert into it - dsig_ctx = xmlsec.DSigCtx() - sign_cert = X509.load_cert_string(str(cert), X509.FORMAT_PEM) - pub_key = sign_cert.get_pubkey().get_rsa() - sign_key = xmlsec.Key.loadMemory(pub_key.as_pem(cipher=None), - xmlsec.KeyDataFormatPem) - dsig_ctx.signKey = sign_key - - # Verify signature - dsig_ctx.verify(signature_node)
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/_sources/index.rst.txt b/docs/saml2/_sources/index.rst.txt new file mode 100644 index 00000000..020156af --- /dev/null +++ b/docs/saml2/_sources/index.rst.txt @@ -0,0 +1,14 @@ +.. SAML Python2/3 Toolkit documentation master file, created by + sphinx-quickstart on Sun Oct 1 03:00:42 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to SAML Python2/3 Toolkit's documentation! +================================================== + +.. toctree:: + :maxdepth: 4 + :caption: Contents: + + onelogin + diff --git a/docs/saml2/_sources/index.txt b/docs/saml2/_sources/index.txt deleted file mode 100644 index 43d48f47..00000000 --- a/docs/saml2/_sources/index.txt +++ /dev/null @@ -1,23 +0,0 @@ -.. saml2 documentation master file, created by - sphinx-quickstart on Thu Oct 23 03:29:00 2014. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to OneLogin SAML Python library documentation -===================================================== - -Contents: - -.. toctree:: - :maxdepth: 4 - - saml2 - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/docs/saml2/_sources/modules.rst.txt b/docs/saml2/_sources/modules.rst.txt new file mode 100644 index 00000000..529aa5bd --- /dev/null +++ b/docs/saml2/_sources/modules.rst.txt @@ -0,0 +1,7 @@ +onelogin +======== + +.. toctree:: + :maxdepth: 4 + + onelogin diff --git a/docs/saml2/_sources/onelogin.rst.txt b/docs/saml2/_sources/onelogin.rst.txt new file mode 100644 index 00000000..33f8a252 --- /dev/null +++ b/docs/saml2/_sources/onelogin.rst.txt @@ -0,0 +1,18 @@ +onelogin package +================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + onelogin.saml2 + +Module contents +--------------- + +.. automodule:: onelogin + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/saml2/_sources/onelogin.saml2.rst.txt b/docs/saml2/_sources/onelogin.saml2.rst.txt new file mode 100644 index 00000000..3ba9d62b --- /dev/null +++ b/docs/saml2/_sources/onelogin.saml2.rst.txt @@ -0,0 +1,133 @@ +onelogin.saml2 package +====================== + +Submodules +---------- + +onelogin.saml2.auth module +-------------------------- + +.. automodule:: onelogin.saml2.auth + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.authn\_request module +------------------------------------ + +.. automodule:: onelogin.saml2.authn_request + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.compat module +---------------------------- + +.. automodule:: onelogin.saml2.compat + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.constants module +------------------------------- + +.. automodule:: onelogin.saml2.constants + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.errors module +---------------------------- + +.. automodule:: onelogin.saml2.errors + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.idp\_metadata\_parser module +------------------------------------------- + +.. automodule:: onelogin.saml2.idp_metadata_parser + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.logout\_request module +------------------------------------- + +.. automodule:: onelogin.saml2.logout_request + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.logout\_response module +-------------------------------------- + +.. automodule:: onelogin.saml2.logout_response + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.metadata module +------------------------------ + +.. automodule:: onelogin.saml2.metadata + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.response module +------------------------------ + +.. automodule:: onelogin.saml2.response + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.settings module +------------------------------ + +.. automodule:: onelogin.saml2.settings + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.utils module +--------------------------- + +.. automodule:: onelogin.saml2.utils + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.xml\_templates module +------------------------------------ + +.. automodule:: onelogin.saml2.xml_templates + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.xml\_utils module +-------------------------------- + +.. automodule:: onelogin.saml2.xml_utils + :members: + :undoc-members: + :show-inheritance: + +onelogin.saml2.xmlparser module +------------------------------- + +.. automodule:: onelogin.saml2.xmlparser + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: onelogin.saml2 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/saml2/_sources/saml2.txt b/docs/saml2/_sources/saml2.txt deleted file mode 100644 index bf444d4d..00000000 --- a/docs/saml2/_sources/saml2.txt +++ /dev/null @@ -1,83 +0,0 @@ -OneLogin saml2 Module -====================== - -:mod:`auth` Class ------------------- - -.. automodule:: saml2.auth - :members: - :undoc-members: - :show-inheritance: - -:mod:`authn_request` Class ---------------------------- - -.. automodule:: saml2.authn_request - :members: - :undoc-members: - :show-inheritance: - -:mod:`constants` Class ------------------------ - -.. automodule:: saml2.constants - :members: - :undoc-members: - :show-inheritance: - -:mod:`errors` Class --------------------- - -.. automodule:: saml2.errors - :members: - :undoc-members: - :show-inheritance: - -:mod:`logout_request` Class ----------------------------- - -.. automodule:: saml2.logout_request - :members: - :undoc-members: - :show-inheritance: - -:mod:`logout_response` Class ------------------------------ - -.. automodule:: saml2.logout_response - :members: - :undoc-members: - :show-inheritance: - -:mod:`metadata` Class ----------------------- - -.. automodule:: saml2.metadata - :members: - :undoc-members: - :show-inheritance: - -:mod:`response` Class ----------------------- - -.. automodule:: saml2.response - :members: - :undoc-members: - :show-inheritance: - -:mod:`settings` Class ----------------------- - -.. automodule:: saml2.settings - :members: - :undoc-members: - :show-inheritance: - -:mod:`utils` Class -------------------- - -.. automodule:: saml2.utils - :members: - :undoc-members: - :show-inheritance: - diff --git a/docs/saml2/_static/_sphinx_javascript_frameworks_compat.js b/docs/saml2/_static/_sphinx_javascript_frameworks_compat.js new file mode 100644 index 00000000..81415803 --- /dev/null +++ b/docs/saml2/_static/_sphinx_javascript_frameworks_compat.js @@ -0,0 +1,123 @@ +/* Compatability shim for jQuery and underscores.js. + * + * Copyright Sphinx contributors + * Released under the two clause BSD licence + */ + +/** + * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL + */ +jQuery.urldecode = function(x) { + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} diff --git a/docs/saml2/_static/ajax-loader.gif b/docs/saml2/_static/ajax-loader.gif deleted file mode 100644 index 61faf8ca..00000000 Binary files a/docs/saml2/_static/ajax-loader.gif and /dev/null differ diff --git a/docs/saml2/_static/basic.css b/docs/saml2/_static/basic.css index 43e8bafa..cfc60b86 100644 --- a/docs/saml2/_static/basic.css +++ b/docs/saml2/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -15,6 +15,12 @@ div.clearer { clear: both; } +div.section::after { + display: block; + content: ''; + clear: left; +} + /* -- relbar ---------------------------------------------------------------- */ div.related { @@ -52,6 +58,8 @@ div.sphinxsidebar { width: 230px; margin-left: -100%; font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; } div.sphinxsidebar ul { @@ -79,16 +87,29 @@ div.sphinxsidebar input { font-size: 1em; } +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; } div.sphinxsidebar #searchbox input[type="submit"] { - width: 30px; + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; } + img { border: 0; + max-width: 100%; } /* -- search page ----------------------------------------------------------- */ @@ -109,7 +130,7 @@ ul.search li a { font-weight: bold; } -ul.search li div.context { +ul.search li p.context { color: #888; margin: 2px 0 0 30px; text-align: left; @@ -123,6 +144,8 @@ ul.keywordmatches li.goodmatch a { table.contentstable { width: 90%; + margin-left: auto; + margin-right: auto; } table.contentstable p.biglink { @@ -150,9 +173,14 @@ table.indextable td { vertical-align: top; } -table.indextable dl, table.indextable dd { +table.indextable ul { margin-top: 0; margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; } table.indextable tr.pcap { @@ -184,8 +212,27 @@ div.genindex-jumpbox { padding: 0.4em; } +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + /* -- general body styles --------------------------------------------------- */ +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + a.headerlink { visibility: hidden; } @@ -196,7 +243,10 @@ h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, -dt:hover > a.headerlink { +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { visibility: visible; } @@ -208,10 +258,6 @@ div.body td { text-align: left; } -.field-list ul { - padding-left: 1em; -} - .first { margin-top: 0 !important; } @@ -221,19 +267,25 @@ p.rubric { font-weight: bold; } -img.align-left, .figure.align-left, object.align-left { +img.align-left, figure.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } -img.align-right, .figure.align-right, object.align-right { +img.align-right, figure.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } -img.align-center, .figure.align-center, object.align-center { +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; @@ -247,30 +299,45 @@ img.align-center, .figure.align-center, object.align-center { text-align: center; } +.align-default { + text-align: center; +} + .align-right { text-align: right; } /* -- sidebars -------------------------------------------------------------- */ -div.sidebar { +div.sidebar, +aside.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; - padding: 7px 7px 0 7px; + padding: 7px; background-color: #ffe; width: 40%; float: right; + clear: right; + overflow-x: auto; } p.sidebar-title { font-weight: bold; } +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + /* -- topics ---------------------------------------------------------------- */ +nav.contents, +aside.topic, div.topic { border: 1px solid #ccc; - padding: 7px 7px 0 7px; + padding: 7px; margin: 10px 0 10px 0; } @@ -292,10 +359,6 @@ div.admonition dt { font-weight: bold; } -div.admonition dl { - margin-bottom: 0; -} - p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; @@ -306,13 +369,55 @@ div.body p.centered { margin-top: 25px; } +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + /* -- tables ---------------------------------------------------------------- */ table.docutils { + margin-top: 10px; + margin-bottom: 10px; border: 0; border-collapse: collapse; } +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + table.docutils td, table.docutils th { padding: 1px 8px 1px 5px; border-top: 0; @@ -321,14 +426,6 @@ table.docutils td, table.docutils th { border-bottom: 1px solid #aaa; } -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - th { text-align: left; padding-right: 5px; @@ -343,6 +440,126 @@ table.citation td { border-bottom: none; } +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + /* -- other body styles ----------------------------------------------------- */ ol.arabic { @@ -365,11 +582,81 @@ ol.upperroman { list-style: upper-roman; } +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + dl { margin-bottom: 15px; } -dd p { +dd > :first-child { margin-top: 0px; } @@ -383,30 +670,32 @@ dd { margin-left: 30px; } -dt:target, .highlighted { - background-color: #fbe54e; +.sig dd { + margin-top: 0px; + margin-bottom: 0px; } -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; +.sig dl { + margin-top: 0px; + margin-bottom: 0px; } -.field-list ul { - margin: 0; - padding-left: 1em; +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; } -.field-list p { - margin: 0; +dt:target, span.highlighted { + background-color: #fbe54e; } -.refcount { - color: #060; +rect.highlighted { + fill: #fbe54e; } -.optional { - font-size: 1.3em; +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; } .versionmodified { @@ -447,11 +736,26 @@ dl.glossary dt { font-style: oblique; } +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + abbr, acronym { border-bottom: dotted 1px; cursor: help; } +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + /* -- code displays --------------------------------------------------------- */ pre { @@ -459,37 +763,105 @@ pre { overflow-y: hidden; /* fixes display issues on Chrome browsers */ } +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + td.linenos pre { - padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { - margin-left: 0.5em; + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; } table.highlighttable td { - padding: 0 0.5em 0 0.5em; + margin: 0; + padding: 0; } -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; } -tt.descclassname { +div.code-block-caption code { background-color: transparent; } -tt.xref, a tt { +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { background-color: transparent; font-weight: bold; } -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { background-color: transparent; } @@ -521,6 +893,15 @@ span.eqno { float: right; } +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + /* -- printout stylesheet --------------------------------------------------- */ @media print { diff --git a/docs/saml2/_static/comment-bright.png b/docs/saml2/_static/comment-bright.png deleted file mode 100644 index 551517b8..00000000 Binary files a/docs/saml2/_static/comment-bright.png and /dev/null differ diff --git a/docs/saml2/_static/comment-close.png b/docs/saml2/_static/comment-close.png deleted file mode 100644 index 09b54be4..00000000 Binary files a/docs/saml2/_static/comment-close.png and /dev/null differ diff --git a/docs/saml2/_static/comment.png b/docs/saml2/_static/comment.png deleted file mode 100644 index 92feb52b..00000000 Binary files a/docs/saml2/_static/comment.png and /dev/null differ diff --git a/docs/saml2/_static/css/badge_only.css b/docs/saml2/_static/css/badge_only.css new file mode 100644 index 00000000..c718cee4 --- /dev/null +++ b/docs/saml2/_static/css/badge_only.css @@ -0,0 +1 @@ +.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} \ No newline at end of file diff --git a/docs/saml2/_static/css/fonts/Roboto-Slab-Bold.woff b/docs/saml2/_static/css/fonts/Roboto-Slab-Bold.woff new file mode 100644 index 00000000..6cb60000 Binary files /dev/null and b/docs/saml2/_static/css/fonts/Roboto-Slab-Bold.woff differ diff --git a/docs/saml2/_static/css/fonts/Roboto-Slab-Bold.woff2 b/docs/saml2/_static/css/fonts/Roboto-Slab-Bold.woff2 new file mode 100644 index 00000000..7059e231 Binary files /dev/null and b/docs/saml2/_static/css/fonts/Roboto-Slab-Bold.woff2 differ diff --git a/docs/saml2/_static/css/fonts/Roboto-Slab-Regular.woff b/docs/saml2/_static/css/fonts/Roboto-Slab-Regular.woff new file mode 100644 index 00000000..f815f63f Binary files /dev/null and b/docs/saml2/_static/css/fonts/Roboto-Slab-Regular.woff differ diff --git a/docs/saml2/_static/css/fonts/Roboto-Slab-Regular.woff2 b/docs/saml2/_static/css/fonts/Roboto-Slab-Regular.woff2 new file mode 100644 index 00000000..f2c76e5b Binary files /dev/null and b/docs/saml2/_static/css/fonts/Roboto-Slab-Regular.woff2 differ diff --git a/docs/saml2/_static/css/fonts/fontawesome-webfont.eot b/docs/saml2/_static/css/fonts/fontawesome-webfont.eot new file mode 100644 index 00000000..e9f60ca9 Binary files /dev/null and b/docs/saml2/_static/css/fonts/fontawesome-webfont.eot differ diff --git a/docs/saml2/_static/css/fonts/fontawesome-webfont.svg b/docs/saml2/_static/css/fonts/fontawesome-webfont.svg new file mode 100644 index 00000000..855c845e --- /dev/null +++ b/docs/saml2/_static/css/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/saml2/_static/css/fonts/fontawesome-webfont.ttf b/docs/saml2/_static/css/fonts/fontawesome-webfont.ttf new file mode 100644 index 00000000..35acda2f Binary files /dev/null and b/docs/saml2/_static/css/fonts/fontawesome-webfont.ttf differ diff --git a/docs/saml2/_static/css/fonts/fontawesome-webfont.woff b/docs/saml2/_static/css/fonts/fontawesome-webfont.woff new file mode 100644 index 00000000..400014a4 Binary files /dev/null and b/docs/saml2/_static/css/fonts/fontawesome-webfont.woff differ diff --git a/docs/saml2/_static/css/fonts/fontawesome-webfont.woff2 b/docs/saml2/_static/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 00000000..4d13fc60 Binary files /dev/null and b/docs/saml2/_static/css/fonts/fontawesome-webfont.woff2 differ diff --git a/docs/saml2/_static/css/fonts/lato-bold-italic.woff b/docs/saml2/_static/css/fonts/lato-bold-italic.woff new file mode 100644 index 00000000..88ad05b9 Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-bold-italic.woff differ diff --git a/docs/saml2/_static/css/fonts/lato-bold-italic.woff2 b/docs/saml2/_static/css/fonts/lato-bold-italic.woff2 new file mode 100644 index 00000000..c4e3d804 Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-bold-italic.woff2 differ diff --git a/docs/saml2/_static/css/fonts/lato-bold.woff b/docs/saml2/_static/css/fonts/lato-bold.woff new file mode 100644 index 00000000..c6dff51f Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-bold.woff differ diff --git a/docs/saml2/_static/css/fonts/lato-bold.woff2 b/docs/saml2/_static/css/fonts/lato-bold.woff2 new file mode 100644 index 00000000..bb195043 Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-bold.woff2 differ diff --git a/docs/saml2/_static/css/fonts/lato-normal-italic.woff b/docs/saml2/_static/css/fonts/lato-normal-italic.woff new file mode 100644 index 00000000..76114bc0 Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-normal-italic.woff differ diff --git a/docs/saml2/_static/css/fonts/lato-normal-italic.woff2 b/docs/saml2/_static/css/fonts/lato-normal-italic.woff2 new file mode 100644 index 00000000..3404f37e Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-normal-italic.woff2 differ diff --git a/docs/saml2/_static/css/fonts/lato-normal.woff b/docs/saml2/_static/css/fonts/lato-normal.woff new file mode 100644 index 00000000..ae1307ff Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-normal.woff differ diff --git a/docs/saml2/_static/css/fonts/lato-normal.woff2 b/docs/saml2/_static/css/fonts/lato-normal.woff2 new file mode 100644 index 00000000..3bf98433 Binary files /dev/null and b/docs/saml2/_static/css/fonts/lato-normal.woff2 differ diff --git a/docs/saml2/_static/css/theme.css b/docs/saml2/_static/css/theme.css new file mode 100644 index 00000000..19a446a0 --- /dev/null +++ b/docs/saml2/_static/css/theme.css @@ -0,0 +1,4 @@ +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/docs/saml2/_static/default.css b/docs/saml2/_static/default.css deleted file mode 100644 index 21f3f509..00000000 --- a/docs/saml2/_static/default.css +++ /dev/null @@ -1,256 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff --git a/docs/saml2/_static/doctools.js b/docs/saml2/_static/doctools.js index 61c8f160..d06a71d7 100644 --- a/docs/saml2/_static/doctools.js +++ b/docs/saml2/_static/doctools.js @@ -2,246 +2,155 @@ * doctools.js * ~~~~~~~~~~~ * - * Sphinx JavaScript utilities for all documentation. + * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -} - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * small function to check if an array contains - * a given item. - */ -jQuery.contains = function(arr, item) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == item) - return true; - } - return false; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasMethod(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); } - return this.each(function() { - highlight(this); - }); }; /** * Small JavaScript module for the documentation. */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); }, /** * i18n support */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } }, - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; }, - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; }, /** - * init the domain index toggle buttons + * helper function to focus on search bar */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); }, /** - * helper function to hide the search marks again + * Initialise the domain index toggle buttons */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeMethod('highlighted'); + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); }, - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } + }, }; // quick alias for translations -_ = Documentation.gettext; +const _ = Documentation.gettext; -$(document).ready(function() { - Documentation.init(); -}); +_ready(Documentation.init); diff --git a/docs/saml2/_static/documentation_options.js b/docs/saml2/_static/documentation_options.js new file mode 100644 index 00000000..2db8a09e --- /dev/null +++ b/docs/saml2/_static/documentation_options.js @@ -0,0 +1,14 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '1', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/docs/saml2/_static/down-pressed.png b/docs/saml2/_static/down-pressed.png deleted file mode 100644 index 6f7ad782..00000000 Binary files a/docs/saml2/_static/down-pressed.png and /dev/null differ diff --git a/docs/saml2/_static/down.png b/docs/saml2/_static/down.png deleted file mode 100644 index 3003a887..00000000 Binary files a/docs/saml2/_static/down.png and /dev/null differ diff --git a/docs/saml2/_static/file.png b/docs/saml2/_static/file.png index d18082e3..a858a410 100644 Binary files a/docs/saml2/_static/file.png and b/docs/saml2/_static/file.png differ diff --git a/docs/saml2/_static/jquery.js b/docs/saml2/_static/jquery.js index dc2f3dac..c4c6022f 100644 --- a/docs/saml2/_static/jquery.js +++ b/docs/saml2/_static/jquery.js @@ -1,9404 +1,2 @@ -/*! - * jQuery JavaScript Library v1.7.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Fri Jul 5 14:07:58 UTC 2013 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, - rmsPrefix = /^-ms-/, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Method]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.7.2", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.add( fn ); - - return this; - }, - - eq: function( i ) { - i = +i; - return i === -1 ? - this.slice( i ) : - this.slice( i, i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).off( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - var xml, tmp; - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array, i ) { - var len; - - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); - } - - len = array.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, pass ) { - var exec, - bulk = key == null, - i = 0, - length = elems.length; - - // Sets many values - if ( key && typeof key === "object" ) { - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); - } - chainable = 1; - - // Sets one value - } else if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = pass === undefined && jQuery.isFunction( value ); - - if ( bulk ) { - // Bulk operations only iterate when executing function values - if ( exec ) { - exec = fn; - fn = function( elem, key, value ) { - return exec.call( jQuery( elem ), value ); - }; - - // Otherwise they run against the entire set - } else { - fn.call( elems, value ); - fn = null; - } - } - - if ( fn ) { - for (; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - } - - chainable = 1; - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } - return object; -} - -/* - * Create a callback list using the following parameters: - * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible flags: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( flags ) { - - // Convert flags from String-formatted to Object-formatted - // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; - - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, - // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; - fired = true; - firing = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted - break; - } - } - firing = false; - if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); - } - } else if ( memory === true ) { - self.disable(); - } else { - list = []; - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - var length = list.length; - add( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } - } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; - } - } - } - } - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory || memory === true ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( stack ) { - if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - - Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), - state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, - promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - - state: function() { - return state; - }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, - always: function() { - deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); - return this; - }, - pipe: function( fnDone, fnFail, fnProgress ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; - } - }, - deferred = promise.promise({}), - key; - - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } - - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } - if ( length > 1 ) { - for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return promise; - } -}); - - - - -jQuery.support = (function() { - - var support, - all, - a, - select, - opt, - input, - fragment, - tds, - events, - eventName, - i, - isSupported, - div = document.createElement( "div" ), - documentElement = document.documentElement; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
    a"; - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute("href") === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Tests for enctype support on a form(#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true, - pixelMargin: true - }; - - // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead - jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.lastChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - fragment.removeChild( input ); - fragment.appendChild( div ); - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for ( i in { - submit: 1, - change: 1, - focusin: 1 - }) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - fragment.removeChild( div ); - - // Null elements to avoid leaks in IE - fragment = select = opt = div = input = null; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, - paddingMarginBorderVisibility, paddingMarginBorder, - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - conMarginTop = 1; - paddingMarginBorder = "padding:0;margin:0;border:"; - positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; - paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; - style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; - html = "
    " + - "" + - "
    "; - - container = document.createElement("div"); - container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; - body.insertBefore( container, body.firstChild ); - - // Construct the test element - div = document.createElement("div"); - container.appendChild( div ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - div.innerHTML = "
    t
    "; - tds = div.getElementsByTagName( "td" ); - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE <= 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( window.getComputedStyle ) { - div.innerHTML = ""; - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.style.width = "2px"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - if ( typeof div.style.zoom !== "undefined" ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.innerHTML = ""; - div.style.width = div.style.padding = "1px"; - div.style.border = 0; - div.style.overflow = "hidden"; - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = "block"; - div.style.overflow = "visible"; - div.innerHTML = "
    "; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - } - - div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; - div.innerHTML = html; - - outer = div.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - if ( window.getComputedStyle ) { - div.style.marginTop = "1%"; - support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; - } - - if ( typeof container.style.zoom !== "undefined" ) { - container.style.zoom = 1; - } - - body.removeChild( container ); - marginDiv = div = container = null; - - jQuery.extend( support, offsetSupport ); - }); - - return support; -})(); - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var privateCache, thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, - isEvents = name === "events"; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - privateCache = thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - // Reference to internal data cache key - internalKey = jQuery.expando, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ internalKey ] : internalKey; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ internalKey ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - } else { - elem[ internalKey ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, part, attr, name, l, - elem = this[0], - i = 0, - data = null; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attr = elem.attributes; - for ( l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split( ".", 2 ); - parts[1] = parts[1] ? "." + parts[1] : ""; - part = parts[1] + "!"; - - return jQuery.access( this, function( value ) { - - if ( value === undefined ) { - data = this.triggerHandler( "getData" + part, [ parts[0] ] ); - - // Try to fetch any internally stored data first - if ( data === undefined && elem ) { - data = jQuery.data( elem, key ); - data = dataAttr( elem, key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } - - parts[1] = value; - this.each(function() { - var self = jQuery( this ); - - self.triggerHandler( "setData" + part, parts ); - jQuery.data( this, key, value ); - self.triggerHandler( "changeData" + part, parts ); - }); - }, null, value, arguments.length > 1, null, false ); - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - jQuery.isNumeric( data ) ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - var q; - if ( elem ) { - type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - hooks = {}; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { - count++; - tmp.add( resolve ); - } - } - resolve(); - return defer.promise( object ); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addMethod: function( value ) { - var classNames, i, l, elem, - setMethod, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addMethod( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setMethod = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setMethod.indexOf( " " + classNames[ c ] + " " ) ) { - setMethod += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setMethod ); - } - } - } - } - - return this; - }, - - removeMethod: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeMethod( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleMethod: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleMethod( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasMethod( className ); - self[ state ? "addMethod" : "removeMethod" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasMethod: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, i, max, option, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - i = one ? index : 0; - max = one ? index + 1 : options.length; - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, l, isBool, - i = 0; - - if ( value && elem.nodeType === 1 ) { - attrNames = value.toLowerCase().split( rspace ); - l = attrNames.length; - - for ( ; i < l; i++ ) { - name = attrNames[ i ]; - - if ( name ) { - propName = jQuery.propFix[ name ] || name; - isBool = rboolean.test( name ); - - // See #9699 for explanation of this approach (setting first, then removal) - // Do not do this for boolean attributes (see #10870) - if ( !isBool ) { - jQuery.attr( elem, name, "" ); - } - elem.removeAttribute( getSetAttribute ? name : propName ); - - // Set corresponding property to false for boolean attributes - if ( isBool && propName in elem ) { - elem[ propName ] = false; - } - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - fixSpecified = { - name: true, - id: true, - coords: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return ( ret.nodeValue = value + "" ); - } - }; - - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); - - - - -var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - var attrs = elem.attributes || {}; - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || (attrs.id || {}).value === m[2]) && - (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) - ); - }, - hoverHack = function( events ) { - return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = jQuery.trim( hoverHack(types) ).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = ( tns[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - quick: selector && quickParse( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, origType, namespaces, origCount, - j, events, special, handle, eventType, handleObj; - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = jQuery.trim( hoverHack( types || "" ) ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = origType = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - - // Remove matching events - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !namespaces || namespaces.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - // Note that this is a bare JS function and not a jQuery handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), - run_all = !event.exclusive && !event.namespace, - special = jQuery.event.special[ event.type ] || {}, - handlerQueue = [], - i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers that should run if there are delegated events - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !(event.button && event.type === "click") ) { - - // Pregenerate a single jQuery object for reuse with .is() - jqcur = jQuery(this); - jqcur.context = this.ownerDocument || this; - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - - // Don't process events on disabled elements (#6911, #8165) - if ( cur.disabled !== true ) { - selMatch = {}; - matches = []; - jqcur[0] = cur; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - - if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = ( - handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) - ); - } - if ( selMatch[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( handlers.length > delegateCount ) { - handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); - } - - // Run delegates first; they may want to stop propagation beneath us - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - event.currentTarget = matched.elem; - - for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = matched.matches[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - - focus: { - delegateType: "focusin" - }, - blur: { - delegateType: "focusout" - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Some plugins are using, but it's undocumented/deprecated and will be removed. -// The 1.7 special event interface should provide all the hooks needed now. -jQuery.event.handle = jQuery.event.dispatch; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector, - ret; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - form._submit_attached = true; - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); - } - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - elem._change_attached = true; - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { // && selector != null - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( var type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - /* falls through */ - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} -// Expose origPOS -// "global" as in regardless of relation to brackets/parens -Expr.match.globalPOS = origPOS; - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

    "; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByMethodName ) { - return makeArray( context.getElementsByMethodName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
    "; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByMethodName actually exists - if ( !div.getElementsByMethodName || div.getElementsByMethodName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByMethodName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByMethodName !== "undefined" && !isXML ) { - return context.getElementsByMethodName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.globalPOS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call( arguments ).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} - - - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /]", "i"), - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /\/(java|ecma)script/i, - rcleanScript = /^\s*", "" ], - legend: [ 1, "
    ", "
    " ], - thead: [ 1, "", "
    " ], - tr: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - col: [ 2, "", "
    " ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and + + + + + + + + + + +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • +
    • +
    +
    +
    +
    +
    +

    Index

    @@ -56,9 +75,11 @@

    Index

    | B | C | D + | E | F | G | I + | K | L | M | N @@ -68,874 +89,1135 @@

    Index

    | R | S | T + | U | V | W + | X

    A

    - - + +
    - -
    AC_KERBEROS (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    AC_PASSWORD (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    AC_SMARTCARD (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    AC_UNSPECIFIED (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    AC_X509 (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    add_sign() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    - -
    add_x509_key_descriptors() (saml2.metadata.OneLogin_Saml2_Metadata static method) -
    - - -
    ALOWED_CLOCK_DRIFT (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    ATTRNAME_FORMAT_BASIC (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    ATTRNAME_FORMAT_UNSPECIFIED (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    ATTRNAME_FORMAT_URI (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - -

    B

    - - + +
    - -
    BINDING_DEFLATE (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    BINDING_HTTP_ARTIFACT (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    BINDING_HTTP_POST (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    BINDING_HTTP_REDIRECT (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    BINDING_SOAP (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - -
    - -
    build() (saml2.logout_response.OneLogin_Saml2_Logout_Response method) -
    - - -
    build_request_signature() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    build_response_signature() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    builder() (saml2.metadata.OneLogin_Saml2_Metadata static method) -
    - -

    C

    - - + +
    - -
    calculate_x509_fingerprint() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    check_settings() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    check_sp_certs() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    check_status() (saml2.response.OneLogin_Saml2_Response method) -
    - -
    - -
    CM_BEARER (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    CM_HOLDER_KEY (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    CM_SENDER_VOUCHES (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - -

    D

    - - + + +
    - -
    decode_base64_and_inflate() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    decrypt_element() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    - -
    deflate_and_base64_encode() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    delete_local_session() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    + +

    E

    + + +

    F

    - - + +
    - -
    format_cert() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    format_finger_print() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    - -
    format_idp_cert() (saml2.settings.OneLogin_Saml2_Settings method) -
    - -

    G

    - - + +
    - -
    generate_name_id() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    generate_unique_id() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    get_attribute() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    get_attributes() (saml2.auth.OneLogin_Saml2_Auth method) -
    - -
    - -
    (saml2.response.OneLogin_Saml2_Response method) -
    - -
    - -
    get_audiences() (saml2.response.OneLogin_Saml2_Response method) -
    - - -
    get_base_path() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_cert_path() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_contacts() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_errors() (saml2.auth.OneLogin_Saml2_Auth method) -
    - -
    - -
    (saml2.settings.OneLogin_Saml2_Settings method) -
    - -
    - -
    get_expire_time() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    get_ext_lib_path() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_id() (saml2.logout_request.OneLogin_Saml2_Logout_Request static method) -
    - - -
    get_idp_data() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_issuer() (saml2.logout_request.OneLogin_Saml2_Logout_Request static method) -
    - -
    - -
    (saml2.logout_response.OneLogin_Saml2_Logout_Response method) -
    - -
    - -
    get_issuers() (saml2.response.OneLogin_Saml2_Response method) -
    - - -
    get_lib_path() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_name_id() (saml2.logout_request.OneLogin_Saml2_Logout_Request static method) -
    - - -
    get_name_id_data() (saml2.logout_request.OneLogin_Saml2_Logout_Request static method) -
    - - -
    get_nameid() (saml2.auth.OneLogin_Saml2_Auth method) -
    - -
    - -
    (saml2.response.OneLogin_Saml2_Response method) -
    - -
    - -
    get_nameid_data() (saml2.response.OneLogin_Saml2_Response method) -
    - -
    - -
    get_organization() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_request() (saml2.authn_request.OneLogin_Saml2_Authn_Request method) -
    - -
    - -
    (saml2.logout_request.OneLogin_Saml2_Logout_Request method) -
    - -
    - -
    get_response() (saml2.logout_response.OneLogin_Saml2_Logout_Response method) -
    - - -
    get_schemas_path() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_security_data() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_self_host() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    get_self_url() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    get_self_url_host() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    get_self_url_no_query() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    get_session_index() (saml2.response.OneLogin_Saml2_Response method) -
    - - -
    get_session_indexes() (saml2.logout_request.OneLogin_Saml2_Logout_Request static method) -
    - - -
    get_session_not_on_or_after() (saml2.response.OneLogin_Saml2_Response method) -
    - - -
    get_settings() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    get_slo_url() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    get_sp_cert() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_sp_data() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_sp_key() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_sp_metadata() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    get_sso_url() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    get_status() (saml2.logout_response.OneLogin_Saml2_Logout_Response method) -
    - -
    - -
    (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    -

    I

    - - + + +
    - -
    is_authenticated() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    is_debug_active() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    is_https() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    - -
    is_strict() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    is_valid() (saml2.logout_request.OneLogin_Saml2_Logout_Request static method) -
    - -
    - -
    (saml2.logout_response.OneLogin_Saml2_Logout_Response method) -
    - - -
    (saml2.response.OneLogin_Saml2_Response method) -
    - -
    -
    + +

    K

    + +

    L

    - - + +
    - -
    login() (saml2.auth.OneLogin_Saml2_Auth method) -
    - -
    - -
    logout() (saml2.auth.OneLogin_Saml2_Auth method) -
    - -

    M

    - + +
    - -
    METADATA_SP_INVALID (saml2.errors.OneLogin_Saml2_Error attribute) -
    +

    N

    - - + +
    - -
    NAMEID_EMAIL_ADDRESS (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_ENCRYPTED (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_ENTITY (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_KERBEROS (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_PERSISTENT (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_TRANSIENT (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NAMEID_X509_SUBJECT_NAME (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_DS (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - -
    - -
    NS_MD (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_SAML (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_SAMLP (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_SOAP (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_XENC (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_XS (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NS_XSI (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    NSMAP (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - -

    O

    - - + +
    - -
    OneLogin_Saml2_Auth (class in saml2.auth) -
    - - -
    OneLogin_Saml2_Authn_Request (class in saml2.authn_request) -
    - - -
    OneLogin_Saml2_Constants (class in saml2.constants) -
    - - -
    OneLogin_Saml2_Error -
    - - -
    OneLogin_Saml2_Logout_Request (class in saml2.logout_request) -
    - -
    - -
    OneLogin_Saml2_Logout_Response (class in saml2.logout_response) -
    - - -
    OneLogin_Saml2_Metadata (class in saml2.metadata) -
    - - -
    OneLogin_Saml2_Response (class in saml2.response) -
    - - -
    OneLogin_Saml2_Settings (class in saml2.settings) -
    - - -
    OneLogin_Saml2_Utils (class in saml2.utils) -
    - -
      +
    • + onelogin + +
    • +
    • + onelogin.saml2 + +
    • +
    • + onelogin.saml2.auth + +
    • +
    • + onelogin.saml2.authn_request + +
    • +
    • + onelogin.saml2.compat + +
    • +
    • + onelogin.saml2.constants + +
    • +
    • + onelogin.saml2.errors + +
    • +
    • + onelogin.saml2.idp_metadata_parser + +
    • +
    • + onelogin.saml2.logout_request + +
    • +
    • + onelogin.saml2.logout_response + +
    • +
    • + onelogin.saml2.metadata + +
    • +
    • + onelogin.saml2.response + +
    • +

    P

    - - + +
    - -
    parse_duration() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    parse_SAML_to_time() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    parse_time_to_SAML() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    PRIVATE_KEY_FILE_NOT_FOUND (saml2.errors.OneLogin_Saml2_Error attribute) -
    - -
    - -
    process_response() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    process_slo() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    PUBLIC_CERT_FILE_NOT_FOUND (saml2.errors.OneLogin_Saml2_Error attribute) -
    - -

    Q

    - +
    - -
    query() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -

    R

    - - + +
    - -
    redirect() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - - -
    REDIRECT_INVALID_URL (saml2.errors.OneLogin_Saml2_Error attribute) -
    - -
    - -
    redirect_to() (saml2.auth.OneLogin_Saml2_Auth method) -
    - - -
    RSA_SHA1 (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - -

    S

    - - + +
    - -
    saml2.auth (module) -
    - - -
    saml2.authn_request (module) -
    - - -
    saml2.constants (module) -
    - - -
    saml2.errors (module) -
    - - -
    saml2.logout_request (module) -
    - - -
    saml2.logout_response (module) -
    - - -
    saml2.metadata (module) -
    - - -
    saml2.response (module) -
    - - -
    saml2.settings (module) -
    - - -
    saml2.utils (module) -
    - - -
    SAML_LOGOUTMESSAGE_NOT_FOUND (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    SAML_LOGOUTREQUEST_INVALID (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    SAML_LOGOUTRESPONSE_INVALID (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    SAML_RESPONSE_NOT_FOUND (saml2.errors.OneLogin_Saml2_Error attribute) -
    - -
    - -
    SAML_SINGLE_LOGOUT_NOT_SUPPORTED (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    set_strict() (saml2.auth.OneLogin_Saml2_Auth method) -
    - -
    - -
    (saml2.settings.OneLogin_Saml2_Settings method) -
    - -
    - -
    SETTINGS_FILE_NOT_FOUND (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    SETTINGS_INVALID (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    SETTINGS_INVALID_SYNTAX (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    sign_metadata() (saml2.metadata.OneLogin_Saml2_Metadata static method) -
    - - -
    SP_CERTS_NOT_FOUND (saml2.errors.OneLogin_Saml2_Error attribute) -
    - - -
    STATUS_NO_PASSIVE (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    STATUS_PARTIAL_LOGOUT (saml2.constants.OneLogin_Saml2_Constants attribute) -
    - - -
    STATUS_PROXY_COUNT_EXCEEDED (saml2.constants.OneLogin_Saml2_Constants attribute) -
    +
    - -
    STATUS_VERSION_MISMATCH (saml2.constants.OneLogin_Saml2_Constants attribute) -
    +

    T

    + + + + +
  • TRIPLEDES_CBC (onelogin.saml2.constants.OneLogin_Saml2_Constants attribute) +
  • +
    -

    T

    +

    U

    - - + +
    - -
    TIME_CACHED (saml2.metadata.OneLogin_Saml2_Metadata attribute) -
    - -
    - -
    TIME_VALID (saml2.metadata.OneLogin_Saml2_Metadata attribute) -
    - -

    V

    - - + +
    - -
    validate_metadata() (saml2.settings.OneLogin_Saml2_Settings method) -
    - - -
    validate_num_assertions() (saml2.response.OneLogin_Saml2_Response method) -
    - - -
    validate_sign() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -
    - -
    validate_timestamps() (saml2.response.OneLogin_Saml2_Response method) -
    - - -
    validate_url() (in module saml2.settings) -
    - - -
    validate_xml() (saml2.utils.OneLogin_Saml2_Utils static method) -
    - -

    W

    - + +
    - -
    write_temp_file() (saml2.utils.OneLogin_Saml2_Utils static method) -
    +
    - +

    X

    + +
    +
    -
    -
    -
    -
    +
    +
    + +
    +

    © Copyright 2023, Sixto Martin.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. - - +
    -
    - - - - + + + + + \ No newline at end of file diff --git a/docs/saml2/index.html b/docs/saml2/index.html index d17bd654..3fddedcd 100644 --- a/docs/saml2/index.html +++ b/docs/saml2/index.html @@ -1,142 +1,139 @@ + + + + + + Welcome to SAML Python2/3 Toolkit’s documentation! — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + - + +
    + + +
    -
    +
    - - -
    -
    -

    Table Of Contents

    - +
    -

    Next topic

    -

    onelogin.saml2 Module

    -

    This Page

    - - - +
    + +
    +

    © Copyright 2023, Sixto Martin.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    -
    - - - - + + + + + \ No newline at end of file diff --git a/docs/saml2/modules.html b/docs/saml2/modules.html new file mode 100644 index 00000000..2ba0850a --- /dev/null +++ b/docs/saml2/modules.html @@ -0,0 +1,135 @@ + + + + + + + onelogin — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/saml2/objects.inv b/docs/saml2/objects.inv index f4df5df0..2081e4bf 100644 Binary files a/docs/saml2/objects.inv and b/docs/saml2/objects.inv differ diff --git a/docs/saml2/onelogin.html b/docs/saml2/onelogin.html new file mode 100644 index 00000000..dc1317fd --- /dev/null +++ b/docs/saml2/onelogin.html @@ -0,0 +1,585 @@ + + + + + + + onelogin package — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    onelogin package

    +
    +

    Subpackages

    +
    + +
    +
    +
    +

    Module contents

    +

    Add SAML support to your Python softwares using this library.

    +

    SAML Python toolkit let you build a SP (Service Provider) +over your Python application and connect it to any IdP (Identity Provider).

    +

    Supports:

    +
      +
    • SSO and SLO (SP-Initiated and IdP-Initiated).

    • +
    • Assertion and nameId encryption.

    • +
    • Assertion signature.

    • +
    • Message signature: AuthNRequest, LogoutRequest, LogoutResponses.

    • +
    • Enable an Assertion Consumer Service endpoint.

    • +
    • Enable a Single Logout Service endpoint.

    • +
    • Publish the SP metadata (which can be signed).

    • +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/onelogin.saml2.html b/docs/saml2/onelogin.saml2.html new file mode 100644 index 00000000..4fbbffe8 --- /dev/null +++ b/docs/saml2/onelogin.saml2.html @@ -0,0 +1,3780 @@ + + + + + + + onelogin.saml2 package — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    onelogin.saml2 package

    +
    +

    Submodules

    +
    +
    +

    onelogin.saml2.auth module

    +

    OneLogin_Saml2_Auth class

    +

    Main class of SAML Python Toolkit.

    +

    Initializes the SP SAML instance

    +
    +
    +class onelogin.saml2.auth.OneLogin_Saml2_Auth(request_data, old_settings=None, custom_base_path=None)[source]
    +

    Bases: object

    +

    This class implements the SP SAML instance.

    +

    Defines the methods that you can invoke in your application in +order to add SAML support (initiates SSO, initiates SLO, processes a +SAML Response, a Logout Request or a Logout Response).

    +
    +
    +add_request_signature(request_data, sign_algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256')[source]
    +

    Builds the Signature of the SAML Request.

    +
    +
    Parameters:
    +
      +
    • request_data (dict) – The Request parameters

    • +
    • sign_algorithm (string) – Signature algorithm method

    • +
    +
    +
    +
    + +
    +
    +add_response_signature(response_data, sign_algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256')[source]
    +

    Builds the Signature of the SAML Response. +:param response_data: The Response parameters +:type response_data: dict

    +
    +
    Parameters:
    +

    sign_algorithm (string) – Signature algorithm method

    +
    +
    +
    + +
    +
    +authn_request_class
    +

    alias of OneLogin_Saml2_Authn_Request

    +
    + +
    +
    +get_attribute(name)[source]
    +

    Returns the requested SAML attribute.

    +
    +
    Parameters:
    +

    name (string) – Name of the attribute

    +
    +
    Returns:
    +

    Attribute value(s) if exists or None

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_attributes()[source]
    +

    Returns the set of SAML attributes.

    +
    +
    Returns:
    +

    SAML attributes

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_errors()[source]
    +

    Returns a list with code errors if something went wrong

    +
    +
    Returns:
    +

    List of errors

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_friendlyname_attribute(friendlyname)[source]
    +

    Returns the requested SAML attribute searched by FriendlyName.

    +
    +
    Parameters:
    +

    friendlyname (string) – FriendlyName of the attribute

    +
    +
    Returns:
    +

    Attribute value(s) if exists or None

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_friendlyname_attributes()[source]
    +

    Returns the set of SAML attributes indexed by FiendlyName.

    +
    +
    Returns:
    +

    SAML attributes

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_last_assertion_id()[source]
    +
    +
    Returns:
    +

    The ID of the last assertion processed.

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_last_assertion_issue_instant()[source]
    +
    +
    Returns:
    +

    The IssueInstant of the last assertion processed.

    +
    +
    Return type:
    +

    unix/posix timestamp|None

    +
    +
    +
    + +
    +
    +get_last_assertion_not_on_or_after()[source]
    +

    The NotOnOrAfter value of the valid SubjectConfirmationData node +(if any) of the last assertion processed

    +
    + +
    +
    +get_last_authn_contexts()[source]
    +
    +
    Returns:
    +

    The list of authentication contexts sent in the last SAML Response.

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_last_error_reason()[source]
    +

    Returns the reason for the last error

    +
    +
    Returns:
    +

    Reason of the last error

    +
    +
    Return type:
    +

    None | string

    +
    +
    +
    + +
    +
    +get_last_message_id()[source]
    +
    +
    Returns:
    +

    The ID of the last Response SAML message processed.

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_last_request_id()[source]
    +
    +
    Returns:
    +

    The ID of the last Request SAML message generated.

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_last_request_xml()[source]
    +

    Retrieves the raw XML sent in the last SAML request +:returns: SAML request XML +:rtype: string|None

    +
    + +
    +
    +get_last_response_in_response_to()[source]
    +
    +
    Returns:
    +

    InResponseTo attribute of the last Response SAML processed or None if it is not present.

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_last_response_xml(pretty_print_if_possible=False)[source]
    +

    Retrieves the raw XML (decrypted) of the last SAML response, +or the last Logout Response generated or processed +:returns: SAML response XML +:rtype: string|None

    +
    + +
    +
    +get_nameid()[source]
    +

    Returns the nameID.

    +
    +
    Returns:
    +

    NameID

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_nameid_format()[source]
    +

    Returns the nameID Format.

    +
    +
    Returns:
    +

    NameID Format

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_nameid_nq()[source]
    +

    Returns the nameID NameQualifier of the Assertion.

    +
    +
    Returns:
    +

    NameID NameQualifier

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_nameid_spnq()[source]
    +

    Returns the nameID SP NameQualifier of the Assertion.

    +
    +
    Returns:
    +

    NameID SP NameQualifier

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_session_expiration()[source]
    +

    Returns the SessionNotOnOrAfter from the AuthnStatement. +:returns: The SessionNotOnOrAfter of the assertion +:rtype: unix/posix timestamp|None

    +
    + +
    +
    +get_session_index()[source]
    +

    Returns the SessionIndex from the AuthnStatement. +:returns: The SessionIndex of the assertion +:rtype: string

    +
    + +
    +
    +get_settings()[source]
    +

    Returns the settings info +:return: Setting info +:rtype: OneLogin_Saml2_Setting object

    +
    + +
    +
    +get_slo_response_url()[source]
    +

    Gets the SLO return URL for IdP-initiated logout.

    +
    +
    Returns:
    +

    an URL, the SLO return endpoint of the IdP

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_slo_url()[source]
    +

    Gets the SLO URL.

    +
    +
    Returns:
    +

    An URL, the SLO endpoint of the IdP

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_sso_url()[source]
    +

    Gets the SSO URL.

    +
    +
    Returns:
    +

    An URL, the SSO endpoint of the IdP

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +is_authenticated()[source]
    +

    Checks if the user is authenticated or not.

    +
    +
    Returns:
    +

    True if is authenticated, False if not

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +login(return_to=None, force_authn=False, is_passive=False, set_nameid_policy=True, name_id_value_req=None)[source]
    +

    Initiates the SSO process.

    +
    +
    Parameters:
    +
      +
    • return_to (string) – Optional argument. The target URL the user should be redirected to after login.

    • +
    • force_authn (bool) – Optional argument. When true the AuthNRequest will set the ForceAuthn=’true’.

    • +
    • is_passive (bool) – Optional argument. When true the AuthNRequest will set the Ispassive=’true’.

    • +
    • set_nameid_policy (bool) – Optional argument. When true the AuthNRequest will set a nameIdPolicy element.

    • +
    • name_id_value_req (string) – Optional argument. Indicates to the IdP the subject that should be authenticated

    • +
    +
    +
    Returns:
    +

    Redirection URL

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +logout(return_to=None, name_id=None, session_index=None, nq=None, name_id_format=None, spnq=None)[source]
    +

    Initiates the SLO process.

    +
    +
    Parameters:
    +
      +
    • return_to (string) – Optional argument. The target URL the user should be redirected to after logout.

    • +
    • name_id (string) – The NameID that will be set in the LogoutRequest.

    • +
    • session_index (string) – SessionIndex that identifies the session of the user.

    • +
    • nq – IDP Name Qualifier

    • +
    • name_id_format – The NameID Format that will be set in the LogoutRequest.

    • +
    • spnq – SP Name Qualifier

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    Redirection URL

    +
    +
    +
    + +
    +
    +logout_request_class
    +

    alias of OneLogin_Saml2_Logout_Request

    +
    + +
    +
    +logout_response_class
    +

    alias of OneLogin_Saml2_Logout_Response

    +
    + +
    +
    +process_response(request_id=None)[source]
    +

    Process the SAML Response sent by the IdP.

    +
    +
    Parameters:
    +

    request_id (string) – Is an optional argument. Is the ID of the AuthNRequest sent by this SP to the IdP.

    +
    +
    Raises:
    +

    OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND, when a POST with a SAMLResponse is not found

    +
    +
    +
    + +
    +
    +process_slo(keep_local_session=False, request_id=None, delete_session_cb=None)[source]
    +

    Process the SAML Logout Response / Logout Request sent by the IdP.

    +
    +
    Parameters:
    +
      +
    • keep_local_session (bool) – When false will destroy the local session, otherwise will destroy it

    • +
    • request_id (string) – The ID of the LogoutRequest sent by this SP to the IdP

    • +
    +
    +
    Returns:
    +

    Redirection url

    +
    +
    +
    + +
    +
    +redirect_to(url=None, parameters={})[source]
    +

    Redirects the user to the URL passed by parameter or to the URL that we defined in our SSO Request.

    +
    +
    Parameters:
    +
      +
    • url (string) – The target URL to redirect the user

    • +
    • parameters (dict) – Extra parameters to be passed as part of the URL

    • +
    +
    +
    Returns:
    +

    Redirection URL

    +
    +
    +
    + +
    +
    +response_class
    +

    alias of OneLogin_Saml2_Response

    +
    + +
    +
    +set_strict(value)[source]
    +

    Set the strict mode active/disable

    +
    +
    Parameters:
    +

    value (bool) –

    +
    +
    +
    + +
    +
    +store_valid_response(response)[source]
    +
    + +
    +
    +validate_request_signature(request_data)[source]
    +

    Validate Request Signature

    +
    +
    Parameters:
    +

    request_data (dict) – The Request data

    +
    +
    +
    + +
    +
    +validate_response_signature(request_data)[source]
    +

    Validate Response Signature

    +
    +
    Parameters:
    +

    request_data (dict) – The Request data

    +
    +
    +
    + +
    + +
    +
    +

    onelogin.saml2.authn_request module

    +

    OneLogin_Saml2_Authn_Request class

    +

    AuthNRequest class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request(settings, force_authn=False, is_passive=False, set_nameid_policy=True, name_id_value_req=None)[source]
    +

    Bases: object

    +

    This class handles an AuthNRequest. It builds an +AuthNRequest object.

    +
    +
    +get_id()[source]
    +

    Returns the AuthNRequest ID. +:return: AuthNRequest ID +:rtype: string

    +
    + +
    +
    +get_request(deflate=True)[source]
    +

    Returns unsigned AuthnRequest. +:param deflate: It makes the deflate process optional +:type: bool +:return: AuthnRequest maybe deflated and base64 encoded +:rtype: str object

    +
    + +
    +
    +get_xml()[source]
    +

    Returns the XML that will be sent as part of the request +:return: XML request body +:rtype: string

    +
    + +
    + +
    +
    +

    onelogin.saml2.compat module

    +

    py3 compatibility class

    +
    +
    +onelogin.saml2.compat.to_bytes(data)[source]
    +

    return bytes

    +
    + +
    +
    +onelogin.saml2.compat.to_string(data)[source]
    +

    convert to string

    +
    + +
    +
    +onelogin.saml2.compat.utf8(data)[source]
    +

    return utf8-encoded string

    +
    + +
    +
    +

    onelogin.saml2.constants module

    +

    OneLogin_Saml2_Constants class

    +

    Constants class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.constants.OneLogin_Saml2_Constants[source]
    +

    Bases: object

    +

    This class defines all the constants that will be used +in the SAML Python Toolkit.

    +
    +
    +AC_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos'
    +
    + +
    +
    +AC_PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'
    +
    + +
    +
    +AC_PASSWORD_PROTECTED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'
    +
    + +
    +
    +AC_SMARTCARD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard'
    +
    + +
    +
    +AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified'
    +
    + +
    +
    +AC_X509 = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509'
    +
    + +
    +
    +AES128_CBC = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc'
    +
    + +
    +
    +AES192_CBC = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc'
    +
    + +
    +
    +AES256_CBC = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'
    +
    + +
    +
    +ALLOWED_CLOCK_DRIFT = 300
    +
    + +
    +
    +ATTRNAME_FORMAT_BASIC = 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic'
    +
    + +
    +
    +ATTRNAME_FORMAT_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified'
    +
    + +
    +
    +ATTRNAME_FORMAT_URI = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'
    +
    + +
    +
    +BINDING_DEFLATE = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE'
    +
    + +
    +
    +BINDING_HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'
    +
    + +
    +
    +BINDING_HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
    +
    + +
    +
    +BINDING_HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
    +
    + +
    +
    +BINDING_SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP'
    +
    + +
    +
    +CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer'
    +
    + +
    +
    +CM_HOLDER_KEY = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key'
    +
    + +
    +
    +CM_SENDER_VOUCHES = 'urn:oasis:names:tc:SAML:2.0:cm:sender-vouches'
    +
    + +
    +
    +DEPRECATED_ALGORITHMS = ['http://www.w3.org/2000/09/xmldsig#dsa-sha1', 'http://www.w3.org/2000/09/xmldsig#rsa-sha1', 'http://www.w3.org/2000/09/xmldsig#sha1']
    +
    + +
    +
    +DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
    +
    + +
    +
    +NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
    +
    + +
    +
    +NAMEID_ENCRYPTED = 'urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted'
    +
    + +
    +
    +NAMEID_ENTITY = 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity'
    +
    + +
    +
    +NAMEID_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos'
    +
    + +
    +
    +NAMEID_PERSISTENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'
    +
    + +
    +
    +NAMEID_TRANSIENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
    +
    + +
    +
    +NAMEID_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'
    +
    + +
    +
    +NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName'
    +
    + +
    +
    +NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName'
    +
    + +
    +
    +NSMAP = {'ds': 'http://www.w3.org/2000/09/xmldsig#', 'md': 'urn:oasis:names:tc:SAML:2.0:metadata', 'saml': 'urn:oasis:names:tc:SAML:2.0:assertion', 'samlp': 'urn:oasis:names:tc:SAML:2.0:protocol', 'xenc': 'http://www.w3.org/2001/04/xmlenc#'}
    +
    + +
    +
    +NS_DS = 'http://www.w3.org/2000/09/xmldsig#'
    +
    + +
    +
    +NS_MD = 'urn:oasis:names:tc:SAML:2.0:metadata'
    +
    + +
    +
    +NS_PREFIX_DS = 'ds'
    +
    + +
    +
    +NS_PREFIX_MD = 'md'
    +
    + +
    +
    +NS_PREFIX_SAML = 'saml'
    +
    + +
    +
    +NS_PREFIX_SAMLP = 'samlp'
    +
    + +
    +
    +NS_PREFIX_XENC = 'xenc'
    +
    + +
    +
    +NS_PREFIX_XS = 'xs'
    +
    + +
    +
    +NS_PREFIX_XSD = 'xsd'
    +
    + +
    +
    +NS_PREFIX_XSI = 'xsi'
    +
    + +
    +
    +NS_SAML = 'urn:oasis:names:tc:SAML:2.0:assertion'
    +
    + +
    +
    +NS_SAMLP = 'urn:oasis:names:tc:SAML:2.0:protocol'
    +
    + +
    +
    +NS_SOAP = 'http://schemas.xmlsoap.org/soap/envelope/'
    +
    + +
    +
    +NS_XENC = 'http://www.w3.org/2001/04/xmlenc#'
    +
    + +
    +
    +NS_XS = 'http://www.w3.org/2001/XMLSchema'
    +
    + +
    +
    +NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance'
    +
    + +
    +
    +RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5'
    +
    + +
    +
    +RSA_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p'
    +
    + +
    +
    +RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
    +
    + +
    +
    +RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
    +
    + +
    +
    +RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
    +
    + +
    +
    +RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
    +
    + +
    +
    +SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1'
    +
    + +
    +
    +SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256'
    +
    + +
    +
    +SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384'
    +
    + +
    +
    +SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512'
    +
    + +
    +
    +STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive'
    +
    + +
    +
    +STATUS_PARTIAL_LOGOUT = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout'
    +
    + +
    +
    +STATUS_PROXY_COUNT_EXCEEDED = 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded'
    +
    + +
    +
    +STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester'
    +
    + +
    +
    +STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder'
    +
    + +
    +
    +STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success'
    +
    + +
    +
    +STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch'
    +
    + +
    +
    +TRIPLEDES_CBC = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc'
    +
    + +
    + +
    +
    +

    onelogin.saml2.errors module

    +

    OneLogin_Saml2_Error class

    +

    Error class of SAML Python Toolkit.

    +

    Defines common Error codes and has a custom initializator.

    +
    +
    +exception onelogin.saml2.errors.OneLogin_Saml2_Error(message, code=0, errors=None)[source]
    +

    Bases: Exception

    +

    This class implements a custom Exception handler. +Defines custom error codes.

    +
    +
    +CERT_NOT_FOUND = 4
    +
    + +
    +
    +METADATA_SP_INVALID = 3
    +
    + +
    +
    +PRIVATE_KEY_FILE_NOT_FOUND = 7
    +
    + +
    +
    +PRIVATE_KEY_NOT_FOUND = 13
    +
    + +
    +
    +PUBLIC_CERT_FILE_NOT_FOUND = 6
    +
    + +
    +
    +REDIRECT_INVALID_URL = 5
    +
    + +
    +
    +SAML_LOGOUTMESSAGE_NOT_FOUND = 9
    +
    + +
    +
    +SAML_LOGOUTREQUEST_INVALID = 10
    +
    + +
    +
    +SAML_LOGOUTRESPONSE_INVALID = 11
    +
    + +
    +
    +SAML_RESPONSE_NOT_FOUND = 8
    +
    + +
    +
    +SAML_SINGLE_LOGOUT_NOT_SUPPORTED = 12
    +
    + +
    +
    +SETTINGS_FILE_NOT_FOUND = 0
    +
    + +
    +
    +SETTINGS_INVALID = 2
    +
    + +
    +
    +SETTINGS_INVALID_SYNTAX = 1
    +
    + +
    +
    +SP_CERTS_NOT_FOUND = 4
    +
    + +
    +
    +UNSUPPORTED_SETTINGS_OBJECT = 14
    +
    + +
    + +
    +
    +exception onelogin.saml2.errors.OneLogin_Saml2_ValidationError(message, code=0, errors=None)[source]
    +

    Bases: Exception

    +

    This class implements another custom Exception handler, related +to exceptions that happens during validation process. +Defines custom error codes .

    +
    +
    +ASSERTION_EXPIRED = 20
    +
    + +
    +
    +ASSERTION_TOO_EARLY = 19
    +
    + +
    +
    +AUTHN_CONTEXT_MISMATCH = 45
    +
    + +
    +
    +CHILDREN_NODE_NOT_FOUND_IN_KEYINFO = 36
    +
    + +
    +
    +DEPRECATED_DIGEST_METHOD = 47
    +
    + +
    +
    +DEPRECATED_SIGNATURE_METHOD = 46
    +
    + +
    +
    +DUPLICATED_ATTRIBUTE_NAME_FOUND = 41
    +
    + +
    +
    +DUPLICATED_ID_IN_SIGNED_ELEMENTS = 8
    +
    + +
    +
    +DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS = 10
    +
    + +
    +
    +EMPTY_DESTINATION = 25
    +
    + +
    +
    +EMPTY_NAMEID = 39
    +
    + +
    +
    +ENCRYPTED_ATTRIBUTES = 23
    +
    + +
    +
    +ID_NOT_FOUND_IN_SIGNED_ELEMENT = 7
    +
    + +
    +
    +INVALID_SIGNATURE = 42
    +
    + +
    +
    +INVALID_SIGNED_ELEMENT = 9
    +
    + +
    +
    +INVALID_XML_FORMAT = 14
    +
    + +
    +
    +ISSUER_MULTIPLE_IN_RESPONSE = 27
    +
    + +
    +
    +ISSUER_NOT_FOUND_IN_ASSERTION = 28
    +
    + +
    +
    +KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA = 35
    +
    + +
    +
    +MISSING_CONDITIONS = 18
    +
    + +
    +
    +MISSING_ID = 1
    +
    + +
    +
    +MISSING_STATUS = 3
    +
    + +
    +
    +MISSING_STATUS_CODE = 4
    +
    + +
    +
    +NO_ATTRIBUTESTATEMENT = 22
    +
    + +
    +
    +NO_ENCRYPTED_ASSERTION = 16
    +
    + +
    +
    +NO_ENCRYPTED_NAMEID = 17
    +
    + +
    +
    +NO_NAMEID = 38
    +
    + +
    +
    +NO_SIGNATURE_FOUND = 34
    +
    + +
    +
    +NO_SIGNED_ASSERTION = 33
    +
    + +
    +
    +NO_SIGNED_MESSAGE = 32
    +
    + +
    +
    +RESPONSE_EXPIRED = 44
    +
    + +
    +
    +SESSION_EXPIRED = 30
    +
    + +
    +
    +SP_NAME_QUALIFIER_NAME_MISMATCH = 40
    +
    + +
    +
    +STATUS_CODE_IS_NOT_SUCCESS = 5
    +
    + +
    +
    +UNEXPECTED_SIGNED_ELEMENTS = 11
    +
    + +
    +
    +UNSUPPORTED_RETRIEVAL_METHOD = 37
    +
    + +
    +
    +UNSUPPORTED_SAML_VERSION = 0
    +
    + +
    +
    +WRONG_AUDIENCE = 26
    +
    + +
    +
    +WRONG_DESTINATION = 24
    +
    + +
    +
    +WRONG_INRESPONSETO = 15
    +
    + +
    +
    +WRONG_ISSUER = 29
    +
    + +
    +
    +WRONG_NUMBER_OF_ASSERTIONS = 2
    +
    + +
    +
    +WRONG_NUMBER_OF_AUTHSTATEMENTS = 21
    +
    + +
    +
    +WRONG_NUMBER_OF_SIGNATURES = 43
    +
    + +
    +
    +WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION = 13
    +
    + +
    +
    +WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE = 12
    +
    + +
    +
    +WRONG_SIGNED_ELEMENT = 6
    +
    + +
    +
    +WRONG_SUBJECTCONFIRMATION = 31
    +
    + +
    + +
    +
    +

    onelogin.saml2.idp_metadata_parser module

    +

    OneLogin_Saml2_IdPMetadataParser class +Metadata class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser[source]
    +

    Bases: object

    +

    A class that contain methods related to obtaining and parsing metadata from IdP

    +

    This class does not validate in any way the URL that is introduced, +make sure to validate it properly before use it in a get_metadata method.

    +
    +
    +classmethod get_metadata(url, validate_cert=True, timeout=None, headers=None)[source]
    +

    Gets the metadata XML from the provided URL +:param url: Url where the XML of the Identity Provider Metadata is published. +:type url: string

    +
    +
    Parameters:
    +
      +
    • validate_cert (bool) – If the url uses https schema, that flag enables or not the verification of the associated certificate.

    • +
    • timeout (int) – Timeout in seconds to wait for metadata response

    • +
    • headers (dict) – Extra headers to send in the request

    • +
    +
    +
    Returns:
    +

    metadata XML

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static merge_settings(settings, new_metadata_settings)[source]
    +

    Will update the settings with the provided new settings data extracted from the IdP metadata +:param settings: Current settings dict data +:type settings: dict +:param new_metadata_settings: Settings to be merged (extracted from IdP metadata after parsing) +:type new_metadata_settings: dict +:returns: merged settings +:rtype: dict

    +
    + +
    +
    +classmethod parse(idp_metadata, required_sso_binding='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', required_slo_binding='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', entity_id=None)[source]
    +

    Parses the Identity Provider metadata and return a dict with extracted data.

    +

    If there are multiple <IDPSSODescriptor> tags, parse only the first.

    +

    Parses only those SSO endpoints with the same binding as given by +the required_sso_binding parameter.

    +

    Parses only those SLO endpoints with the same binding as given by +the required_slo_binding parameter.

    +

    If the metadata specifies multiple SSO endpoints with the required +binding, extract only the first (the same holds true for SLO +endpoints).

    +
    +
    Parameters:
    +
      +
    • idp_metadata (string) – XML of the Identity Provider Metadata.

    • +
    • required_sso_binding (one of OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT +or OneLogin_Saml2_Constants.BINDING_HTTP_POST) – Parse only POST or REDIRECT SSO endpoints.

    • +
    • required_slo_binding (one of OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT +or OneLogin_Saml2_Constants.BINDING_HTTP_POST) – Parse only POST or REDIRECT SLO endpoints.

    • +
    • entity_id (string) – Specify the entity_id of the EntityDescriptor that you want to parse a XML +that contains multiple EntityDescriptor.

    • +
    +
    +
    Returns:
    +

    settings dict with extracted data

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +classmethod parse_remote(url, validate_cert=True, entity_id=None, timeout=None, **kwargs)[source]
    +

    Gets the metadata XML from the provided URL and parse it, returning a dict with extracted data +:param url: Url where the XML of the Identity Provider Metadata is published. +:type url: string

    +
    +
    Parameters:
    +
      +
    • validate_cert (bool) – If the url uses https schema, that flag enables or not the verification of the associated certificate.

    • +
    • entity_id (string) – Specify the entity_id of the EntityDescriptor that you want to parse a XML +that contains multiple EntityDescriptor.

    • +
    • timeout (int) – Timeout in seconds to wait for metadata response

    • +
    +
    +
    Returns:
    +

    settings dict with extracted data

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    + +
    +
    +onelogin.saml2.idp_metadata_parser.dict_deep_merge(a, b, path=None)[source]
    +

    Deep-merge dictionary b into dictionary a.

    +

    Kudos to http://stackoverflow.com/a/7205107/145400

    +
    + +
    +
    +

    onelogin.saml2.logout_request module

    +

    OneLogin_Saml2_Logout_Request class

    +

    Logout Request class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request(settings, request=None, name_id=None, session_index=None, nq=None, name_id_format=None, spnq=None)[source]
    +

    Bases: object

    +

    This class handles a Logout Request.

    +

    Builds a Logout Response object and validates it.

    +
    +
    +get_error()[source]
    +

    After executing a validation process, if it fails this method returns the cause

    +
    + +
    +
    +classmethod get_id(request)[source]
    +

    Returns the ID of the Logout Request +:param request: Logout Request Message +:type request: string|DOMDocument +:return: string ID +:rtype: str object

    +
    + +
    +
    +classmethod get_issuer(request)[source]
    +

    Gets the Issuer of the Logout Request Message +:param request: Logout Request Message +:type request: string|DOMDocument +:return: The Issuer +:rtype: string

    +
    + +
    +
    +classmethod get_nameid(request, key=None)[source]
    +

    Gets the NameID of the Logout Request Message +:param request: Logout Request Message +:type request: string|DOMDocument +:param key: The SP key +:type key: string +:return: Name ID Value +:rtype: string

    +
    + +
    +
    +classmethod get_nameid_data(request, key=None)[source]
    +

    Gets the NameID Data of the the Logout Request +:param request: Logout Request Message +:type request: string|DOMDocument +:param key: The SP key +:type key: string +:return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier) +:rtype: dict

    +
    + +
    +
    +classmethod get_nameid_format(request, key=None)[source]
    +

    Gets the NameID Format of the Logout Request Message +:param request: Logout Request Message +:type request: string|DOMDocument +:param key: The SP key +:type key: string +:return: Name ID Format +:rtype: string

    +
    + +
    +
    +get_request(deflate=True)[source]
    +

    Returns the Logout Request deflated, base64encoded +:param deflate: It makes the deflate process optional +:type: bool +:return: Logout Request maybe deflated and base64 encoded +:rtype: str object

    +
    + +
    +
    +classmethod get_session_indexes(request)[source]
    +

    Gets the SessionIndexes from the Logout Request +:param request: Logout Request Message +:type request: string|DOMDocument +:return: The SessionIndex value +:rtype: list

    +
    + +
    +
    +get_xml()[source]
    +

    Returns the XML that will be sent as part of the request +or that was received at the SP +:return: XML request body +:rtype: string

    +
    + +
    +
    +is_valid(request_data, raise_exceptions=False)[source]
    +

    Checks if the Logout Request received is valid +:param request_data: Request Data +:type request_data: dict

    +
    +
    Parameters:
    +

    raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    +
    +
    Returns:
    +

    If the Logout Request is or not valid

    +
    +
    Return type:
    +

    boolean

    +
    +
    +
    + +
    + +
    +
    +

    onelogin.saml2.logout_response module

    +

    OneLogin_Saml2_Logout_Response class

    +

    Logout Response class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response(settings, response=None)[source]
    +

    Bases: object

    +

    This class handles a Logout Response. It Builds or parses a Logout Response object +and validates it.

    +
    +
    +build(in_response_to, status='urn:oasis:names:tc:SAML:2.0:status:Success')[source]
    +

    Creates a Logout Response object. +:param in_response_to: InResponseTo value for the Logout Response. +:type in_response_to: string +:param: status: The status of the response +:type: status: string

    +
    + +
    +
    +get_error()[source]
    +

    After executing a validation process, if it fails this method returns the cause

    +
    + +
    +
    +get_in_response_to()[source]
    +

    Gets the ID of the LogoutRequest which this response is in response to +:returns: ID of LogoutRequest this LogoutResponse is in response to or None if it is not present +:rtype: str

    +
    + +
    +
    +get_issuer()[source]
    +

    Gets the Issuer of the Logout Response Message +:return: The Issuer +:rtype: string

    +
    + +
    +
    +get_response(deflate=True)[source]
    +

    Returns a Logout Response object. +:param deflate: It makes the deflate process optional +:type: bool +:return: Logout Response maybe deflated and base64 encoded +:rtype: string

    +
    + +
    +
    +get_status()[source]
    +

    Gets the Status +:return: The Status +:rtype: string

    +
    + +
    +
    +get_xml()[source]
    +

    Returns the XML that will be sent as part of the response +or that was received at the SP +:return: XML response body +:rtype: string

    +
    + +
    +
    +is_valid(request_data, request_id=None, raise_exceptions=False)[source]
    +

    Determines if the SAML LogoutResponse is valid +:param request_id: The ID of the LogoutRequest sent by this SP to the IdP +:type request_id: string

    +
    +
    Parameters:
    +

    raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    +
    +
    Returns:
    +

    Returns if the SAML LogoutResponse is or not valid

    +
    +
    Return type:
    +

    boolean

    +
    +
    +
    + +
    + +
    +
    +

    onelogin.saml2.metadata module

    +

    OneLoginSaml2Metadata class

    +

    Metadata class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.metadata.OneLogin_Saml2_Metadata[source]
    +

    Bases: object

    +

    A class that contains methods related to the metadata of the SP

    +
    +
    +TIME_CACHED = 604800
    +
    + +
    +
    +TIME_VALID = 172800
    +
    + +
    +
    +classmethod add_x509_key_descriptors(metadata, cert=None, add_encryption=True)[source]
    +

    Adds the x509 descriptors (sign/encryption) to the metadata +The same cert will be used for sign/encrypt

    +
    +
    Parameters:
    +
      +
    • metadata (string) – SAML Metadata XML

    • +
    • cert (string) – x509 cert

    • +
    • add_encryption (boolean) – Determines if the KeyDescriptor[use=”encryption”] should be added.

    • +
    +
    +
    Returns:
    +

    Metadata with KeyDescriptors

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +classmethod builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None)[source]
    +

    Builds the metadata of the SP

    +
    +
    Parameters:
    +
      +
    • sp (string) – The SP data

    • +
    • authnsign (string) – authnRequestsSigned attribute

    • +
    • wsign (string) – wantAssertionsSigned attribute

    • +
    • valid_until (string|DateTime|Timestamp) – Metadata’s expiry date

    • +
    • cache_duration (int|string) – Duration of the cache in seconds

    • +
    • contacts (dict) – Contacts info

    • +
    • organization (dict) – Organization info

    • +
    +
    +
    +
    + +
    +
    +static sign_metadata(metadata, key, cert, sign_algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', digest_algorithm='http://www.w3.org/2001/04/xmlenc#sha256')[source]
    +

    Signs the metadata with the key/cert provided

    +
    +
    Parameters:
    +
      +
    • metadata (string) – SAML Metadata XML

    • +
    • key (string) – x509 key

    • +
    • cert (string) – x509 cert

    • +
    • sign_algorithm (string) – Signature algorithm method

    • +
    • digest_algorithm (string) – Digest algorithm method

    • +
    +
    +
    Returns:
    +

    Signed Metadata

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    + +
    +
    +

    onelogin.saml2.response module

    +

    OneLogin_Saml2_Response class

    +

    SAML Response class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.response.OneLogin_Saml2_Response(settings, response)[source]
    +

    Bases: object

    +

    This class handles a SAML Response. It parses or validates +a Logout Response object.

    +
    +
    +check_one_authnstatement()[source]
    +

    Checks that the samlp:Response/saml:Assertion/saml:AuthnStatement element exists and is unique.

    +
    + +
    +
    +check_one_condition()[source]
    +

    Checks that the samlp:Response/saml:Assertion/saml:Conditions element exists and is unique.

    +
    + +
    +
    +check_status()[source]
    +

    Check if the status of the response is success or not

    +
    +
    Raises:
    +

    Exception. If the status is not success

    +
    +
    +
    + +
    +
    +get_assertion_id()[source]
    +
    +
    Returns:
    +

    the ID of the assertion in the response

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_assertion_issue_instant()[source]
    +
    +
    Returns:
    +

    the IssueInstant of the assertion in the response

    +
    +
    Return type:
    +

    unix/posix timestamp|None

    +
    +
    +
    + +
    +
    +get_assertion_not_on_or_after()[source]
    +

    Returns the NotOnOrAfter value of the valid SubjectConfirmationData node if any

    +
    + +
    +
    +get_attributes()[source]
    +

    Gets the Attributes from the AttributeStatement element. +EncryptedAttributes are not supported

    +
    + +
    +
    +get_audiences()[source]
    +

    Gets the audiences

    +
    +
    Returns:
    +

    The valid audiences for the SAML Response

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_authn_contexts()[source]
    +

    Gets the authentication contexts

    +
    +
    Returns:
    +

    The authentication classes for the SAML Response

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_error()[source]
    +

    After executing a validation process, if it fails this method returns the cause

    +
    + +
    +
    +get_friendlyname_attributes()[source]
    +

    Gets the Attributes from the AttributeStatement element indexed by FiendlyName. +EncryptedAttributes are not supported

    +
    + +
    +
    +get_id()[source]
    +
    +
    Returns:
    +

    the ID of the response

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_in_response_to()[source]
    +

    Gets the ID of the request which this response is in response to +:returns: ID of AuthNRequest this Response is in response to or None if it is not present +:rtype: str

    +
    + +
    +
    +get_issuers()[source]
    +

    Gets the issuers (from message and from assertion)

    +
    +
    Returns:
    +

    The issuers

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_nameid()[source]
    +

    Gets the NameID provided by the SAML Response from the IdP

    +
    +
    Returns:
    +

    NameID (value)

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_nameid_data()[source]
    +

    Gets the NameID Data provided by the SAML Response from the IdP

    +
    +
    Returns:
    +

    Name ID Data (Value, Format, NameQualifier, SPNameQualifier)

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_nameid_format()[source]
    +

    Gets the NameID Format provided by the SAML Response from the IdP

    +
    +
    Returns:
    +

    NameID Format

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_nameid_nq()[source]
    +

    Gets the NameID NameQualifier provided by the SAML Response from the IdP

    +
    +
    Returns:
    +

    NameID NameQualifier

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_nameid_spnq()[source]
    +

    Gets the NameID SP NameQualifier provided by the SAML response from the IdP.

    +
    +
    Returns:
    +

    NameID SP NameQualifier

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_session_index()[source]
    +

    Gets the SessionIndex from the AuthnStatement +Could be used to be stored in the local session in order +to be used in a future Logout Request that the SP could +send to the SP, to set what specific session must be deleted

    +
    +
    Returns:
    +

    The SessionIndex value

    +
    +
    Return type:
    +

    string|None

    +
    +
    +
    + +
    +
    +get_session_not_on_or_after()[source]
    +

    Gets the SessionNotOnOrAfter from the AuthnStatement +Could be used to set the local session expiration

    +
    +
    Returns:
    +

    The SessionNotOnOrAfter value

    +
    +
    Return type:
    +

    time|None

    +
    +
    +
    + +
    +
    +get_xml_document()[source]
    +

    Returns the SAML Response document (If contains an encrypted assertion, decrypts it)

    +
    +
    Returns:
    +

    Decrypted XML response document

    +
    +
    Return type:
    +

    DOMDocument

    +
    +
    +
    + +
    +
    +is_valid(request_data, request_id=None, raise_exceptions=False)[source]
    +

    Validates the response object.

    +
    +
    Parameters:
    +
      +
    • request_data (dict) – Request Data

    • +
    • request_id (string) – Optional argument. The ID of the AuthNRequest sent by this SP to the IdP

    • +
    • raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    • +
    +
    +
    Returns:
    +

    True if the SAML Response is valid, False if not

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +process_signed_elements()[source]
    +
    +
    Verifies the signature nodes:
      +
    • Checks that are Response or Assertion

    • +
    • Check that IDs and reference URI are unique and consistent.

    • +
    +
    +
    +
    +
    Returns:
    +

    The signed elements tag names

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +validate_num_assertions()[source]
    +

    Verifies that the document only contains a single Assertion (encrypted or not)

    +
    +
    Returns:
    +

    True if only 1 assertion encrypted or not

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    +
    +validate_signed_elements(signed_elements)[source]
    +

    Verifies that the document has the expected signed nodes.

    +
    +
    Parameters:
    +
      +
    • signed_elements (list) – The signed elements to be checked

    • +
    • raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    • +
    +
    +
    +
    + +
    +
    +validate_timestamps()[source]
    +

    Verifies that the document is valid according to Conditions Element

    +
    +
    Returns:
    +

    True if the condition is valid, False otherwise

    +
    +
    Return type:
    +

    bool

    +
    +
    +
    + +
    + +
    +
    +

    onelogin.saml2.settings module

    +

    OneLogin_Saml2_Settings class

    +

    Copyright (c) 2010-2021 OneLogin, Inc. +MIT License

    +

    Setting class of OneLogin’s Python Toolkit.

    +
    +
    +class onelogin.saml2.settings.OneLogin_Saml2_Settings(settings=None, custom_base_path=None, sp_validation_only=False)[source]
    +

    Bases: object

    +

    Handles the settings of the Python toolkits.

    +
    +
    +check_idp_settings(settings)[source]
    +

    Checks the IdP settings info. +:param settings: Dict with settings data +:type settings: dict +:returns: Errors found on the IdP settings data +:rtype: list

    +
    + +
    +
    +check_settings(settings)[source]
    +

    Checks the settings info.

    +
    +
    Parameters:
    +

    settings (dict) – Dict with settings data

    +
    +
    Returns:
    +

    Errors found on the settings data

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +check_sp_certs()[source]
    +

    Checks if the x509 certs of the SP exists and are valid. +:returns: If the x509 certs of the SP exists and are valid +:rtype: boolean

    +
    + +
    +
    +check_sp_settings(settings)[source]
    +

    Checks the SP settings info. +:param settings: Dict with settings data +:type settings: dict +:returns: Errors found on the SP settings data +:rtype: list

    +
    + +
    +
    +format_idp_cert()[source]
    +

    Formats the IdP cert.

    +
    + +
    +
    +format_idp_cert_multi()[source]
    +

    Formats the Multple IdP certs.

    +
    + +
    +
    +format_sp_cert()[source]
    +

    Formats the SP cert.

    +
    + +
    +
    +format_sp_cert_new()[source]
    +

    Formats the SP cert.

    +
    + +
    +
    +format_sp_key()[source]
    +

    Formats the private key.

    +
    + +
    +
    +get_base_path()[source]
    +

    Returns base path

    +
    +
    Returns:
    +

    The base toolkit folder path

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_cert_path()[source]
    +

    Returns cert path

    +
    +
    Returns:
    +

    The cert folder path

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_contacts()[source]
    +

    Gets contact data.

    +
    +
    Returns:
    +

    Contacts info

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_errors()[source]
    +

    Returns an array with the errors, the array is empty when the settings is ok.

    +
    +
    Returns:
    +

    Errors

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +get_idp_cert()[source]
    +

    Returns the x509 public cert of the IdP. +:returns: IdP public cert +:rtype: string

    +
    + +
    +
    +get_idp_data()[source]
    +

    Gets the IdP data.

    +
    +
    Returns:
    +

    IdP info

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_idp_slo_response_url()[source]
    +

    Gets the IdP SLO return URL for IdP-initiated logout.

    +
    +
    Returns:
    +

    an URL, the SLO return endpoint of the IdP

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_idp_slo_url()[source]
    +

    Gets the IdP SLO URL.

    +
    +
    Returns:
    +

    An URL, the SLO endpoint of the IdP

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_idp_sso_url()[source]
    +

    Gets the IdP SSO URL.

    +
    +
    Returns:
    +

    An URL, the SSO endpoint of the IdP

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_lib_path()[source]
    +

    Returns lib path

    +
    +
    Returns:
    +

    The library folder path

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_organization()[source]
    +

    Gets organization data.

    +
    +
    Returns:
    +

    Organization info

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_schemas_path()[source]
    +

    Returns schema path

    +
    +
    Returns:
    +

    The schema folder path

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +get_security_data()[source]
    +

    Gets security data.

    +
    +
    Returns:
    +

    Security info

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_sp_cert()[source]
    +

    Returns the x509 public cert of the SP. +:returns: SP public cert +:rtype: string or None

    +
    + +
    +
    +get_sp_cert_new()[source]
    +

    Returns the x509 public of the SP planned +to be used soon instead the other public cert +:returns: SP public cert new +:rtype: string or None

    +
    + +
    +
    +get_sp_data()[source]
    +

    Gets the SP data.

    +
    +
    Returns:
    +

    SP info

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +get_sp_key()[source]
    +

    Returns the x509 private key of the SP. +:returns: SP private key +:rtype: string or None

    +
    + +
    +
    +get_sp_metadata()[source]
    +

    Gets the SP metadata. The XML representation. +:returns: SP metadata (xml) +:rtype: string

    +
    + +
    +
    +is_debug_active()[source]
    +

    Returns if the debug is active.

    +
    +
    Returns:
    +

    Debug parameter

    +
    +
    Return type:
    +

    boolean

    +
    +
    +
    + +
    +
    +is_strict()[source]
    +

    Returns if the ‘strict’ mode is active.

    +
    +
    Returns:
    +

    Strict parameter

    +
    +
    Return type:
    +

    boolean

    +
    +
    +
    + +
    +
    +metadata_class
    +

    alias of OneLogin_Saml2_Metadata

    +
    + +
    +
    +set_cert_path(path)[source]
    +

    Set a new cert path

    +
    + +
    +
    +set_strict(value)[source]
    +

    Activates or deactivates the strict mode.

    +
    +
    Parameters:
    +

    value (boolean) – Strict parameter

    +
    +
    +
    + +
    +
    +validate_metadata(xml)[source]
    +

    Validates an XML SP Metadata.

    +
    +
    Parameters:
    +

    xml (string) – Metadata’s XML that will be validate

    +
    +
    Returns:
    +

    The list of found errors

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    + +
    +
    +onelogin.saml2.settings.validate_url(url, allow_single_label_domain=False)[source]
    +

    Auxiliary method to validate an urllib +:param url: An url to be validated +:type url: string +:param allow_single_label_domain: In order to allow or not single label domain +:type url: bool +:returns: True if the url is valid +:rtype: bool

    +
    + +
    +
    +

    onelogin.saml2.utils module

    +

    OneLogin_Saml2_Utils class

    +

    Auxiliary class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.utils.OneLogin_Saml2_Utils[source]
    +

    Bases: object

    +

    Auxiliary class that contains several utility methods to parse time, +urls, add sign, encrypt, decrypt, sign validation, handle xml …

    +
    +
    +ASSERTION_SIGNATURE_XPATH = '/samlp:Response/saml:Assertion/ds:Signature'
    +
    + +
    +
    +RESPONSE_SIGNATURE_XPATH = '/samlp:Response/ds:Signature'
    +
    + +
    +
    +TIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
    +
    + +
    +
    +TIME_FORMAT_2 = '%Y-%m-%dT%H:%M:%S.%fZ'
    +
    + +
    +
    +TIME_FORMAT_WITH_FRAGMENT = re.compile('^(\\d{4,4}-\\d{2,2}-\\d{2,2}T\\d{2,2}:\\d{2,2}:\\d{2,2})(\\.\\d*)?Z?$')
    +
    + +
    +
    +static add_sign(xml, key, cert, debug=False, sign_algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', digest_algorithm='http://www.w3.org/2001/04/xmlenc#sha256')[source]
    +

    Adds signature key and senders certificate to an element (Message or +Assertion).

    +
    +
    Parameters:
    +
      +
    • xml – The element we should sign

    • +
    • key – The private key

    • +
    • cert – The public

    • +
    • debug – Activate the xmlsec debug

    • +
    • sign_algorithm (string) – Signature algorithm method

    • +
    • digest_algorithm (string) – Digest algorithm method

    • +
    +
    +
    Type:
    +

    string | Document

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    Returns:
    +

    Signed XML

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static b64decode(data)[source]
    +

    base64 decode

    +
    + +
    +
    +static b64encode(data)[source]
    +

    base64 encode

    +
    + +
    +
    +static calculate_x509_fingerprint(x509_cert, alg='sha1')[source]
    +

    Calculates the fingerprint of a formatted x509cert.

    +
    +
    Parameters:
    +
      +
    • x509_cert – x509 cert formatted

    • +
    • alg – The algorithm to build the fingerprint

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    fingerprint

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static decode_base64_and_inflate(value, ignore_zip=False)[source]
    +

    base64 decodes and then inflates according to RFC1951 +:param value: a deflated and encoded string +:type value: string +:param ignore_zip: ignore zip errors +:returns: the string after decoding and inflating +:rtype: string

    +
    + +
    +
    +static decrypt_element(encrypted_data, key, debug=False, inplace=False)[source]
    +

    Decrypts an encrypted element.

    +
    +
    Parameters:
    +
      +
    • encrypted_data – The encrypted data.

    • +
    • key – The key.

    • +
    • debug – Activate the xmlsec debug

    • +
    • inplace – update passed data with decrypted result

    • +
    +
    +
    Type:
    +

    lxml.etree.Element | DOMElement | basestring

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    Type:
    +

    bool

    +
    +
    Returns:
    +

    The decrypted element.

    +
    +
    Return type:
    +

    lxml.etree.Element

    +
    +
    +
    + +
    +
    +static deflate_and_base64_encode(value)[source]
    +

    Deflates and then base64 encodes a string +:param value: The string to deflate and encode +:type value: string +:returns: The deflated and encoded string +:rtype: string

    +
    + +
    +
    +static delete_local_session(callback=None)[source]
    +

    Deletes the local session.

    +
    + +
    +
    +static escape_url(url, lowercase_urlencoding=False)[source]
    +

    escape the non-safe symbols in url +The encoding used by ADFS 3.0 is not compatible with +python’s quote_plus (ADFS produces lower case hex numbers and quote_plus produces +upper case hex numbers) +:param url: the url to escape +:type url: str

    +
    +
    Parameters:
    +

    lowercase_urlencoding (boolean) – lowercase or no

    +
    +
    Returns:
    +

    the escaped url

    +
    +
    +

    :rtype str

    +
    + +
    +
    +static format_cert(cert, heads=True)[source]
    +

    Returns a x509 cert (adding header & footer if required).

    +
    +
    Parameters:
    +
      +
    • cert – A x509 unformatted cert

    • +
    • heads – True if we want to include head and footer

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    boolean

    +
    +
    Returns:
    +

    Formatted cert

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static format_finger_print(fingerprint)[source]
    +

    Formats a fingerprint.

    +
    +
    Parameters:
    +

    fingerprint – fingerprint

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    Formatted fingerprint

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static format_private_key(key, heads=True)[source]
    +

    Returns a private key (adding header & footer if required).

    +

    :param key A private key +:type: string

    +
    +
    Parameters:
    +

    heads – True if we want to include head and footer

    +
    +
    Type:
    +

    boolean

    +
    +
    Returns:
    +

    Formated private key

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static generate_name_id(value, sp_nq, sp_format=None, cert=None, debug=False, nq=None)[source]
    +

    Generates a nameID.

    +
    +
    Parameters:
    +
      +
    • value – fingerprint

    • +
    • sp_nq – SP Name Qualifier

    • +
    • sp_format – SP Format

    • +
    • cert – IdP Public Cert to encrypt the nameID

    • +
    • debug – Activate the xmlsec debug

    • +
    • nq – IDP Name Qualifier

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    Returns:
    +

    DOMElement | XMLSec nameID

    +
    +
    Return type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    +
    + +
    +
    +static generate_unique_id()[source]
    +

    Generates an unique string (used for example as ID for assertions).

    +
    +
    Returns:
    +

    A unique string

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static get_expire_time(cache_duration=None, valid_until=None)[source]
    +

    Compares 2 dates and returns the earliest.

    +
    +
    Parameters:
    +
      +
    • cache_duration – The duration, as a string.

    • +
    • valid_until – The valid until date, as a string or as a timestamp

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    The expiration time.

    +
    +
    Return type:
    +

    int

    +
    +
    +
    + +
    +
    +static get_self_host(request_data)[source]
    +

    Returns the current host (which may include a port number part).

    +
    +
    Parameters:
    +

    request_data – The request as a dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    The current host

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static get_self_routed_url_no_query(request_data)[source]
    +

    Returns the routed URL of the current host + current view.

    +
    +
    Parameters:
    +

    request_data – The request as a dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    The url of current host + current view

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static get_self_url(request_data)[source]
    +

    Returns the URL of the current host + current view + query.

    +
    +
    Parameters:
    +

    request_data – The request as a dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    The url of current host + current view + query

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static get_self_url_host(request_data)[source]
    +

    Returns the protocol + the current host + the port (if different than +common ports).

    +
    +
    Parameters:
    +

    request_data – The request as a dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    Url

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static get_self_url_no_query(request_data)[source]
    +

    Returns the URL of the current host + current view.

    +
    +
    Parameters:
    +

    request_data – The request as a dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    The url of current host + current view

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static get_status(dom)[source]
    +

    Gets Status from a Response.

    +
    +
    Parameters:
    +

    dom – The Response as XML

    +
    +
    Type:
    +

    Document

    +
    +
    Returns:
    +

    The Status, an array with the code and a message.

    +
    +
    Return type:
    +

    dict

    +
    +
    +
    + +
    +
    +static is_https(request_data)[source]
    +

    Checks if https or http.

    +
    +
    Parameters:
    +

    request_data – The request as a dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    False if https is not active

    +
    +
    Return type:
    +

    boolean

    +
    +
    +
    + +
    +
    +static normalize_url(url)[source]
    +

    Returns normalized URL for comparison. +This method converts the netloc to lowercase, as it should be case-insensitive (per RFC 4343, RFC 7617) +If standardization fails, the original URL is returned +Python documentation indicates that URL split also normalizes query strings if empty query fields are present

    +
    +
    Parameters:
    +

    url (String) – URL

    +
    +
    Returns:
    +

    A normalized URL, or the given URL string if parsing fails

    +
    +
    Return type:
    +

    String

    +
    +
    +
    + +
    +
    +static now()[source]
    +
    +
    Returns:
    +

    unix timestamp of actual time.

    +
    +
    Return type:
    +

    int

    +
    +
    +
    + +
    +
    +static parse_SAML_to_time(timestr)[source]
    +

    Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z +to a UNIX timestamp. The sub-second part is ignored.

    +
    +
    Parameters:
    +

    timestr – The time we should convert (SAML Timestamp).

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    Converted to a unix timestamp.

    +
    +
    Return type:
    +

    int

    +
    +
    +
    + +
    +
    +static parse_duration(duration, timestamp=None)[source]
    +

    Interprets a ISO8601 duration value relative to a given timestamp.

    +
    +
    Parameters:
    +
      +
    • duration – The duration, as a string.

    • +
    • timestamp – The unix timestamp we should apply the duration to. +Optional, default to the current time.

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    The new timestamp, after the duration is applied.

    +
    +
    Return type:
    +

    int

    +
    +
    +
    + +
    +
    +static parse_time_to_SAML(time)[source]
    +

    Converts a UNIX timestamp to SAML2 timestamp on the form +yyyy-mm-ddThh:mm:ss(.s+)?Z.

    +
    +
    Parameters:
    +

    time – The time we should convert (DateTime).

    +
    +
    Type:
    +

    string

    +
    +
    Returns:
    +

    SAML2 timestamp.

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static redirect(url, parameters={}, request_data={})[source]
    +

    Executes a redirection to the provided url (or return the target url).

    +
    +
    Parameters:
    +
      +
    • url – The target url

    • +
    • parameters – Extra parameters to be passed as part of the url

    • +
    • request_data – The request as a dict

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    dict

    +
    +
    Type:
    +

    dict

    +
    +
    Returns:
    +

    Url

    +
    +
    Return type:
    +

    string

    +
    +
    +
    + +
    +
    +static sign_binary(msg, key, algorithm=__Transform('rsa-sha256', 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', 8), debug=False)[source]
    +

    Sign binary message

    +
    +
    Parameters:
    +
      +
    • msg – The element we should validate

    • +
    • key – The private key

    • +
    • debug – Activate the xmlsec debug

    • +
    +
    +
    Type:
    +

    bytes

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    +

    :return signed message +:rtype str

    +
    + +
    +
    +static validate_binary_sign(signed_query, signature, cert=None, algorithm='http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', debug=False)[source]
    +

    Validates signed binary data (Used to validate GET Signature).

    +
    +
    Parameters:
    +
      +
    • signed_query – The element we should validate

    • +
    • signature – The signature that will be validate

    • +
    • cert – The public cert

    • +
    • algorithm – Signature algorithm

    • +
    • debug – Activate the xmlsec debug

    • +
    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    +
    + +
    +
    +static validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False)[source]
    +

    Validates a signature of a EntityDescriptor.

    +
    +
    Parameters:
    +
      +
    • xml – The element we should validate

    • +
    • cert – The public cert

    • +
    • fingerprint – The fingerprint of the public cert

    • +
    • fingerprintalg – The algorithm used to build the fingerprint

    • +
    • validatecert – If true, will verify the signature and if the cert is valid.

    • +
    • debug – Activate the xmlsec debug

    • +
    • raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    • +
    +
    +
    Type:
    +

    string | Document

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    Type:
    +

    bool

    +
    +
    +
    + +
    +
    +static validate_node_sign(signature_node, elem, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False)[source]
    +

    Validates a signature node.

    +
    +
    Parameters:
    +
      +
    • signature_node – The signature node

    • +
    • xml – The element we should validate

    • +
    • cert – The public cert

    • +
    • fingerprint – The fingerprint of the public cert

    • +
    • fingerprintalg – The algorithm used to build the fingerprint

    • +
    • validatecert – If true, will verify the signature and if the cert is valid.

    • +
    • debug – Activate the xmlsec debug

    • +
    • raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    • +
    +
    +
    Type:
    +

    Node

    +
    +
    Type:
    +

    Document

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    Type:
    +

    bool

    +
    +
    +
    + +
    +
    +static validate_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False, xpath=None, multicerts=None)[source]
    +

    Validates a signature (Message or Assertion).

    +
    +
    Parameters:
    +
      +
    • xml – The element we should validate

    • +
    • cert – The public cert

    • +
    • fingerprint – The fingerprint of the public cert

    • +
    • fingerprintalg – The algorithm used to build the fingerprint

    • +
    • validatecert – If true, will verify the signature and if the cert is valid.

    • +
    • debug – Activate the xmlsec debug

    • +
    • xpath – The xpath of the signed element

    • +
    • multicerts – Multiple public certs

    • +
    • raise_exceptions (Boolean) – Whether to return false on failure or raise an exception

    • +
    +
    +
    Type:
    +

    string | Document

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    bool

    +
    +
    Type:
    +

    bool

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    list

    +
    +
    +
    + +
    + +
    +
    +onelogin.saml2.utils.return_false_on_exception(func)[source]
    +

    Decorator. When applied to a function, it will, by default, suppress any exceptions +raised by that function and return False. It may be overridden by passing a +“raise_exceptions” keyword argument when calling the wrapped function.

    +
    + +
    +
    +

    onelogin.saml2.xml_templates module

    +

    OneLogin_Saml2_Auth class

    +

    Main class of SAML Python Toolkit.

    +

    Initializes the SP SAML instance

    +
    +
    +class onelogin.saml2.xml_templates.OneLogin_Saml2_Templates[source]
    +

    Bases: object

    +
    +
    +ATTRIBUTE = '\n        <saml:Attribute Name="%s" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">\n            <saml:AttributeValue xsi:type="xs:string">%s</saml:AttributeValue>\n        </saml:Attribute>'
    +
    + +
    +
    +AUTHN_REQUEST = '<samlp:AuthnRequest\n  xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n  xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"\n  ID="%(id)s"\n  Version="2.0"%(provider_name)s%(force_authn_str)s%(is_passive_str)s\n  IssueInstant="%(issue_instant)s"\n  Destination="%(destination)s"\n  ProtocolBinding="%(acs_binding)s"\n  AssertionConsumerServiceURL="%(assertion_url)s"%(attr_consuming_service_str)s>\n    <saml:Issuer>%(entity_id)s</saml:Issuer>%(subject_str)s%(nameid_policy_str)s\n%(requested_authn_context_str)s\n</samlp:AuthnRequest>'
    +
    + +
    +
    +LOGOUT_REQUEST = '<samlp:LogoutRequest\n  xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n  xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"\n  ID="%(id)s"\n  Version="2.0"\n  IssueInstant="%(issue_instant)s"\n  Destination="%(single_logout_url)s">\n    <saml:Issuer>%(entity_id)s</saml:Issuer>\n    %(name_id)s\n    %(session_index)s\n</samlp:LogoutRequest>'
    +
    + +
    +
    +LOGOUT_RESPONSE = '<samlp:LogoutResponse\n  xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n  xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"\n  ID="%(id)s"\n  Version="2.0"\n  IssueInstant="%(issue_instant)s"\n  Destination="%(destination)s"\n  InResponseTo="%(in_response_to)s">\n    <saml:Issuer>%(entity_id)s</saml:Issuer>\n    <samlp:Status>\n        <samlp:StatusCode Value="%(status)s" />\n    </samlp:Status>\n</samlp:LogoutResponse>'
    +
    + +
    +
    +MD_ATTR_CONSUMER_SERVICE = '        <md:AttributeConsumingService index="1">\n            <md:ServiceName xml:lang="en">%(service_name)s</md:ServiceName>\n%(attr_cs_desc)s%(requested_attribute_str)s\n        </md:AttributeConsumingService>\n'
    +
    + +
    +
    +MD_CONTACT_PERSON = '    <md:ContactPerson contactType="%(type)s">\n        <md:GivenName>%(name)s</md:GivenName>\n        <md:EmailAddress>%(email)s</md:EmailAddress>\n    </md:ContactPerson>'
    +
    + +
    +
    +MD_ENTITY_DESCRIPTOR = '<?xml version="1.0"?>\n<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"\n                     %(valid)s\n                     %(cache)s\n                     entityID="%(entity_id)s">\n    <md:SPSSODescriptor AuthnRequestsSigned="%(authnsign)s" WantAssertionsSigned="%(wsign)s" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">\n%(sls)s        <md:NameIDFormat>%(name_id_format)s</md:NameIDFormat>\n        <md:AssertionConsumerService Binding="%(binding)s"\n                                     Location="%(location)s"\n                                     index="1" />\n%(attribute_consuming_service)s    </md:SPSSODescriptor>\n%(organization)s\n%(contacts)s\n</md:EntityDescriptor>'
    +
    + +
    +
    +MD_ORGANISATION = '    <md:Organization>\n        <md:OrganizationName xml:lang="%(lang)s">%(name)s</md:OrganizationName>\n        <md:OrganizationDisplayName xml:lang="%(lang)s">%(display_name)s</md:OrganizationDisplayName>\n        <md:OrganizationURL xml:lang="%(lang)s">%(url)s</md:OrganizationURL>\n    </md:Organization>'
    +
    + +
    +
    +MD_REQUESTED_ATTRIBUTE = '            <md:RequestedAttribute Name="%(req_attr_name)s"%(req_attr_nameformat_str)s%(req_attr_isrequired_str)s%(req_attr_aux_str)s'
    +
    + +
    +
    +MD_SLS = '        <md:SingleLogoutService Binding="%(binding)s"\n                                Location="%(location)s" />\n'
    +
    + +
    +
    +RESPONSE = '<samlp:Response\n  xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n  xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"\n  ID="%(id)s"\n  InResponseTo="%(in_response_to)s"\n  Version="2.0"\n  IssueInstant="%(issue_instant)s"\n  Destination="%(destination)s">\n    <saml:Issuer>%(entity_id)s</saml:Issuer>\n    <samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">\n        <samlp:StatusCode\n          xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n          Value="%(status)s">\n        </samlp:StatusCode>\n    </samlp:Status>\n    <saml:Assertion\n        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n        xmlns:xs="http://www.w3.org/2001/XMLSchema"\n        Version="2.0"\n        ID="%(assertion_id)s"\n        IssueInstant="%(issue_instant)s">\n        <saml:Issuer>%(entity_id)s</saml:Issuer>\n        <saml:Subject>\n            <saml:NameID\n              NameQualifier="%(entity_id)s"\n              SPNameQualifier="%(requester)s"\n              Format="%(name_id_policy)s">%(name_id)s</saml:NameID>\n            <saml:SubjectConfirmation Method="%(cm)s">\n                <saml:SubjectConfirmationData\n                  NotOnOrAfter="%(not_after)s"\n                  InResponseTo="%(in_response_to)s"\n                  Recipient="%(destination)s">\n                </saml:SubjectConfirmationData>\n            </saml:SubjectConfirmation>\n        </saml:Subject>\n        <saml:Conditions NotBefore="%(not_before)s" NotOnOrAfter="%(not_after)s">\n            <saml:AudienceRestriction>\n                <saml:Audience>%(requester)s</saml:Audience>\n            </saml:AudienceRestriction>\n        </saml:Conditions>\n        <saml:AuthnStatement\n          AuthnInstant="%(issue_instant)s"\n          SessionIndex="%(session_index)s"\n          SessionNotOnOrAfter="%(not_after)s">\n%(authn_context)s\n        </saml:AuthnStatement>\n        <saml:AttributeStatement>\n%(attributes)s\n        </saml:AttributeStatement>\n    </saml:Assertion>\n</samlp:Response>'
    +
    + +
    + +
    +
    +

    onelogin.saml2.xml_utils module

    +

    OneLogin_Saml2_XML class

    +

    Auxiliary class of SAML Python Toolkit.

    +
    +
    +class onelogin.saml2.xml_utils.OneLogin_Saml2_XML[source]
    +

    Bases: object

    +
    +
    +static cleanup_namespaces(tree_or_element, top_nsmap=None, keep_ns_prefixes=None)[source]
    +

    Keeps the xmlns:xs namespace intact when etree.cleanup_namespaces is invoked. +:param tree_or_element: An XML tree or element +:type tree_or_element: etree.Element +:param top_nsmap: A mapping from namespace prefixes to namespace URIs +:type top_nsmap: dict +:param keep_ns_prefixes: List of prefixes that should not be removed as part of the cleanup +:type keep_ns_prefixes: list +:returns: An XML tree or element +:rtype: etree.Element

    +
    + +
    +
    +static dump(elem, pretty_print=True, with_tail=True)
    +

    Writes an element tree or element structure to sys.stdout. This function +should be used for debugging only.

    +
    + +
    +
    +static element_text(node)[source]
    +
    + +
    +
    +static extract_tag_text(xml, tagname)[source]
    +
    + +
    +
    +static make_child(_parent, _tag, attrib=None, nsmap=None, **_extra)
    +

    SubElement(_parent, _tag, attrib=None, nsmap=None, **_extra)

    +

    Subelement factory. This function creates an element instance, and +appends it to an existing element.

    +
    + +
    +
    +static make_root(_tag, attrib=None, nsmap=None, **_extra)
    +

    Element(_tag, attrib=None, nsmap=None, **_extra)

    +

    Element factory. This function returns an object implementing the +Element interface.

    +

    Also look at the _Element.makeelement() and +_BaseParser.makeelement() methods, which provide a faster way to +create an Element within a specific document or parser context.

    +
    + +
    +
    +static query(dom, query, context=None, tagid=None)[source]
    +

    Extracts nodes that match the query from the Element

    +
    +
    Parameters:
    +
      +
    • dom – The root of the lxml objet

    • +
    • query (String) – Xpath Expresion

    • +
    • context – Context Node

    • +
    • tagid – Tag ID

    • +
    +
    +
    Type:
    +

    Element

    +
    +
    Type:
    +

    string

    +
    +
    Type:
    +

    DOMElement

    +
    +
    Returns:
    +

    The queried nodes

    +
    +
    Return type:
    +

    list

    +
    +
    +
    + +
    +
    +static to_etree(xml)[source]
    +

    Parses an XML document or fragment from a string. +:param xml: the string to parse +:type xml: str|bytes|xml.dom.minidom.Document|etree.Element +:returns: the root node +:rtype: OneLogin_Saml2_XML._element_class

    +
    + +
    +
    +static to_string(xml, **kwargs)[source]
    +

    Serialize an element to an encoded string representation of its XML tree. +:param xml: The root node +:type xml: str|bytes|xml.dom.minidom.Document|etree.Element +:returns: string representation of xml +:rtype: string

    +
    + +
    +
    +static validate_xml(xml, schema, debug=False)[source]
    +

    Validates a xml against a schema +:param xml: The xml that will be validated +:type xml: str|bytes|xml.dom.minidom.Document|etree.Element +:param schema: The schema +:type schema: string +:param debug: If debug is active, the parse-errors will be showed +:type debug: bool +:returns: Error code or the DomDocument of the xml +:rtype: xml.dom.minidom.Document

    +
    + +
    + +
    +
    +

    onelogin.saml2.xmlparser module

    +

    lxml.etree protection

    +
    +
    +exception onelogin.saml2.xmlparser.DTDForbidden(name, sysid, pubid)[source]
    +

    Bases: ValueError

    +

    Document type definition is forbidden

    +
    + +
    +
    +exception onelogin.saml2.xmlparser.EntitiesForbidden(name, value, base, sysid, pubid, notation_name)[source]
    +

    Bases: ValueError

    +

    Entity definition is forbidden

    +
    + +
    +
    +class onelogin.saml2.xmlparser.GlobalParserTLS[source]
    +

    Bases: _local

    +

    Thread local context for custom parser instances

    +
    +
    +createDefaultParser()[source]
    +
    + +
    +
    +element_class
    +

    alias of RestrictedElement

    +
    + +
    +
    +getDefaultParser()[source]
    +
    + +
    +
    +parser_config = {'huge_tree': False, 'no_network': True, 'remove_comments': True, 'remove_pis': True, 'resolve_entities': False}
    +
    + +
    +
    +setDefaultParser(parser)[source]
    +
    + +
    + +
    +
    +exception onelogin.saml2.xmlparser.NotSupportedError[source]
    +

    Bases: ValueError

    +

    The operation is not supported

    +
    + +
    +
    +class onelogin.saml2.xmlparser.RestrictedElement[source]
    +

    Bases: ElementBase

    +

    A restricted Element class that filters out instances of some classes

    +
    +
    +blacklist = (<class 'lxml.etree._Entity'>, <class 'lxml.etree._ProcessingInstruction'>, <class 'lxml.etree._Comment'>)
    +
    + +
    +
    +getchildren(self)[source]
    +

    Returns all direct children. The elements are returned in document +order.

    +
    +
    Deprecated:
    +

    Note that this method has been deprecated as of +ElementTree 1.3 and lxml 2.0. New code should use +list(element) or simply iterate over elements.

    +
    +
    +
    + +
    +
    +getiterator(self, tag=None, *tags)[source]
    +

    Returns a sequence or iterator of all elements in the subtree in +document order (depth first pre-order), starting with this +element.

    +

    Can be restricted to find only elements with specific tags, +see iter.

    +
    +
    Deprecated:
    +

    Note that this method is deprecated as of +ElementTree 1.3 and lxml 2.0. It returns an iterator in +lxml, which diverges from the original ElementTree +behaviour. If you want an efficient iterator, use the +element.iter() method instead. You should only use this +method in new code if you require backwards compatibility +with older versions of lxml or ElementTree.

    +
    +
    +
    + +
    +
    +iter(self, tag=None, *tags)[source]
    +

    Iterate over all elements in the subtree in document order (depth +first pre-order), starting with this element.

    +

    Can be restricted to find only elements with specific tags: +pass "{ns}localname" as tag. Either or both of ns and +localname can be * for a wildcard; ns can be empty +for no namespace. "localname" is equivalent to "{}localname" +(i.e. no namespace) but "*" is "{*}*" (any or no namespace), +not "{}*".

    +

    You can also pass the Element, Comment, ProcessingInstruction and +Entity factory functions to look only for the specific element type.

    +

    Passing multiple tags (or a sequence of tags) instead of a single tag +will let the iterator return all elements matching any of these tags, +in document order.

    +
    + +
    +
    +iterchildren(self, tag=None, *tags, reversed=False)[source]
    +

    Iterate over the children of this element.

    +

    As opposed to using normal iteration on this element, the returned +elements can be reversed with the ‘reversed’ keyword and restricted +to find only elements with specific tags, see iter.

    +
    + +
    +
    +iterdescendants(self, tag=None, *tags)[source]
    +

    Iterate over the descendants of this element in document order.

    +

    As opposed to el.iter(), this iterator does not yield the element +itself. The returned elements can be restricted to find only elements +with specific tags, see iter.

    +
    + +
    +
    +itersiblings(self, tag=None, *tags, preceding=False)[source]
    +

    Iterate over the following or preceding siblings of this element.

    +

    The direction is determined by the ‘preceding’ keyword which +defaults to False, i.e. forward iteration over the following +siblings. When True, the iterator yields the preceding +siblings in reverse document order, i.e. starting right before +the current element and going backwards.

    +

    Can be restricted to find only elements with specific tags, +see iter.

    +
    + +
    + +
    +
    +onelogin.saml2.xmlparser.XML(text, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True)
    +
    + +
    +
    +onelogin.saml2.xmlparser.check_docinfo(elementtree, forbid_dtd=False, forbid_entities=True)[source]
    +

    Check docinfo of an element tree for DTD and entity declarations +The check for entity declarations needs lxml 3 or newer. lxml 2.x does +not support dtd.iterentities().

    +
    + +
    +
    +onelogin.saml2.xmlparser.fromstring(text, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True)[source]
    +
    + +
    +
    +onelogin.saml2.xmlparser.getDefaultParser()
    +
    + +
    +
    +onelogin.saml2.xmlparser.iterparse(*args, **kwargs)[source]
    +
    + +
    +
    +onelogin.saml2.xmlparser.parse(source, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True)[source]
    +
    + +
    +
    +

    Module contents

    +

    Add SAML support to your Python softwares using this library.

    +

    SAML Python toolkit let you build a SP (Service Provider) +over your Python application and connect it to any IdP (Identity Provider).

    +

    Supports:

    +
      +
    • SSO and SLO (SP-Initiated and IdP-Initiated).

    • +
    • Assertion and nameId encryption.

    • +
    • Assertion signature.

    • +
    • Message signature: AuthNRequest, LogoutRequest, LogoutResponses.

    • +
    • Enable an Assertion Consumer Service endpoint.

    • +
    • Enable a Single Logout Service endpoint.

    • +
    • Publish the SP metadata (which can be signed).

    • +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/saml2/py-modindex.html b/docs/saml2/py-modindex.html index e7321859..fad1efc2 100644 --- a/docs/saml2/py-modindex.html +++ b/docs/saml2/py-modindex.html @@ -1,154 +1,200 @@ + + + + + + Python Module Index — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + - - - - - - - - Python Class Index — OneLogin SAML Python library classes and methods - - - - - - - - - - + + + +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • +
    • +
    +
    +
    +
    +
    + - - - - -
    -
    -
    -
    - - -

    Python Class Index

    - - +

    Python Module Index

    + +
    + o +
    + +
    + + + + + + + + + + + + + + - - - - - - - - - - + + + + + +
     
    + o
    - saml2 + onelogin +
        + onelogin.saml2 +
        + onelogin.saml2.auth +
        + onelogin.saml2.authn_request +
        + onelogin.saml2.compat
        - saml2.auth +     + onelogin.saml2.constants
        - saml2.authn_request +     + onelogin.saml2.errors
        - saml2.constants +     + onelogin.saml2.idp_metadata_parser
        - saml2.errors +     + onelogin.saml2.logout_request
        - saml2.logout_request +     + onelogin.saml2.logout_response
        - saml2.logout_response +     + onelogin.saml2.metadata
        - saml2.metadata +     + onelogin.saml2.response
        - saml2.response +     + onelogin.saml2.settings
        - saml2.settings +     + onelogin.saml2.utils
        - saml2.utils +     + onelogin.saml2.xml_templates +
        + onelogin.saml2.xml_utils +
        + onelogin.saml2.xmlparser
    +
    +
    -
    -
    - - -
    -
    -
    -
    - - - +
    +
    + + + \ No newline at end of file diff --git a/docs/saml2/saml2.html b/docs/saml2/saml2.html deleted file mode 100644 index 6dd1e00a..00000000 --- a/docs/saml2/saml2.html +++ /dev/null @@ -1,2044 +0,0 @@ - - - - - - - - - - OneLogin saml2 Module — OneLogin SAML Python library classes and methods - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    OneLogin saml2 Module

    -
    -

    auth Class

    -
    -
    -class onelogin.saml2.auth.OneLogin_Saml2_Auth(request_data, old_settings=None)[source]
    -

    Bases: object

    -
    -
    -build_request_signature(saml_request, relay_state)[source]
    -

    Builds the Signature of the SAML Request.

    - --- - - - -
    Parameters:
      -
    • saml_request (string) – The SAML Request
    • -
    • relay_state (string) – The target URL the user should be redirected to
    • -
    -
    -
    - -
    -
    -build_response_signature(saml_response, relay_state)[source]
    -

    Builds the Signature of the SAML Response. -:param saml_request: The SAML Response -:type saml_request: string

    - --- - - - -
    Parameters:relay_state (string) – The target URL the user should be redirected to
    -
    - -
    -
    -get_attribute(name)[source]
    -

    Returns the requested SAML attribute.

    - --- - - - - - - - -
    Parameters:name (string) – Name of the attribute
    Returns:Attribute value if exists or None
    Return type:string
    -
    - -
    -
    -get_attributes()[source]
    -

    Returns the set of SAML attributes.

    - --- - - - - - -
    Returns:SAML attributes
    Return type:dict
    -
    - -
    -
    -get_errors()[source]
    -

    Returns a list with code errors if something went wrong

    - --- - - - - - -
    Returns:List of errors
    Return type:list
    -
    - -
    -
    -get_last_error_reason()[source]
    -

    Returns the reason for the last error

    - --- - - - - - -
    Returns:Error
    Return type:string
    -
    - -
    -
    -get_nameid()[source]
    -

    Returns the nameID.

    - --- - - - - - -
    Returns:NameID
    Return type:string
    -
    - -
    -
    -get_settings()[source]
    -

    Returns the settings info -:return: Setting info -:rtype: OneLogin_Saml2_Setting object

    -
    - -
    -
    -get_slo_url()[source]
    -

    Gets the SLO url.

    - --- - - - - - -
    Returns:An URL, the SLO endpoint of the IdP
    Return type:string
    -
    - -
    -
    -get_sso_url()[source]
    -

    Gets the SSO url.

    - --- - - - - - -
    Returns:An URL, the SSO endpoint of the IdP
    Return type:string
    -
    - -
    -
    -is_authenticated()[source]
    -

    Checks if the user is authenticated or not.

    - --- - - - - - -
    Returns:True if is authenticated, False if not
    Return type:bool
    -
    - -
    -
    -login(return_to=None, force_authn=False, is_passive=False)[source]
    -

    Initiates the SSO process.

    - --- - - - - - -
    Parameters:
      -
    • return_to (string) – Optional argument. The target URL the user should be redirected to after login.
    • -
    • force_authn (bool) – Optional argument. When true the AuthNReuqest will set the ForceAuthn='true'.
    • -
    • is_passive (bool) – Optional argument. When true the AuthNReuqest will set the Ispassive='true'.
    • -
    -
    Returns:Redirection url
    -
    - -
    -
    -logout(return_to=None, name_id=None, session_index=None)[source]
    -

    Initiates the SLO process.

    - --- - - - - - - -
    Parameters:
      -
    • return_to (string) – Optional argument. The target URL the user should be redirected to after logout.
    • -
    • name_id (string) – Optional argument. The NameID that will be set in the LogoutRequest.
    • -
    • session_index (string) – Optional argument. SessionIndex that identifies the session of the user.
    • -
    Returns:Redirection url
    -
    - -
    -
    -process_response(request_id=None)[source]
    -

    Process the SAML Response sent by the IdP.

    - --- - - - - - -
    Parameters:request_id (string) – Is an optional argumen. Is the ID of the AuthNRequest sent by this SP to the IdP.
    Raises :OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND, when a POST with a SAMLResponse is not found
    -
    - -
    -
    -process_slo(keep_local_session=False, request_id=None, delete_session_cb=None)[source]
    -

    Process the SAML Logout Response / Logout Request sent by the IdP.

    - --- - - - - - -
    Parameters:
      -
    • keep_local_session (bool) – When false will destroy the local session, otherwise will destroy it
    • -
    • request_id (string) – The ID of the LogoutRequest sent by this SP to the IdP
    • -
    -
    Returns:

    Redirection url

    -
    -
    - -
    -
    -redirect_to(url=None, parameters={})[source]
    -

    Redirects the user to the url past by parameter or to the url that we defined in our SSO Request.

    - --- - - - - - -
    Parameters:
      -
    • url (string) – The target URL to redirect the user
    • -
    • parameters (dict) – Extra parameters to be passed as part of the url
    • -
    -
    Returns:

    Redirection url

    -
    -
    - -
    -
    -set_strict(value)[source]
    -

    Set the strict mode active/disable

    - --- - - - -
    Parameters:value (bool) –
    -
    - -
    - -
    -
    -

    authn_request Class

    -
    -
    -class onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request(settings, force_authn=False, is_passive=False)[source]
    -
    -
    -get_request()[source]
    -

    Returns unsigned AuthnRequest. -:return: Unsigned AuthnRequest -:rtype: str object

    -
    - -
    - -
    -
    -

    constants Class

    -
    -
    -class onelogin.saml2.constants.OneLogin_Saml2_Constants[source]
    -
    -
    -AC_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos'
    -
    - -
    -
    -AC_PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'
    -
    - -
    -
    -AC_SMARTCARD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard'
    -
    - -
    -
    -AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified'
    -
    - -
    -
    -AC_X509 = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509'
    -
    - -
    -
    -ALOWED_CLOCK_DRIFT = 180
    -
    - -
    -
    -ATTRNAME_FORMAT_BASIC = 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic'
    -
    - -
    -
    -ATTRNAME_FORMAT_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified'
    -
    - -
    -
    -ATTRNAME_FORMAT_URI = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'
    -
    - -
    -
    -BINDING_DEFLATE = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE'
    -
    - -
    -
    -BINDING_HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'
    -
    - -
    -
    -BINDING_HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
    -
    - -
    -
    -BINDING_HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
    -
    - -
    -
    -BINDING_SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP'
    -
    - -
    -
    -CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer'
    -
    - -
    -
    -CM_HOLDER_KEY = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key'
    -
    - -
    -
    -CM_SENDER_VOUCHES = 'urn:oasis:names:tc:SAML:2.0:cm:sender-vouches'
    -
    - -
    -
    -NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
    -
    - -
    -
    -NAMEID_ENCRYPTED = 'urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted'
    -
    - -
    -
    -NAMEID_ENTITY = 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity'
    -
    - -
    -
    -NAMEID_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos'
    -
    - -
    -
    -NAMEID_PERSISTENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'
    -
    - -
    -
    -NAMEID_TRANSIENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
    -
    - -
    -
    -NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName'
    -
    - -
    -
    -NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName'
    -
    - -
    -
    -NSMAP = {'xenc': 'http://www.w3.org/2001/04/xmlenc#', 'samlp': 'urn:oasis:names:tc:SAML:2.0:protocol', 'ds': 'http://www.w3.org/2000/09/xmldsig#', 'saml': 'urn:oasis:names:tc:SAML:2.0:assertion'}
    -
    - -
    -
    -NS_DS = 'http://www.w3.org/2000/09/xmldsig#'
    -
    - -
    -
    -NS_MD = 'urn:oasis:names:tc:SAML:2.0:metadata'
    -
    - -
    -
    -NS_SAML = 'urn:oasis:names:tc:SAML:2.0:assertion'
    -
    - -
    -
    -NS_SAMLP = 'urn:oasis:names:tc:SAML:2.0:protocol'
    -
    - -
    -
    -NS_SOAP = 'http://schemas.xmlsoap.org/soap/envelope/'
    -
    - -
    -
    -NS_XENC = 'http://www.w3.org/2001/04/xmlenc#'
    -
    - -
    -
    -NS_XS = 'http://www.w3.org/2001/XMLSchema'
    -
    - -
    -
    -NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance'
    -
    - -
    -
    -RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
    -
    - -
    -
    -STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive'
    -
    - -
    -
    -STATUS_PARTIAL_LOGOUT = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout'
    -
    - -
    -
    -STATUS_PROXY_COUNT_EXCEEDED = 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded'
    -
    - -
    -
    -STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester'
    -
    - -
    -
    -STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder'
    -
    - -
    -
    -STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success'
    -
    - -
    -
    -STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch'
    -
    - -
    - -
    -
    -

    errors Class

    -
    -
    -exception onelogin.saml2.errors.OneLogin_Saml2_Error(message, code=0, errors=None)[source]
    -

    Bases: exceptions.Exception

    -
    -
    -METADATA_SP_INVALID = 3
    -
    - -
    -
    -PRIVATE_KEY_FILE_NOT_FOUND = 7
    -
    - -
    -
    -PUBLIC_CERT_FILE_NOT_FOUND = 6
    -
    - -
    -
    -REDIRECT_INVALID_URL = 5
    -
    - -
    -
    -SAML_LOGOUTMESSAGE_NOT_FOUND = 9
    -
    - -
    -
    -SAML_LOGOUTREQUEST_INVALID = 10
    -
    - -
    -
    -SAML_LOGOUTRESPONSE_INVALID = 11
    -
    - -
    -
    -SAML_RESPONSE_NOT_FOUND = 8
    -
    - -
    -
    -SAML_SINGLE_LOGOUT_NOT_SUPPORTED = 12
    -
    - -
    -
    -SETTINGS_FILE_NOT_FOUND = 0
    -
    - -
    -
    -SETTINGS_INVALID = 2
    -
    - -
    -
    -SETTINGS_INVALID_SYNTAX = 1
    -
    - -
    -
    -SP_CERTS_NOT_FOUND = 4
    -
    - -
    - -
    -
    -

    logout_request Class

    -
    -
    -class onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request(settings, request=None, name_id=None, session_index=None)[source]
    -
    -
    -static get_id(request)[source]
    -

    Returns the ID of the Logout Request -:param request: Logout Request Message -:type request: string|DOMDocument -:return: string ID -:rtype: str object

    -
    - -
    -
    -static get_issuer(request)[source]
    -

    Gets the Issuer of the Logout Request Message -:param request: Logout Request Message -:type request: string|DOMDocument -:return: The Issuer -:rtype: string

    -
    - -
    -
    -static get_name_id(request, key=None)[source]
    -

    Gets the NameID of the Logout Request Message -:param request: Logout Request Message -:type request: string|DOMDocument -:param key: The SP key -:type key: string -:return: Name ID Value -:rtype: string

    -
    - -
    -
    -static get_name_id_data(request, key=None)[source]
    -

    Gets the NameID Data of the the Logout Request -:param request: Logout Request Message -:type request: string|DOMDocument -:param key: The SP key -:type key: string -:return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier) -:rtype: dict

    -
    - -
    -
    -get_request()[source]
    -

    Returns the Logout Request defated, base64encoded -:return: Deflated base64 encoded Logout Request -:rtype: str object

    -
    - -
    -
    -static get_session_indexes(request)[source]
    -

    Gets the SessionIndexes from the Logout Request -:param request: Logout Request Message -:type request: string|DOMDocument -:return: The SessionIndex value -:rtype: list

    -
    - -
    -
    -static is_valid(settings, request, get_data, debug=False)[source]
    -

    Checks if the Logout Request recieved is valid -:param settings: Settings -:type settings: OneLogin_Saml2_Settings -:param request: Logout Request Message -:type request: string|DOMDocument -:return: If the Logout Request is or not valid -:rtype: boolean

    -
    - -
    -
    -get_error()[source]
    -

    After execute a validation process, if fails this method returns the cause -:rtype: str object

    -
    - -
    - -
    -
    -

    logout_response Class

    -
    -
    -class onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response(settings, response=None)[source]
    -
    -
    -build(in_response_to)[source]
    -

    Creates a Logout Response object. -:param in_response_to: InResponseTo value for the Logout Response. -:type in_response_to: string

    -
    - -
    -
    -get_issuer()[source]
    -

    Gets the Issuer of the Logout Response Message -:return: The Issuer -:rtype: string

    -
    - -
    -
    -get_response()[source]
    -

    Returns a Logout Response object. -:return: Logout Response deflated and base64 encoded -:rtype: string

    -
    - -
    -
    -get_status()[source]
    -

    Gets the Status -:return: The Status -:rtype: string

    -
    - -
    -
    -is_valid(request_data, request_id=None)[source]
    -

    Determines if the SAML LogoutResponse is valid -:param request_id: The ID of the LogoutRequest sent by this SP to the IdP -:type request_id: string -:return: Returns if the SAML LogoutResponse is or not valid -:rtype: boolean

    -
    - -
    -
    -get_error()[source]
    -

    After execute a validation process, if fails this method returns the cause -:rtype: str object

    -
    - -
    - -
    -
    -

    metadata Class

    -
    -
    -class onelogin.saml2.metadata.OneLogin_Saml2_Metadata[source]
    -
    -
    -TIME_CACHED = 604800
    -
    - -
    -
    -TIME_VALID = 172800
    -
    - -
    -
    -static add_x509_key_descriptors(metadata, cert)[source]
    -

    Add the x509 descriptors (sign/encriptation to the metadata -The same cert will be used for sign/encrypt

    - --- - - - - - - - -
    Parameters:
      -
    • metadata (string) – SAML Metadata XML
    • -
    • cert (string) – x509 cert
    • -
    -
    Returns:

    Metadata with KeyDescriptors

    -
    Return type:

    string

    -
    -
    - -
    -
    -static builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None)[source]
    -

    Build the metadata of the SP

    - --- - - - -
    Parameters:
      -
    • sp (string) – The SP data
    • -
    • authnsign (string) – authnRequestsSigned attribute
    • -
    • wsign (string) – wantAssertionsSigned attribute
    • -
    • valid_until (DateTime) – Metadata’s valid time
    • -
    • cache_duration (Timestamp) – Duration of the cache in seconds
    • -
    • contacts (dict) – Contacts info
    • -
    • organization (dict) – Organization ingo
    • -
    -
    -
    - -
    -
    -static sign_metadata(metadata, key, cert)[source]
    -

    Sign the metadata with the key/cert provided

    - --- - - - - - - - -
    Parameters:
      -
    • metadata (string) – SAML Metadata XML
    • -
    • key (string) – x509 key
    • -
    • cert (string) – x509 cert
    • -
    -
    Returns:

    Signed Metadata

    -
    Return type:

    string

    -
    -
    - -
    - -
    -
    -

    response Class

    -
    -
    -class onelogin.saml2.response.OneLogin_Saml2_Response(settings, response)[source]
    -

    Bases: object

    -
    -
    -check_status()[source]
    -

    Check if the status of the response is success or not

    - --- - - - -
    Raises :Exception. If the status is not success
    -
    - -
    -
    -get_attributes()[source]
    -

    Gets the Attributes from the AttributeStatement element. -EncryptedAttributes are not supported

    -
    - -
    -
    -get_audiences()[source]
    -

    Gets the audiences

    - --- - - - - - -
    Returns:The valid audiences for the SAML Response
    Return type:list
    -
    - -
    -
    -get_issuers()[source]
    -

    Gets the issuers (from message and from assertion)

    - --- - - - - - -
    Returns:The issuers
    Return type:list
    -
    - -
    -
    -get_nameid()[source]
    -

    Gets the NameID provided by the SAML Response from the IdP

    - --- - - - - - -
    Returns:NameID (value)
    Return type:string
    -
    - -
    -
    -get_nameid_data()[source]
    -

    Gets the NameID Data provided by the SAML Response from the IdP

    - --- - - - - - -
    Returns:Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
    Return type:dict
    -
    - -
    -
    -get_session_index()[source]
    -

    Gets the SessionIndex from the AuthnStatement -Could be used to be stored in the local session in order -to be used in a future Logout Request that the SP could -send to the SP, to set what specific session must be deleted

    - --- - - - - - -
    Returns:The SessionIndex value
    Return type:string|None
    -
    - -
    -
    -get_session_not_on_or_after()[source]
    -

    Gets the SessionNotOnOrAfter from the AuthnStatement -Could be used to set the local session expiration

    - --- - - - - - -
    Returns:The SessionNotOnOrAfter value
    Return type:time|None
    -
    - -
    -
    -is_valid(request_data, request_id=None)[source]
    -

    Constructs the response object.

    - --- - - - - - - - -
    Parameters:request_id (string) – Optional argument. The ID of the AuthNRequest sent by this SP to the IdP
    Returns:True if the SAML Response is valid, False if not
    Return type:bool
    -
    - -
    -
    -validate_num_assertions()[source]
    -

    Verifies that the document only contains a single Assertion (encrypted or not)

    - --- - - - - - -
    Returns:True if only 1 assertion encrypted or not
    Return type:bool
    -
    - -
    -
    -validate_timestamps()[source]
    -

    Verifies that the document is valid according to Conditions Element

    - --- - - - - - -
    Returns:True if the condition is valid, False otherwise
    Return type:bool
    -
    - -
    - -
    -
    -

    settings Class

    -
    -
    -class onelogin.saml2.settings.OneLogin_Saml2_Settings(settings=None, custom_base_path=None)[source]
    -
    -
    -check_settings(settings)[source]
    -

    Checks the settings info.

    - --- - - - - - - - -
    Parameters:settings (dict) – Dict with settings data
    Returns:Errors found on the settings data
    Return type:list
    -
    - -
    -
    -check_sp_certs()[source]
    -

    Checks if the x509 certs of the SP exists and are valid.

    - --- - - - - - -
    Returns:If the x509 certs of the SP exists and are valid
    Return type:boolean
    -
    - -
    -
    -format_idp_cert()[source]
    -

    Formats the IdP cert.

    -
    - -
    -
    -get_base_path()[source]
    -

    Returns base path

    - --- - - - - - -
    Returns:The base toolkit folder path
    Return type:string
    -
    - -
    -
    -get_cert_path()[source]
    -

    Returns cert path

    - --- - - - - - -
    Returns:The cert folder path
    Return type:string
    -
    - -
    -
    -get_contacts()[source]
    -

    Gets contact data.

    - --- - - - - - -
    Returns:Contacts info
    Return type:dict
    -
    - -
    -
    -get_errors()[source]
    -

    Returns an array with the errors, the array is empty when the settings is ok.

    - --- - - - - - -
    Returns:Errors
    Return type:list
    -
    - -
    -
    -get_ext_lib_path()[source]
    -

    Returns external lib path

    - --- - - - - - -
    Returns:The external library folder path
    Return type:string
    -
    - -
    -
    -get_idp_data()[source]
    -

    Gets the IdP data.

    - --- - - - - - -
    Returns:IdP info
    Return type:dict
    -
    - -
    -
    -get_lib_path()[source]
    -

    Returns lib path

    - --- - - - - - -
    Returns:The library folder path
    Return type:string
    -
    - -
    -
    -get_organization()[source]
    -

    Gets organization data.

    - --- - - - - - -
    Returns:Organization info
    Return type:dict
    -
    - -
    -
    -get_schemas_path()[source]
    -

    Returns schema path

    - --- - - - - - -
    Returns:The schema folder path
    Return type:string
    -
    - -
    -
    -get_security_data()[source]
    -

    Gets security data.

    - --- - - - - - -
    Returns:Security info
    Return type:dict
    -
    - -
    -
    -get_sp_cert()[source]
    -

    Returns the x509 public cert of the SP.

    - --- - - - - - -
    Returns:SP public cert
    Return type:string
    -
    - -
    -
    -get_sp_data()[source]
    -

    Gets the SP data.

    - --- - - - - - -
    Returns:SP info
    Return type:dict
    -
    - -
    -
    -get_sp_key()[source]
    -

    Returns the x509 private key of the SP.

    - --- - - - - - -
    Returns:SP private key
    Return type:string
    -
    - -
    -
    -get_sp_metadata()[source]
    -

    Gets the SP metadata. The XML representation.

    - --- - - - - - -
    Returns:SP metadata (xml)
    Return type:string
    -
    - -
    -
    -is_debug_active()[source]
    -

    Returns if the debug is active.

    - --- - - - - - -
    Returns:Debug parameter
    Return type:boolean
    -
    - -
    -
    -is_strict()[source]
    -

    Returns if the ‘strict’ mode is active.

    - --- - - - - - -
    Returns:Strict parameter
    Return type:boolean
    -
    - -
    -
    -set_strict(value)[source]
    -

    Activates or deactivates the strict mode.

    - --- - - - -
    Parameters:xml (boolean) – Strict parameter
    -
    - -
    -
    -validate_metadata(xml)[source]
    -

    Validates an XML SP Metadata.

    - --- - - - - - - - -
    Parameters:xml (string) – Metadata’s XML that will be validate
    Returns:The list of found errors
    Return type:list
    -
    - -
    - -
    -
    -onelogin.saml2.settings.validate_url(url)[source]
    -
    - -
    -
    -

    utils Class

    -
    -
    -class onelogin.saml2.utils.OneLogin_Saml2_Utils[source]
    -
    -
    -static add_sign(xml, key, cert)[source]
    -

    Adds signature key and senders certificate to an element (Message or -Assertion).

    - --- - - - - - - - - - -
    Parameters:
      -
    • xml – The element we should sign
    • -
    • key – The private key
    • -
    • cert – The public
    • -
    -
    Type :

    string | Document

    -
    Type :

    string

    -
    Type :

    string

    -
    -
    - -
    -
    -static calculate_x509_fingerprint(x509_cert)[source]
    -

    Calculates the fingerprint of a x509cert.

    - --- - - - - - - - - - -
    Parameters:x509_cert – x509 cert
    Type :string
    Returns:Formated fingerprint
    Return type:string
    -
    - -
    -
    -static decode_base64_and_inflate(value)[source]
    -

    base64 decodes and then inflates according to RFC1951 -:param value: a deflated and encoded string -:return: the string after decoding and inflating

    -
    - -
    -
    -static decrypt_element(encrypted_data, enc_ctx)[source]
    -

    Decrypts an encrypted element.

    - --- - - - - - - - - - - - -
    Parameters:
      -
    • encrypted_data – The encrypted data.
    • -
    • enc_ctx – The encryption context.
    • -
    -
    Type :

    DOMElement

    -
    Type :

    Encryption Context

    -
    Returns:

    The decrypted element.

    -
    Return type:

    DOMElement

    -
    -
    - -
    -
    -static deflate_and_base64_encode(value)[source]
    -

    Deflates and the base64 encodes a string -:param value: The string to deflate and encode -:return: The deflated and encoded string

    -
    - -
    -
    -static delete_local_session(callback=None)[source]
    -

    Deletes the local session.

    -
    - -
    -
    -static format_cert(cert, heads=True)[source]
    -

    Returns a x509 cert (adding header & footer if required).

    - --- - - - - - - - - - - - -
    Parameters:
      -
    • cert – A x509 unformated cert
    • -
    • heads – True if we want to include head and footer
    • -
    -
    Type :

    string

    -
    Type :

    boolean

    -
    Returns:

    Formated cert

    -
    Return type:

    string

    -
    -
    - -
    -
    -static format_finger_print(fingerprint)[source]
    -

    Formates a fingerprint.

    - --- - - - - - - - - - -
    Parameters:fingerprint – fingerprint
    Type :string
    Returns:Formated fingerprint
    Return type:string
    -
    - -
    -
    -static generate_name_id(value, sp_nq, sp_format, key=None)[source]
    -

    Generates a nameID.

    - --- - - - - - - - - - - - - - - - -
    Parameters:
      -
    • value – fingerprint
    • -
    • sp_nq – SP Name Qualifier
    • -
    • sp_format – SP Format
    • -
    • key – SP Key to encrypt the nameID
    • -
    -
    Type :

    string

    -
    Type :

    string

    -
    Type :

    string

    -
    Type :

    string

    -
    Returns:

    DOMElement | XMLSec nameID

    -
    Return type:

    string

    -
    -
    - -
    -
    -static generate_unique_id()[source]
    -

    Generates an unique string (used for example as ID for assertions).

    - --- - - - - - -
    Returns:A unique string
    Return type:string
    -
    - -
    -
    -static get_expire_time(cache_duration=None, valid_until=None)[source]
    -

    Compares 2 dates and returns the earliest.

    - --- - - - - - - - - - - - -
    Parameters:
      -
    • cache_duration – The duration, as a string.
    • -
    • valid_until – The valid until date, as a string or as a timestamp
    • -
    -
    Type :

    string

    -
    Type :

    string

    -
    Returns:

    The expiration time.

    -
    Return type:

    int

    -
    -
    - -
    -
    -static get_self_host(request_data)[source]
    -

    Returns the current host.

    - --- - - - - - - - - - -
    Parameters:request_data – The request as a dict
    Type :dict
    Returns:The current host
    Return type:string
    -
    - -
    -
    -static get_self_url(request_data)[source]
    -

    Returns the URL of the current host + current view + query.

    - --- - - - - - - - - - -
    Parameters:request_data – The request as a dict
    Type :dict
    Returns:The url of current host + current view + query
    Return type:string
    -
    - -
    -
    -static get_self_url_host(request_data)[source]
    -

    Returns the protocol + the current host + the port (if different than -common ports).

    - --- - - - - - - - - - -
    Parameters:request_data – The request as a dict
    Type :dict
    Returns:Url
    Return type:string
    -
    - -
    -
    -static get_self_url_no_query(request_data)[source]
    -

    Returns the URL of the current host + current view.

    - --- - - - - - - - - - -
    Parameters:request_data – The request as a dict
    Type :dict
    Returns:The url of current host + current view
    Return type:string
    -
    - -
    -
    -static get_status(dom)[source]
    -

    Gets Status from a Response.

    - --- - - - - - - - - - -
    Parameters:dom – The Response as XML
    Type :Document
    Returns:The Status, an array with the code and a message.
    Return type:dict
    -
    - -
    -
    -static is_https(request_data)[source]
    -

    Checks if https or http.

    - --- - - - - - - - - - -
    Parameters:request_data – The request as a dict
    Type :dict
    Returns:False if https is not active
    Return type:boolean
    -
    - -
    -
    -static parse_SAML_to_time(timestr)[source]
    -

    Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z -to a UNIX timestamp. The sub-second part is ignored.

    - --- - - - - - - - - - -
    Parameters:time – The time we should convert (SAML Timestamp).
    Type :string
    Returns:Converted to a unix timestamp.
    Return type:int
    -
    - -
    -
    -static parse_duration(duration, timestamp=None)[source]
    -

    Interprets a ISO8601 duration value relative to a given timestamp.

    - --- - - - - - - - - - - - -
    Parameters:
      -
    • duration – The duration, as a string.
    • -
    • timestamp – The unix timestamp we should apply the duration to. -Optional, default to the current time.
    • -
    -
    Type :

    string

    -
    Type :

    string

    -
    Returns:

    The new timestamp, after the duration is applied.

    -
    Return type:

    int

    -
    -
    - -
    -
    -static parse_time_to_SAML(time)[source]
    -

    Converts a UNIX timestamp to SAML2 timestamp on the form -yyyy-mm-ddThh:mm:ss(.s+)?Z.

    - --- - - - - - - - - - -
    Parameters:time – The time we should convert (DateTime).
    Type :string
    Returns:SAML2 timestamp.
    Return type:string
    -
    - -
    -
    -static query(dom, query, context=None)[source]
    -

    Extracts nodes that match the query from the Element

    - --- - - - - - - - - - - - - - -
    Parameters:
      -
    • dom – The root of the lxml objet
    • -
    • query – Xpath Expresion
    • -
    • context – Context Node
    • -
    -
    Type :

    Element

    -
    Type :

    string

    -
    Type :

    DOMElement

    -
    Returns:

    The queried nodes

    -
    Return type:

    list

    -
    -
    - -
    -
    -static redirect(url, parameters={}, request_data={})[source]
    -

    Executes a redirection to the provided url (or return the target url).

    - --- - - - - - - - - - - - - - -
    Parameters:
      -
    • url – The target url
    • -
    • parameters – Extra parameters to be passed as part of the url
    • -
    • request_data – The request as a dict
    • -
    -
    Type :

    string

    -
    Type :

    dict

    -
    Type :

    dict

    -
    Returns:

    Url

    -
    Return type:

    string

    -
    -
    - -
    -
    -static validate_sign(xml, cert=None, fingerprint=None)[source]
    -

    Validates a signature (Message or Assertion).

    - --- - - - - - - - - - -
    Parameters:
      -
    • xml – The element we should validate
    • -
    • cert – The pubic cert
    • -
    • fingerprint – The fingerprint of the public cert
    • -
    -
    Type :

    string | Document

    -
    Type :

    string

    -
    Type :

    string

    -
    -
    - -
    -
    -static validate_xml(xml, schema, debug=False)[source]
    -
    - -
    -
    -static write_temp_file(content)[source]
    -

    Writes some content into a temporary file and returns it.

    - --- - - - - - - - - - -
    Parameters:content – The file content
    Type :string
    Returns:The temporary file
    Return type:file-like object
    -
    - -
    - -
    -
    - - -
    -
    -
    -
    -
    -

    Table Of Contents

    - - -

    Previous topic

    -

    Welcome to OneLogin SAML Python library documentation

    -

    This Page

    - - - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/saml2/search.html b/docs/saml2/search.html index 531d00de..4adb787b 100644 --- a/docs/saml2/search.html +++ b/docs/saml2/search.html @@ -1,107 +1,120 @@ + + + + + + Search — SAML Python2/3 Toolkit 1 documentation + + + + + + + + + + + + + + + + + +
    + - - - +
    -
    -
    -
    -
    - -

    Search

    +
    +
    +
    +
      +
    • + +
    • +
    • +
    +
    +
    +
    +
    + + +
    +
    +
    -
    -
    -
    -
    -
    -
    - - - +
    +
    + + + + + + + + \ No newline at end of file diff --git a/docs/saml2/searchindex.js b/docs/saml2/searchindex.js index cf3c42ca..2107afb9 100644 --- a/docs/saml2/searchindex.js +++ b/docs/saml2/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{"saml2.logout_response.OneLogin_Saml2_Logout_Response":{is_valid:[1,2,1,""],get_response:[1,2,1,""],get_status:[1,2,1,""],get_issuer:[1,2,1,""],build:[1,2,1,""]},"saml2.response.OneLogin_Saml2_Response":{get_audiences:[1,2,1,""],validate_num_assertions:[1,2,1,""],get_nameid_data:[1,2,1,""],get_session_index:[1,2,1,""],get_issuers:[1,2,1,""],is_valid:[1,2,1,""],check_status:[1,2,1,""],validate_timestamps:[1,2,1,""],get_nameid:[1,2,1,""],get_attributes:[1,2,1,""],get_session_not_on_or_after:[1,2,1,""]},"saml2.errors.OneLogin_Saml2_Error":{PUBLIC_CERT_FILE_NOT_FOUND:[1,1,1,""],SETTINGS_FILE_NOT_FOUND:[1,1,1,""],SAML_LOGOUTREQUEST_INVALID:[1,1,1,""],REDIRECT_INVALID_URL:[1,1,1,""],PRIVATE_KEY_FILE_NOT_FOUND:[1,1,1,""],SAML_LOGOUTMESSAGE_NOT_FOUND:[1,1,1,""],SAML_RESPONSE_NOT_FOUND:[1,1,1,""],METADATA_SP_INVALID:[1,1,1,""],SAML_LOGOUTRESPONSE_INVALID:[1,1,1,""],SETTINGS_INVALID:[1,1,1,""],SP_CERTS_NOT_FOUND:[1,1,1,""],SETTINGS_INVALID_SYNTAX:[1,1,1,""],SAML_SINGLE_LOGOUT_NOT_SUPPORTED:[1,1,1,""]},"saml2.errors":{OneLogin_Saml2_Error:[1,6,1,""]},"saml2.metadata.OneLogin_Saml2_Metadata":{sign_metadata:[1,3,1,""],builder:[1,3,1,""],add_x509_key_descriptors:[1,3,1,""],TIME_VALID:[1,1,1,""],TIME_CACHED:[1,1,1,""]},"saml2.response":{OneLogin_Saml2_Response:[1,4,1,""]},"saml2.settings.OneLogin_Saml2_Settings":{get_contacts:[1,2,1,""],get_security_data:[1,2,1,""],validate_metadata:[1,2,1,""],get_errors:[1,2,1,""],check_settings:[1,2,1,""],get_sp_data:[1,2,1,""],get_idp_data:[1,2,1,""],get_cert_path:[1,2,1,""],get_schemas_path:[1,2,1,""],set_strict:[1,2,1,""],get_base_path:[1,2,1,""],is_strict:[1,2,1,""],get_lib_path:[1,2,1,""],get_sp_key:[1,2,1,""],get_sp_metadata:[1,2,1,""],is_debug_active:[1,2,1,""],get_ext_lib_path:[1,2,1,""],get_sp_cert:[1,2,1,""],get_organization:[1,2,1,""],check_sp_certs:[1,2,1,""],format_idp_cert:[1,2,1,""]},"saml2.settings":{OneLogin_Saml2_Settings:[1,4,1,""],validate_url:[1,5,1,""]},"saml2.logout_response":{OneLogin_Saml2_Logout_Response:[1,4,1,""]},"saml2.authn_request.OneLogin_Saml2_Authn_Request":{get_request:[1,2,1,""]},"saml2.constants.OneLogin_Saml2_Constants":{NAMEID_EMAIL_ADDRESS:[1,1,1,""],CM_SENDER_VOUCHES:[1,1,1,""],CM_HOLDER_KEY:[1,1,1,""],NS_SAML:[1,1,1,""],RSA_SHA1:[1,1,1,""],NS_XS:[1,1,1,""],STATUS_PROXY_COUNT_EXCEEDED:[1,1,1,""],NS_SOAP:[1,1,1,""],NAMEID_ENCRYPTED:[1,1,1,""],STATUS_REQUESTER:[1,1,1,""],STATUS_NO_PASSIVE:[1,1,1,""],STATUS_PARTIAL_LOGOUT:[1,1,1,""],BINDING_HTTP_REDIRECT:[1,1,1,""],NAMEID_X509_SUBJECT_NAME:[1,1,1,""],AC_KERBEROS:[1,1,1,""],NAMEID_KERBEROS:[1,1,1,""],BINDING_HTTP_ARTIFACT:[1,1,1,""],NS_XENC:[1,1,1,""],BINDING_HTTP_POST:[1,1,1,""],CM_BEARER:[1,1,1,""],ALOWED_CLOCK_DRIFT:[1,1,1,""],BINDING_DEFLATE:[1,1,1,""],NAMEID_ENTITY:[1,1,1,""],AC_SMARTCARD:[1,1,1,""],AC_UNSPECIFIED:[1,1,1,""],NS_XSI:[1,1,1,""],NSMAP:[1,1,1,""],STATUS_RESPONDER:[1,1,1,""],AC_PASSWORD:[1,1,1,""],NS_SAMLP:[1,1,1,""],NS_DS:[1,1,1,""],STATUS_SUCCESS:[1,1,1,""],AC_X509:[1,1,1,""],NAMEID_TRANSIENT:[1,1,1,""],BINDING_SOAP:[1,1,1,""],ATTRNAME_FORMAT_UNSPECIFIED:[1,1,1,""],ATTRNAME_FORMAT_BASIC:[1,1,1,""],NS_MD:[1,1,1,""],ATTRNAME_FORMAT_URI:[1,1,1,""],NAMEID_PERSISTENT:[1,1,1,""],STATUS_VERSION_MISMATCH:[1,1,1,""],NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME:[1,1,1,""]},"saml2.authn_request":{OneLogin_Saml2_Authn_Request:[1,4,1,""]},"saml2.metadata":{OneLogin_Saml2_Metadata:[1,4,1,""]},"saml2.utils.OneLogin_Saml2_Utils":{generate_unique_id:[1,3,1,""],add_sign:[1,3,1,""],deflate_and_base64_encode:[1,3,1,""],get_status:[1,3,1,""],query:[1,3,1,""],redirect:[1,3,1,""],get_expire_time:[1,3,1,""],decode_base64_and_inflate:[1,3,1,""],parse_SAML_to_time:[1,3,1,""],parse_duration:[1,3,1,""],generate_name_id:[1,3,1,""],validate_xml:[1,3,1,""],get_self_host:[1,3,1,""],parse_time_to_SAML:[1,3,1,""],format_finger_print:[1,3,1,""],decrypt_element:[1,3,1,""],get_self_url_host:[1,3,1,""],get_self_url:[1,3,1,""],delete_local_session:[1,3,1,""],format_cert:[1,3,1,""],is_https:[1,3,1,""],calculate_x509_fingerprint:[1,3,1,""],get_self_url_no_query:[1,3,1,""],write_temp_file:[1,3,1,""],validate_sign:[1,3,1,""]},"saml2.logout_request.OneLogin_Saml2_Logout_Request":{get_issuer:[1,3,1,""],get_name_id:[1,3,1,""],get_request:[1,2,1,""],get_id:[1,3,1,""],is_valid:[1,3,1,""],get_session_indexes:[1,3,1,""],get_name_id_data:[1,3,1,""]},"saml2.utils":{OneLogin_Saml2_Utils:[1,4,1,""]},"saml2.constants":{OneLogin_Saml2_Constants:[1,4,1,""]},"saml2.auth.OneLogin_Saml2_Auth":{get_settings:[1,2,1,""],process_response:[1,2,1,""],get_errors:[1,2,1,""],build_request_signature:[1,2,1,""],redirect_to:[1,2,1,""],is_authenticated:[1,2,1,""],get_attribute:[1,2,1,""],build_response_signature:[1,2,1,""],set_strict:[1,2,1,""],process_slo:[1,2,1,""],get_sso_url:[1,2,1,""],logout:[1,2,1,""],login:[1,2,1,""],get_slo_url:[1,2,1,""],get_attributes:[1,2,1,""],get_nameid:[1,2,1,""]},"saml2.auth":{OneLogin_Saml2_Auth:[1,4,1,""]},saml2:{errors:[1,0,1,""],settings:[1,0,1,""],utils:[1,0,1,""],auth:[1,0,1,""],logout_request:[1,0,1,""],authn_request:[1,0,1,""],logout_response:[1,0,1,""],response:[1,0,1,""],constants:[1,0,1,""],metadata:[1,0,1,""]},"saml2.logout_request":{OneLogin_Saml2_Logout_Request:[1,4,1,""]}},terms:{represent:1,code:1,queri:1,issuer:1,privat:1,encryptedattribut:1,base64:1,ac_smartcard:1,specif:1,send:1,binding_defl:1,must:1,sent:1,deactiv:1,sourc:1,string:1,fals:1,parse_saml_to_tim:1,util:[0,1],xmlschema:1,public_cert_file_not_found:1,get_self_url_no_queri:1,settings_file_not_found:1,list:1,onelogin_saml2_util:1,sign_metadata:1,pubic:1,sign:1,past:1,second:1,pass:1,port:1,index:0,what:1,get_name_id:1,compar:1,get_idp_data:1,sp_nq:1,current:1,delet:1,x509subjectnam:1,"new":1,status_no_pass:1,"public":1,metadata:[0,1],redirect:1,keep_local_sess:1,gener:1,windowsdomainqualifiednam:1,logout:1,path:1,valu:1,search:0,sender:1,datetim:1,cert:1,is_debug_act:1,redirect_invalid_url:1,extra:1,appli:1,modul:[0,1],metadata_sp_invalid:1,is_authent:1,unix:1,"boolean":1,onelogin_saml2_respons:1,org:1,post:1,authnstat:1,from:1,ddthh:1,nameid_persist:1,emailaddress:1,status_request:1,type:1,until:1,keydescriptor:1,attrname_format_bas:1,iso8601:1,"transient":1,get_sp_cert:1,cach:1,status_proxy_count_exceed:1,none:1,endpoint:1,redirect_to:1,uniqu:1,descriptor:1,time_valid:1,root:1,status_success:1,request_data:1,objet:1,process:1,onelogin_saml2_auth:1,unform:1,indic:0,ac_unspecifi:1,want:1,unsign:1,lxml:1,secur:1,check_statu:1,status_respond:1,write:1,verifi:1,decrypt_el:1,ns_samlp:1,ac_x509:1,x509:1,after:1,validate_xml:1,nameid_x509_subject_nam:1,callback:1,date:1,data:1,domdocu:1,footer:1,bind:1,element:1,onelogin_saml2_logout_request:1,authn_request:[0,1],nameid:1,order:1,alowed_clock_drift:1,deflate_and_base64_encod:1,process_respons:1,paramet:1,settings_invalid_syntax:1,persist:1,get_slo_url:1,"return":1,timestamp:1,auth:[0,1],authnrequest:1,get_respons:1,get_self_url:1,format_idp_cert:1,namequalifi:1,authent:1,onelogin_saml2_authn_request:1,mode:1,request_id:1,debug:1,found:1,went:1,oasi:1,authnsign:1,"static":1,rsa_sha1:1,our:1,extract:1,check_sp_cert:1,content:[0,1],validate_metadata:1,rel:1,qualifi:1,generate_name_id:1,envelop:1,given:1,base:1,get_lib_path:1,format_finger_print:1,get_session_index:1,earliest:1,get_name_id_data:1,ns_x:1,could:1,wrong:1,domel:1,ns_d:1,time_cach:1,validate_sign:1,smartcard:1,arrai:1,messag:1,attrname_format_uri:1,kerbero:1,saml_single_logout_not_support:1,differ:1,construct:1,ns_xsi:1,parse_time_to_saml:1,store:1,schema:1,option:1,sessionnotonoraft:1,rsa:1,artifact:1,wantassertionssign:1,encrypted_data:1,vouch:1,part:1,is_strict:1,holder:1,than:1,target:1,provid:1,defat:1,str:1,get_nameid:1,initi:1,argument:1,packag:[0,1],expir:1,onelogin_saml2_error:1,tabl:0,onelogin_saml2_set:1,lib:1,build_response_signatur:1,destroi:1,contact:1,build:1,soap:1,singl:1,validate_timestamp:1,decode_base64_and_infl:1,object:1,nameid_kerbero:1,logout_request:[0,1],return_to:1,"class":1,sub:1,ns_saml:1,saml_logoutrequest_invalid:1,dom:1,url:1,urn:1,nsmap:1,uri:1,determin:1,saml_response_not_found:1,add_sign:1,session:1,nameid_ent:1,onelogin_saml2_const:1,xml:1,onli:1,get_sp_kei:1,timestr:1,activ:1,set_strict:1,should:1,get_sso_url:1,dict:1,folder:1,local:1,valid_until:1,nameid_transi:1,get:1,authnrequestssign:1,sso:1,expres:1,get_nameid_data:1,requir:1,organ:1,onelogin:[0,1],binding_http_redirect:1,common:1,contain:1,xmlenc:1,view:1,respond:1,certif:1,set:[0,1],get_set:1,respons:[0,1],statu:1,ingo:1,logoutrequest:1,check_set:1,someth:1,get_organ:1,saml_logoutresponse_invalid:1,entiti:1,attribut:1,signatur:1,accord:1,kei:1,samlrespons:1,old_set:1,wsign:1,sp_format:1,delete_session_cb:1,rtype:1,get_cert_path:1,format_cert:1,audienc:1,instanc:1,get_error:1,attrnam:1,login:1,validate_num_assert:1,generate_unique_id:1,settings_invalid:1,write_temp_fil:1,status_partial_logout:1,header:1,rfc1951:1,reciev:1,empti:1,interpret:1,basic:1,nameid_email_address:1,partiallogout:1,convert:1,assert:1,get_id:1,versionmismatch:1,saml_request:1,durat:1,defin:1,calcul:1,slo:1,error:[0,1],ns_xenc:1,cm_holder_kei:1,get_attribut:1,binding_soap:1,toolkit:1,sessionindex:1,cache_dur:1,sp_certs_not_found:1,get_statu:1,status_version_mismatch:1,welcom:0,saml:1,inresponseto:1,process_slo:1,same:1,decod:1,document:[0,1],get_security_data:1,http:1,context:1,inflat:1,onelogin_saml2_logout_respons:1,rais:1,temporari:1,user:1,binding_http_artifact:1,extern:1,get_self_url_host:1,sha1:1,builder:1,relay_st:1,calculate_x509_fingerprint:1,exampl:1,thi:1,get_contact:1,protocol:1,bearer:1,execut:1,private_key_file_not_found:1,fingerprint:1,ac_kerbero:1,get_audi:1,get_sp_data:1,except:1,param:1,proxycountexceed:1,add:1,is_valid:1,xenc:1,match:1,logoutrespons:1,nameid_encrypt:1,format:1,add_x509_key_descriptor:1,cm_sender_vouch:1,get_sp_metadata:1,password:1,enc_ctx:1,name:1,like:1,success:1,xmlsoap:1,nameid_windows_domain_qualified_nam:1,page:0,yyyi:1,is_http:1,www:1,some:1,unspecifi:1,librari:1,xmldsig:1,condit:1,get_ext_lib_path:1,get_expire_tim:1,cm_bearer:1,build_request_signatur:1,logout_respons:[0,1],host:1,get_base_path:1,x509cert:1,deflat:1,idp:1,get_request:1,disabl:1,encod:1,get_issu:1,validate_url:1,samlp:1,support:1,strict:1,encript:1,includ:1,delete_local_sess:1,xpath:1,head:1,form:1,spnamequalifi:1,saml_logoutmessage_not_found:1,parse_dur:1,ac_password:1,"true":1,info:1,binding_http_post:1,get_session_not_on_or_aft:1,"default":1,ns_md:1,otherwis:1,constant:[0,1],creat:1,"int":1,request:1,decrypt:1,onelogin_saml2_metadata:1,exist:1,file:1,check:1,saml2:[0,1],encrypt:1,attrname_format_unspecifi:1,get_schemas_path:1,get_data:1,when:1,valid:1,bool:1,futur:1,saml_respons:1,argumen:1,node:1,attributestat:1,get_self_host:1,x509_cert:1,nopass:1,ns_soap:1,xmlsec:1,ignor:1,base64encod:1,time:1,custom_base_path:1,in_response_to:1},objtypes:{"0":"py:module","1":"py:attribute","2":"py:method","3":"py:staticmethod","4":"py:class","5":"py:function","6":"py:exception"},titles:["Welcome to saml2’s documentation!","OneLogin saml2 Module"],objnames:{"0":["py","module","Python module"],"1":["py","attribute","Python attribute"],"2":["py","method","Python method"],"3":["py","staticmethod","Python static method"],"4":["py","class","Python class"],"5":["py","function","Python function"],"6":["py","exception","Python exception"]},filenames:["index","saml2"]}) \ No newline at end of file +Search.setIndex({"docnames": ["index", "modules", "onelogin", "onelogin.saml2"], "filenames": ["index.rst", "modules.rst", "onelogin.rst", "onelogin.saml2.rst"], "titles": ["Welcome to SAML Python2/3 Toolkit\u2019s documentation!", "onelogin", "onelogin package", "onelogin.saml2 package"], "terms": {"onelogin": 0, "packag": [0, 1], "subpackag": [0, 1], "saml2": [0, 1, 2], "submodul": [0, 1, 2], "auth": [0, 1, 2], "modul": [0, 1], "authn_request": [0, 1, 2], "compat": [0, 1, 2], "constant": [0, 1, 2], "error": [0, 1, 2], "idp_metadata_pars": [0, 1, 2], "logout_request": [0, 1, 2], "logout_respons": [0, 1, 2], "metadata": [0, 1, 2], "respons": [0, 1, 2], "set": [0, 1, 2], "util": [0, 1, 2], "xml_templat": [0, 1, 2], "xml_util": [0, 1, 2], "xmlparser": [0, 1, 2], "content": 1, "onelogin_saml2_auth": [2, 3], "add_request_signatur": [2, 3], "add_response_signatur": [2, 3], "authn_request_class": [2, 3], "get_attribut": [2, 3], "get_error": [2, 3], "get_friendlyname_attribut": [2, 3], "get_last_assertion_id": [2, 3], "get_last_assertion_issue_inst": [2, 3], "get_last_assertion_not_on_or_aft": [2, 3], "get_last_authn_context": [2, 3], "get_last_error_reason": [2, 3], "get_last_message_id": [2, 3], "get_last_request_id": [2, 3], "get_last_request_xml": [2, 3], "get_last_response_in_response_to": [2, 3], "get_last_response_xml": [2, 3], "get_nameid": [2, 3], "get_nameid_format": [2, 3], "get_nameid_nq": [2, 3], "get_nameid_spnq": [2, 3], "get_session_expir": [2, 3], "get_session_index": [2, 3], "get_set": [2, 3], "get_slo_response_url": [2, 3], "get_slo_url": [2, 3], "get_sso_url": [2, 3], "is_authent": [2, 3], "login": [2, 3], "logout": [2, 3], "logout_request_class": [2, 3], "logout_response_class": [2, 3], "process_respons": [2, 3], "process_slo": [2, 3], "redirect_to": [2, 3], "response_class": [2, 3], "set_strict": [2, 3], "store_valid_respons": [2, 3], "validate_request_signatur": [2, 3], "validate_response_signatur": [2, 3], "onelogin_saml2_authn_request": [2, 3], "get_id": [2, 3], "get_request": [2, 3], "get_xml": [2, 3], "to_byt": [2, 3], "to_str": [2, 3], "utf8": [2, 3], "onelogin_saml2_const": [2, 3], "ac_kerbero": [2, 3], "ac_password": [2, 3], "ac_password_protect": [2, 3], "ac_smartcard": [2, 3], "ac_unspecifi": [2, 3], "ac_x509": [2, 3], "aes128_cbc": [2, 3], "aes192_cbc": [2, 3], "aes256_cbc": [2, 3], "allowed_clock_drift": [2, 3], "attrname_format_bas": [2, 3], "attrname_format_unspecifi": [2, 3], "attrname_format_uri": [2, 3], "binding_defl": [2, 3], "binding_http_artifact": [2, 3], "binding_http_post": [2, 3], "binding_http_redirect": [2, 3], "binding_soap": [2, 3], "cm_bearer": [2, 3], "cm_holder_kei": [2, 3], "cm_sender_vouch": [2, 3], "deprecated_algorithm": [2, 3], "dsa_sha1": [2, 3], "nameid_email_address": [2, 3], "nameid_encrypt": [2, 3], "nameid_ent": [2, 3], "nameid_kerbero": [2, 3], "nameid_persist": [2, 3], "nameid_transi": [2, 3], "nameid_unspecifi": [2, 3], "nameid_windows_domain_qualified_nam": [2, 3], "nameid_x509_subject_nam": [2, 3], "nsmap": [2, 3], "ns_d": [2, 3], "ns_md": [2, 3], "ns_prefix_d": [2, 3], "ns_prefix_md": [2, 3], "ns_prefix_saml": [2, 3], "ns_prefix_samlp": [2, 3], "ns_prefix_xenc": [2, 3], "ns_prefix_x": [2, 3], "ns_prefix_xsd": [2, 3], "ns_prefix_xsi": [2, 3], "ns_saml": [2, 3], "ns_samlp": [2, 3], "ns_soap": [2, 3], "ns_xenc": [2, 3], "ns_x": [2, 3], "ns_xsi": [2, 3], "rsa_1_5": [2, 3], "rsa_oaep_mgf1p": [2, 3], "rsa_sha1": [2, 3], "rsa_sha256": [2, 3], "rsa_sha384": [2, 3], "rsa_sha512": [2, 3], "sha1": [2, 3], "sha256": [2, 3], "sha384": [2, 3], "sha512": [2, 3], "status_no_pass": [2, 3], "status_partial_logout": [2, 3], "status_proxy_count_exceed": [2, 3], "status_request": [2, 3], "status_respond": [2, 3], "status_success": [2, 3], "status_version_mismatch": [2, 3], "tripledes_cbc": [2, 3], "onelogin_saml2_error": [2, 3], "cert_not_found": [2, 3], "metadata_sp_invalid": [2, 3], "private_key_file_not_found": [2, 3], "private_key_not_found": [2, 3], "public_cert_file_not_found": [2, 3], "redirect_invalid_url": [2, 3], "saml_logoutmessage_not_found": [2, 3], "saml_logoutrequest_invalid": [2, 3], "saml_logoutresponse_invalid": [2, 3], "saml_response_not_found": [2, 3], "saml_single_logout_not_support": [2, 3], "settings_file_not_found": [2, 3], "settings_invalid": [2, 3], "settings_invalid_syntax": [2, 3], "sp_certs_not_found": [2, 3], "unsupported_settings_object": [2, 3], "onelogin_saml2_validationerror": [2, 3], "assertion_expir": [2, 3], "assertion_too_earli": [2, 3], "authn_context_mismatch": [2, 3], "children_node_not_found_in_keyinfo": [2, 3], "deprecated_digest_method": [2, 3], "deprecated_signature_method": [2, 3], "duplicated_attribute_name_found": [2, 3], "duplicated_id_in_signed_el": [2, 3], "duplicated_reference_in_signed_el": [2, 3], "empty_destin": [2, 3], "empty_nameid": [2, 3], "encrypted_attribut": [2, 3], "id_not_found_in_signed_el": [2, 3], "invalid_signatur": [2, 3], "invalid_signed_el": [2, 3], "invalid_xml_format": [2, 3], "issuer_multiple_in_respons": [2, 3], "issuer_not_found_in_assert": [2, 3], "keyinfo_not_found_in_encrypted_data": [2, 3], "missing_condit": [2, 3], "missing_id": [2, 3], "missing_statu": [2, 3], "missing_status_cod": [2, 3], "no_attributestat": [2, 3], "no_encrypted_assert": [2, 3], "no_encrypted_nameid": [2, 3], "no_nameid": [2, 3], "no_signature_found": [2, 3], "no_signed_assert": [2, 3], "no_signed_messag": [2, 3], "response_expir": [2, 3], "session_expir": [2, 3], "sp_name_qualifier_name_mismatch": [2, 3], "status_code_is_not_success": [2, 3], "unexpected_signed_el": [2, 3], "unsupported_retrieval_method": [2, 3], "unsupported_saml_vers": [2, 3], "wrong_audi": [2, 3], "wrong_destin": [2, 3], "wrong_inresponseto": [2, 3], "wrong_issu": [2, 3], "wrong_number_of_assert": [2, 3], "wrong_number_of_authstat": [2, 3], "wrong_number_of_signatur": [2, 3], "wrong_number_of_signatures_in_assert": [2, 3], "wrong_number_of_signatures_in_respons": [2, 3], "wrong_signed_el": [2, 3], "wrong_subjectconfirm": [2, 3], "onelogin_saml2_idpmetadatapars": [2, 3], "get_metadata": [2, 3], "merge_set": [2, 3], "pars": [2, 3], "parse_remot": [2, 3], "dict_deep_merg": [2, 3], "onelogin_saml2_logout_request": [2, 3], "get_issu": [2, 3], "get_nameid_data": [2, 3], "is_valid": [2, 3], "onelogin_saml2_logout_respons": [2, 3], "build": [2, 3], "get_in_response_to": [2, 3], "get_respons": [2, 3], "get_statu": [2, 3], "onelogin_saml2_metadata": [2, 3], "time_cach": [2, 3], "time_valid": [2, 3], "add_x509_key_descriptor": [2, 3], "builder": [2, 3], "sign_metadata": [2, 3], "onelogin_saml2_respons": [2, 3], "check_one_authnstat": [2, 3], "check_one_condit": [2, 3], "check_statu": [2, 3], "get_assertion_id": [2, 3], "get_assertion_issue_inst": [2, 3], "get_assertion_not_on_or_aft": [2, 3], "get_audi": [2, 3], "get_authn_context": [2, 3], "get_session_not_on_or_aft": [2, 3], "get_xml_docu": [2, 3], "process_signed_el": [2, 3], "validate_num_assert": [2, 3], "validate_signed_el": [2, 3], "validate_timestamp": [2, 3], "onelogin_saml2_set": [2, 3], "check_idp_set": [2, 3], "check_set": [2, 3], "check_sp_cert": [2, 3], "check_sp_set": [2, 3], "format_idp_cert": [2, 3], "format_idp_cert_multi": [2, 3], "format_sp_cert": [2, 3], "format_sp_cert_new": [2, 3], "format_sp_kei": [2, 3], "get_base_path": [2, 3], "get_cert_path": [2, 3], "get_contact": [2, 3], "get_idp_cert": [2, 3], "get_idp_data": [2, 3], "get_idp_slo_response_url": [2, 3], "get_idp_slo_url": [2, 3], "get_idp_sso_url": [2, 3], "get_lib_path": [2, 3], "get_organ": [2, 3], "get_schemas_path": [2, 3], "get_security_data": [2, 3], "get_sp_cert": [2, 3], "get_sp_cert_new": [2, 3], "get_sp_data": [2, 3], "get_sp_kei": [2, 3], "get_sp_metadata": [2, 3], "is_debug_act": [2, 3], "is_strict": [2, 3], "metadata_class": [2, 3], "set_cert_path": [2, 3], "validate_metadata": [2, 3], "validate_url": [2, 3], "onelogin_saml2_util": [2, 3], "assertion_signature_xpath": [2, 3], "response_signature_xpath": [2, 3], "time_format": [2, 3], "time_format_2": [2, 3], "time_format_with_frag": [2, 3], "add_sign": [2, 3], "b64decod": [2, 3], "b64encod": [2, 3], "calculate_x509_fingerprint": [2, 3], "decode_base64_and_infl": [2, 3], "decrypt_el": [2, 3], "deflate_and_base64_encod": [2, 3], "delete_local_sess": [2, 3], "escape_url": [2, 3], "format_cert": [2, 3], "format_finger_print": [2, 3], "format_private_kei": [2, 3], "generate_name_id": [2, 3], "generate_unique_id": [2, 3], "get_expire_tim": [2, 3], "get_self_host": [2, 3], "get_self_routed_url_no_queri": [2, 3], "get_self_url": [2, 3], "get_self_url_host": [2, 3], "get_self_url_no_queri": [2, 3], "is_http": [2, 3], "normalize_url": [2, 3], "now": [2, 3], "parse_saml_to_tim": [2, 3], "parse_dur": [2, 3], "parse_time_to_saml": [2, 3], "redirect": [2, 3], "sign_binari": [2, 3], "validate_binary_sign": [2, 3], "validate_metadata_sign": [2, 3], "validate_node_sign": [2, 3], "validate_sign": [2, 3], "return_false_on_except": [2, 3], "onelogin_saml2_templ": [2, 3], "attribut": [2, 3], "md_attr_consumer_servic": [2, 3], "md_contact_person": [2, 3], "md_entity_descriptor": [2, 3], "md_organis": [2, 3], "md_requested_attribut": [2, 3], "md_sl": [2, 3], "onelogin_saml2_xml": [2, 3], "cleanup_namespac": [2, 3], "dump": [2, 3], "element_text": [2, 3], "extract_tag_text": [2, 3], "make_child": [2, 3], "make_root": [2, 3], "queri": [2, 3], "to_etre": [2, 3], "validate_xml": [2, 3], "dtdforbidden": [2, 3], "entitiesforbidden": [2, 3], "globalparsertl": [2, 3], "createdefaultpars": [2, 3], "element_class": [2, 3], "getdefaultpars": [2, 3], "parser_config": [2, 3], "setdefaultpars": [2, 3], "notsupportederror": [2, 3], "restrictedel": [2, 3], "blacklist": [2, 3], "getchildren": [2, 3], "getiter": [2, 3], "iter": [2, 3], "iterchildren": [2, 3], "iterdescend": [2, 3], "iters": [2, 3], "xml": [2, 3], "check_docinfo": [2, 3], "fromstr": [2, 3], "iterpars": [2, 3], "add": [2, 3], "saml": [2, 3], "support": [2, 3], "your": [2, 3], "python": [2, 3], "softwar": [2, 3], "us": [2, 3], "thi": [2, 3], "librari": [2, 3], "toolkit": [2, 3], "let": [2, 3], "you": [2, 3], "sp": [2, 3], "servic": [2, 3], "provid": [2, 3], "over": [2, 3], "applic": [2, 3], "connect": [2, 3], "ani": [2, 3], "idp": [2, 3], "ident": [2, 3], "sso": [2, 3], "slo": [2, 3], "initi": [2, 3], "assert": [2, 3], "nameid": [2, 3], "encrypt": [2, 3], "signatur": [2, 3], "messag": [2, 3], "authnrequest": [2, 3], "logoutrequest": [2, 3], "logoutrespons": [2, 3], "enabl": [2, 3], "an": [2, 3], "consum": [2, 3], "endpoint": [2, 3], "singl": [2, 3], "publish": [2, 3], "which": [2, 3], "can": [2, 3], "sign": [2, 3], "class": 3, "main": 3, "instanc": 3, "request_data": 3, "old_set": 3, "none": 3, "custom_base_path": 3, "sourc": 3, "base": 3, "object": 3, "implement": 3, "defin": 3, "method": 3, "invok": 3, "order": 3, "process": 3, "request": 3, "sign_algorithm": 3, "http": 3, "www": 3, "w3": 3, "org": 3, "2001": 3, "04": 3, "xmldsig": 3, "more": 3, "rsa": 3, "paramet": 3, "dict": 3, "The": 3, "string": 3, "algorithm": 3, "response_data": 3, "param": 3, "type": 3, "alia": 3, "name": 3, "return": 3, "valu": 3, "": 3, "exist": 3, "list": 3, "code": 3, "someth": 3, "went": 3, "wrong": 3, "friendlynam": 3, "search": 3, "index": 3, "fiendlynam": 3, "id": 3, "last": 3, "issueinst": 3, "unix": 3, "posix": 3, "timestamp": 3, "notonoraft": 3, "valid": 3, "subjectconfirmationdata": 3, "node": 3, "authent": 3, "context": 3, "sent": 3, "reason": 3, "gener": 3, "retriev": 3, "raw": 3, "rtype": 3, "inresponseto": 3, "i": 3, "present": 3, "pretty_print_if_poss": 3, "fals": 3, "decrypt": 3, "format": 3, "namequalifi": 3, "sessionnotonoraft": 3, "from": 3, "authnstat": 3, "sessionindex": 3, "info": 3, "get": 3, "url": 3, "check": 3, "user": 3, "true": 3, "bool": 3, "return_to": 3, "force_authn": 3, "is_pass": 3, "set_nameid_polici": 3, "name_id_value_req": 3, "option": 3, "argument": 3, "target": 3, "should": 3, "after": 3, "when": 3, "forceauthn": 3, "ispass": 3, "nameidpolici": 3, "element": 3, "indic": 3, "subject": 3, "name_id": 3, "session_index": 3, "nq": 3, "name_id_format": 3, "spnq": 3, "identifi": 3, "session": 3, "qualifi": 3, "request_id": 3, "rais": 3, "post": 3, "samlrespons": 3, "found": 3, "keep_local_sess": 3, "delete_session_cb": 3, "destroi": 3, "local": 3, "otherwis": 3, "pass": 3, "we": 3, "our": 3, "extra": 3, "part": 3, "strict": 3, "mode": 3, "activ": 3, "disabl": 3, "data": 3, "handl": 3, "It": 3, "deflat": 3, "unsign": 3, "make": 3, "mayb": 3, "base64": 3, "encod": 3, "str": 3, "bodi": 3, "py3": 3, "byte": 3, "convert": 3, "all": 3, "urn": 3, "oasi": 3, "tc": 3, "2": 3, "0": 3, "ac": 3, "kerbero": 3, "password": 3, "passwordprotectedtransport": 3, "smartcard": 3, "unspecifi": 3, "x509": 3, "xmlenc": 3, "aes128": 3, "cbc": 3, "aes192": 3, "aes256": 3, "300": 3, "attrnam": 3, "basic": 3, "uri": 3, "bind": 3, "artifact": 3, "soap": 3, "cm": 3, "bearer": 3, "holder": 3, "kei": 3, "sender": 3, "vouch": 3, "2000": 3, "09": 3, "dsa": 3, "1": 3, "emailaddress": 3, "entiti": 3, "persist": 3, "transient": 3, "windowsdomainqualifiednam": 3, "x509subjectnam": 3, "d": 3, "md": 3, "samlp": 3, "protocol": 3, "xenc": 3, "x": 3, "xsd": 3, "xsi": 3, "schema": 3, "xmlsoap": 3, "envelop": 3, "xmlschema": 3, "1_5": 3, "oaep": 3, "mgf1p": 3, "statu": 3, "nopass": 3, "partiallogout": 3, "proxycountexceed": 3, "respond": 3, "success": 3, "versionmismatch": 3, "tripled": 3, "common": 3, "ha": 3, "custom": 3, "initializ": 3, "except": 3, "handler": 3, "4": 3, "3": 3, "7": 3, "13": 3, "6": 3, "5": 3, "9": 3, "10": 3, "11": 3, "8": 3, "12": 3, "14": 3, "anoth": 3, "relat": 3, "happen": 3, "dure": 3, "20": 3, "19": 3, "45": 3, "36": 3, "47": 3, "46": 3, "41": 3, "25": 3, "39": 3, "23": 3, "42": 3, "27": 3, "28": 3, "35": 3, "18": 3, "22": 3, "16": 3, "17": 3, "38": 3, "34": 3, "33": 3, "32": 3, "44": 3, "30": 3, "40": 3, "37": 3, "26": 3, "24": 3, "15": 3, "29": 3, "21": 3, "43": 3, "31": 3, "A": 3, "contain": 3, "obtain": 3, "doe": 3, "wai": 3, "introduc": 3, "sure": 3, "properli": 3, "befor": 3, "classmethod": 3, "validate_cert": 3, "timeout": 3, "header": 3, "where": 3, "If": 3, "flag": 3, "verif": 3, "associ": 3, "certif": 3, "int": 3, "second": 3, "wait": 3, "send": 3, "static": 3, "new_metadata_set": 3, "Will": 3, "updat": 3, "new": 3, "extract": 3, "current": 3, "merg": 3, "idp_metadata": 3, "required_sso_bind": 3, "required_slo_bind": 3, "entity_id": 3, "ar": 3, "multipl": 3, "idpssodescriptor": 3, "tag": 3, "onli": 3, "first": 3, "those": 3, "same": 3, "given": 3, "specifi": 3, "requir": 3, "hold": 3, "one": 3, "entitydescriptor": 3, "want": 3, "kwarg": 3, "b": 3, "path": 3, "deep": 3, "dictionari": 3, "kudo": 3, "stackoverflow": 3, "com": 3, "7205107": 3, "145400": 3, "execut": 3, "fail": 3, "caus": 3, "domdocu": 3, "issuer": 3, "spnamequalifi": 3, "base64encod": 3, "wa": 3, "receiv": 3, "raise_except": 3, "boolean": 3, "whether": 3, "failur": 3, "in_response_to": 3, "creat": 3, "determin": 3, "oneloginsaml2metadata": 3, "604800": 3, "172800": 3, "cert": 3, "add_encrypt": 3, "descriptor": 3, "keydescriptor": 3, "ad": 3, "authnsign": 3, "wsign": 3, "valid_until": 3, "cache_dur": 3, "contact": 3, "organ": 3, "authnrequestssign": 3, "wantassertionssign": 3, "datetim": 3, "expiri": 3, "date": 3, "durat": 3, "cach": 3, "digest_algorithm": 3, "digest": 3, "uniqu": 3, "condit": 3, "attributestat": 3, "encryptedattribut": 3, "audienc": 3, "could": 3, "store": 3, "futur": 3, "what": 3, "specif": 3, "must": 3, "delet": 3, "expir": 3, "time": 3, "document": 3, "verifi": 3, "refer": 3, "consist": 3, "signed_el": 3, "expect": 3, "accord": 3, "copyright": 3, "c": 3, "2010": 3, "2021": 3, "inc": 3, "mit": 3, "licens": 3, "sp_validation_onli": 3, "multpl": 3, "privat": 3, "folder": 3, "arrai": 3, "empti": 3, "ok": 3, "public": 3, "lib": 3, "secur": 3, "plan": 3, "soon": 3, "instead": 3, "other": 3, "represent": 3, "debug": 3, "deactiv": 3, "allow_single_label_domain": 3, "auxiliari": 3, "urllib": 3, "In": 3, "allow": 3, "label": 3, "domain": 3, "sever": 3, "y": 3, "m": 3, "dt": 3, "h": 3, "sz": 3, "fz": 3, "re": 3, "compil": 3, "t": 3, "z": 3, "xmlsec": 3, "decod": 3, "x509_cert": 3, "alg": 3, "calcul": 3, "fingerprint": 3, "x509cert": 3, "ignore_zip": 3, "inflat": 3, "rfc1951": 3, "ignor": 3, "zip": 3, "encrypted_data": 3, "inplac": 3, "result": 3, "lxml": 3, "etre": 3, "domel": 3, "basestr": 3, "callback": 3, "lowercase_urlencod": 3, "escap": 3, "non": 3, "safe": 3, "symbol": 3, "adf": 3, "quote_plu": 3, "produc": 3, "lower": 3, "case": 3, "hex": 3, "number": 3, "upper": 3, "lowercas": 3, "head": 3, "footer": 3, "unformat": 3, "includ": 3, "sp_nq": 3, "sp_format": 3, "exampl": 3, "compar": 3, "earliest": 3, "until": 3, "host": 3, "mai": 3, "port": 3, "rout": 3, "view": 3, "differ": 3, "than": 3, "dom": 3, "normal": 3, "comparison": 3, "netloc": 3, "insensit": 3, "per": 3, "rfc": 3, "4343": 3, "7617": 3, "standard": 3, "origin": 3, "split": 3, "also": 3, "field": 3, "actual": 3, "timestr": 3, "form": 3, "yyyi": 3, "mm": 3, "ddthh": 3, "ss": 3, "sub": 3, "interpret": 3, "iso8601": 3, "rel": 3, "appli": 3, "default": 3, "msg": 3, "__transform": 3, "binari": 3, "signed_queri": 3, "fingerprintalg": 3, "validatecert": 3, "signature_nod": 3, "elem": 3, "xpath": 3, "multicert": 3, "func": 3, "decor": 3, "function": 3, "suppress": 3, "overridden": 3, "keyword": 3, "call": 3, "wrap": 3, "n": 3, "nameformat": 3, "attributevalu": 3, "xmln": 3, "version": 3, "provider_nam": 3, "force_authn_str": 3, "is_passive_str": 3, "issue_inst": 3, "destin": 3, "protocolbind": 3, "acs_bind": 3, "assertionconsumerserviceurl": 3, "assertion_url": 3, "attr_consuming_service_str": 3, "subject_str": 3, "nameid_policy_str": 3, "requested_authn_context_str": 3, "single_logout_url": 3, "statuscod": 3, "attributeconsumingservic": 3, "servicenam": 3, "lang": 3, "en": 3, "service_nam": 3, "attr_cs_desc": 3, "requested_attribute_str": 3, "contactperson": 3, "contacttyp": 3, "givennam": 3, "email": 3, "entityid": 3, "spssodescriptor": 3, "protocolsupportenumer": 3, "sl": 3, "nameidformat": 3, "assertionconsumerservic": 3, "locat": 3, "attribute_consuming_servic": 3, "organizationnam": 3, "organizationdisplaynam": 3, "display_nam": 3, "organizationurl": 3, "requestedattribut": 3, "req_attr_nam": 3, "req_attr_nameformat_str": 3, "req_attr_isrequired_str": 3, "req_attr_aux_str": 3, "singlelogoutservic": 3, "assertion_id": 3, "name_id_polici": 3, "subjectconfirm": 3, "not_aft": 3, "recipi": 3, "notbefor": 3, "not_befor": 3, "audiencerestrict": 3, "authninst": 3, "authn_context": 3, "tree_or_el": 3, "top_nsmap": 3, "keep_ns_prefix": 3, "keep": 3, "namespac": 3, "intact": 3, "tree": 3, "map": 3, "prefix": 3, "remov": 3, "cleanup": 3, "pretty_print": 3, "with_tail": 3, "write": 3, "structur": 3, "sy": 3, "stdout": 3, "tagnam": 3, "_parent": 3, "_tag": 3, "attrib": 3, "_extra": 3, "subel": 3, "factori": 3, "append": 3, "interfac": 3, "look": 3, "_element": 3, "makeel": 3, "_basepars": 3, "faster": 3, "within": 3, "parser": 3, "tagid": 3, "match": 3, "root": 3, "objet": 3, "expres": 3, "fragment": 3, "minidom": 3, "_element_class": 3, "serial": 3, "its": 3, "against": 3, "show": 3, "protect": 3, "sysid": 3, "pubid": 3, "valueerror": 3, "definit": 3, "forbidden": 3, "notation_nam": 3, "_local": 3, "thread": 3, "huge_tre": 3, "no_network": 3, "remove_com": 3, "remove_pi": 3, "resolve_ent": 3, "oper": 3, "elementbas": 3, "restrict": 3, "filter": 3, "out": 3, "some": 3, "_entiti": 3, "_processinginstruct": 3, "_comment": 3, "self": 3, "direct": 3, "children": 3, "deprec": 3, "note": 3, "been": 3, "elementtre": 3, "simpli": 3, "sequenc": 3, "subtre": 3, "depth": 3, "pre": 3, "start": 3, "find": 3, "see": 3, "diverg": 3, "behaviour": 3, "effici": 3, "backward": 3, "older": 3, "localnam": 3, "either": 3, "both": 3, "wildcard": 3, "equival": 3, "e": 3, "comment": 3, "processinginstruct": 3, "revers": 3, "As": 3, "oppos": 3, "descend": 3, "el": 3, "yield": 3, "itself": 3, "preced": 3, "follow": 3, "sibl": 3, "forward": 3, "right": 3, "go": 3, "text": 3, "base_url": 3, "forbid_dtd": 3, "forbid_ent": 3, "docinfo": 3, "dtd": 3, "declar": 3, "need": 3, "newer": 3, "iterent": 3, "arg": 3}, "objects": {"": [[2, 0, 0, "-", "onelogin"]], "onelogin": [[3, 0, 0, "-", "saml2"]], "onelogin.saml2": [[3, 0, 0, "-", "auth"], [3, 0, 0, "-", "authn_request"], [3, 0, 0, "-", "compat"], [3, 0, 0, "-", "constants"], [3, 0, 0, "-", "errors"], [3, 0, 0, "-", "idp_metadata_parser"], [3, 0, 0, "-", "logout_request"], [3, 0, 0, "-", "logout_response"], [3, 0, 0, "-", "metadata"], [3, 0, 0, "-", "response"], [3, 0, 0, "-", "settings"], [3, 0, 0, "-", "utils"], [3, 0, 0, "-", "xml_templates"], [3, 0, 0, "-", "xml_utils"], [3, 0, 0, "-", "xmlparser"]], "onelogin.saml2.auth": [[3, 1, 1, "", "OneLogin_Saml2_Auth"]], "onelogin.saml2.auth.OneLogin_Saml2_Auth": [[3, 2, 1, "", "add_request_signature"], [3, 2, 1, "", "add_response_signature"], [3, 3, 1, "", "authn_request_class"], [3, 2, 1, "", "get_attribute"], [3, 2, 1, "", "get_attributes"], [3, 2, 1, "", "get_errors"], [3, 2, 1, "", "get_friendlyname_attribute"], [3, 2, 1, "", "get_friendlyname_attributes"], [3, 2, 1, "", "get_last_assertion_id"], [3, 2, 1, "", "get_last_assertion_issue_instant"], [3, 2, 1, "", "get_last_assertion_not_on_or_after"], [3, 2, 1, "", "get_last_authn_contexts"], [3, 2, 1, "", "get_last_error_reason"], [3, 2, 1, "", "get_last_message_id"], [3, 2, 1, "", "get_last_request_id"], [3, 2, 1, "", "get_last_request_xml"], [3, 2, 1, "", "get_last_response_in_response_to"], [3, 2, 1, "", "get_last_response_xml"], [3, 2, 1, "", "get_nameid"], [3, 2, 1, "", "get_nameid_format"], [3, 2, 1, "", "get_nameid_nq"], [3, 2, 1, "", "get_nameid_spnq"], [3, 2, 1, "", "get_session_expiration"], [3, 2, 1, "", "get_session_index"], [3, 2, 1, "", "get_settings"], [3, 2, 1, "", "get_slo_response_url"], [3, 2, 1, "", "get_slo_url"], [3, 2, 1, "", "get_sso_url"], [3, 2, 1, "", "is_authenticated"], [3, 2, 1, "", "login"], [3, 2, 1, "", "logout"], [3, 3, 1, "", "logout_request_class"], [3, 3, 1, "", "logout_response_class"], [3, 2, 1, "", "process_response"], [3, 2, 1, "", "process_slo"], [3, 2, 1, "", "redirect_to"], [3, 3, 1, "", "response_class"], [3, 2, 1, "", "set_strict"], [3, 2, 1, "", "store_valid_response"], [3, 2, 1, "", "validate_request_signature"], [3, 2, 1, "", "validate_response_signature"]], "onelogin.saml2.authn_request": [[3, 1, 1, "", "OneLogin_Saml2_Authn_Request"]], "onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request": [[3, 2, 1, "", "get_id"], [3, 2, 1, "", "get_request"], [3, 2, 1, "", "get_xml"]], "onelogin.saml2.compat": [[3, 4, 1, "", "to_bytes"], [3, 4, 1, "", "to_string"], [3, 4, 1, "", "utf8"]], "onelogin.saml2.constants": [[3, 1, 1, "", "OneLogin_Saml2_Constants"]], "onelogin.saml2.constants.OneLogin_Saml2_Constants": [[3, 3, 1, "", "AC_KERBEROS"], [3, 3, 1, "", "AC_PASSWORD"], [3, 3, 1, "", "AC_PASSWORD_PROTECTED"], [3, 3, 1, "", "AC_SMARTCARD"], [3, 3, 1, "", "AC_UNSPECIFIED"], [3, 3, 1, "", "AC_X509"], [3, 3, 1, "", "AES128_CBC"], [3, 3, 1, "", "AES192_CBC"], [3, 3, 1, "", "AES256_CBC"], [3, 3, 1, "", "ALLOWED_CLOCK_DRIFT"], [3, 3, 1, "", "ATTRNAME_FORMAT_BASIC"], [3, 3, 1, "", "ATTRNAME_FORMAT_UNSPECIFIED"], [3, 3, 1, "", "ATTRNAME_FORMAT_URI"], [3, 3, 1, "", "BINDING_DEFLATE"], [3, 3, 1, "", "BINDING_HTTP_ARTIFACT"], [3, 3, 1, "", "BINDING_HTTP_POST"], [3, 3, 1, "", "BINDING_HTTP_REDIRECT"], [3, 3, 1, "", "BINDING_SOAP"], [3, 3, 1, "", "CM_BEARER"], [3, 3, 1, "", "CM_HOLDER_KEY"], [3, 3, 1, "", "CM_SENDER_VOUCHES"], [3, 3, 1, "", "DEPRECATED_ALGORITHMS"], [3, 3, 1, "", "DSA_SHA1"], [3, 3, 1, "", "NAMEID_EMAIL_ADDRESS"], [3, 3, 1, "", "NAMEID_ENCRYPTED"], [3, 3, 1, "", "NAMEID_ENTITY"], [3, 3, 1, "", "NAMEID_KERBEROS"], [3, 3, 1, "", "NAMEID_PERSISTENT"], [3, 3, 1, "", "NAMEID_TRANSIENT"], [3, 3, 1, "", "NAMEID_UNSPECIFIED"], [3, 3, 1, "", "NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME"], [3, 3, 1, "", "NAMEID_X509_SUBJECT_NAME"], [3, 3, 1, "", "NSMAP"], [3, 3, 1, "", "NS_DS"], [3, 3, 1, "", "NS_MD"], [3, 3, 1, "", "NS_PREFIX_DS"], [3, 3, 1, "", "NS_PREFIX_MD"], [3, 3, 1, "", "NS_PREFIX_SAML"], [3, 3, 1, "", "NS_PREFIX_SAMLP"], [3, 3, 1, "", "NS_PREFIX_XENC"], [3, 3, 1, "", "NS_PREFIX_XS"], [3, 3, 1, "", "NS_PREFIX_XSD"], [3, 3, 1, "", "NS_PREFIX_XSI"], [3, 3, 1, "", "NS_SAML"], [3, 3, 1, "", "NS_SAMLP"], [3, 3, 1, "", "NS_SOAP"], [3, 3, 1, "", "NS_XENC"], [3, 3, 1, "", "NS_XS"], [3, 3, 1, "", "NS_XSI"], [3, 3, 1, "", "RSA_1_5"], [3, 3, 1, "", "RSA_OAEP_MGF1P"], [3, 3, 1, "", "RSA_SHA1"], [3, 3, 1, "", "RSA_SHA256"], [3, 3, 1, "", "RSA_SHA384"], [3, 3, 1, "", "RSA_SHA512"], [3, 3, 1, "", "SHA1"], [3, 3, 1, "", "SHA256"], [3, 3, 1, "", "SHA384"], [3, 3, 1, "", "SHA512"], [3, 3, 1, "", "STATUS_NO_PASSIVE"], [3, 3, 1, "", "STATUS_PARTIAL_LOGOUT"], [3, 3, 1, "", "STATUS_PROXY_COUNT_EXCEEDED"], [3, 3, 1, "", "STATUS_REQUESTER"], [3, 3, 1, "", "STATUS_RESPONDER"], [3, 3, 1, "", "STATUS_SUCCESS"], [3, 3, 1, "", "STATUS_VERSION_MISMATCH"], [3, 3, 1, "", "TRIPLEDES_CBC"]], "onelogin.saml2.errors": [[3, 5, 1, "", "OneLogin_Saml2_Error"], [3, 5, 1, "", "OneLogin_Saml2_ValidationError"]], "onelogin.saml2.errors.OneLogin_Saml2_Error": [[3, 3, 1, "", "CERT_NOT_FOUND"], [3, 3, 1, "", "METADATA_SP_INVALID"], [3, 3, 1, "", "PRIVATE_KEY_FILE_NOT_FOUND"], [3, 3, 1, "", "PRIVATE_KEY_NOT_FOUND"], [3, 3, 1, "", "PUBLIC_CERT_FILE_NOT_FOUND"], [3, 3, 1, "", "REDIRECT_INVALID_URL"], [3, 3, 1, "", "SAML_LOGOUTMESSAGE_NOT_FOUND"], [3, 3, 1, "", "SAML_LOGOUTREQUEST_INVALID"], [3, 3, 1, "", "SAML_LOGOUTRESPONSE_INVALID"], [3, 3, 1, "", "SAML_RESPONSE_NOT_FOUND"], [3, 3, 1, "", "SAML_SINGLE_LOGOUT_NOT_SUPPORTED"], [3, 3, 1, "", "SETTINGS_FILE_NOT_FOUND"], [3, 3, 1, "", "SETTINGS_INVALID"], [3, 3, 1, "", "SETTINGS_INVALID_SYNTAX"], [3, 3, 1, "", "SP_CERTS_NOT_FOUND"], [3, 3, 1, "", "UNSUPPORTED_SETTINGS_OBJECT"]], "onelogin.saml2.errors.OneLogin_Saml2_ValidationError": [[3, 3, 1, "", "ASSERTION_EXPIRED"], [3, 3, 1, "", "ASSERTION_TOO_EARLY"], [3, 3, 1, "", "AUTHN_CONTEXT_MISMATCH"], [3, 3, 1, "", "CHILDREN_NODE_NOT_FOUND_IN_KEYINFO"], [3, 3, 1, "", "DEPRECATED_DIGEST_METHOD"], [3, 3, 1, "", "DEPRECATED_SIGNATURE_METHOD"], [3, 3, 1, "", "DUPLICATED_ATTRIBUTE_NAME_FOUND"], [3, 3, 1, "", "DUPLICATED_ID_IN_SIGNED_ELEMENTS"], [3, 3, 1, "", "DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS"], [3, 3, 1, "", "EMPTY_DESTINATION"], [3, 3, 1, "", "EMPTY_NAMEID"], [3, 3, 1, "", "ENCRYPTED_ATTRIBUTES"], [3, 3, 1, "", "ID_NOT_FOUND_IN_SIGNED_ELEMENT"], [3, 3, 1, "", "INVALID_SIGNATURE"], [3, 3, 1, "", "INVALID_SIGNED_ELEMENT"], [3, 3, 1, "", "INVALID_XML_FORMAT"], [3, 3, 1, "", "ISSUER_MULTIPLE_IN_RESPONSE"], [3, 3, 1, "", "ISSUER_NOT_FOUND_IN_ASSERTION"], [3, 3, 1, "", "KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA"], [3, 3, 1, "", "MISSING_CONDITIONS"], [3, 3, 1, "", "MISSING_ID"], [3, 3, 1, "", "MISSING_STATUS"], [3, 3, 1, "", "MISSING_STATUS_CODE"], [3, 3, 1, "", "NO_ATTRIBUTESTATEMENT"], [3, 3, 1, "", "NO_ENCRYPTED_ASSERTION"], [3, 3, 1, "", "NO_ENCRYPTED_NAMEID"], [3, 3, 1, "", "NO_NAMEID"], [3, 3, 1, "", "NO_SIGNATURE_FOUND"], [3, 3, 1, "", "NO_SIGNED_ASSERTION"], [3, 3, 1, "", "NO_SIGNED_MESSAGE"], [3, 3, 1, "", "RESPONSE_EXPIRED"], [3, 3, 1, "", "SESSION_EXPIRED"], [3, 3, 1, "", "SP_NAME_QUALIFIER_NAME_MISMATCH"], [3, 3, 1, "", "STATUS_CODE_IS_NOT_SUCCESS"], [3, 3, 1, "", "UNEXPECTED_SIGNED_ELEMENTS"], [3, 3, 1, "", "UNSUPPORTED_RETRIEVAL_METHOD"], [3, 3, 1, "", "UNSUPPORTED_SAML_VERSION"], [3, 3, 1, "", "WRONG_AUDIENCE"], [3, 3, 1, "", "WRONG_DESTINATION"], [3, 3, 1, "", "WRONG_INRESPONSETO"], [3, 3, 1, "", "WRONG_ISSUER"], [3, 3, 1, "", "WRONG_NUMBER_OF_ASSERTIONS"], [3, 3, 1, "", "WRONG_NUMBER_OF_AUTHSTATEMENTS"], [3, 3, 1, "", "WRONG_NUMBER_OF_SIGNATURES"], [3, 3, 1, "", "WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION"], [3, 3, 1, "", "WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE"], [3, 3, 1, "", "WRONG_SIGNED_ELEMENT"], [3, 3, 1, "", "WRONG_SUBJECTCONFIRMATION"]], "onelogin.saml2.idp_metadata_parser": [[3, 1, 1, "", "OneLogin_Saml2_IdPMetadataParser"], [3, 4, 1, "", "dict_deep_merge"]], "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser": [[3, 2, 1, "", "get_metadata"], [3, 2, 1, "", "merge_settings"], [3, 2, 1, "", "parse"], [3, 2, 1, "", "parse_remote"]], "onelogin.saml2.logout_request": [[3, 1, 1, "", "OneLogin_Saml2_Logout_Request"]], "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request": [[3, 2, 1, "", "get_error"], [3, 2, 1, "", "get_id"], [3, 2, 1, "", "get_issuer"], [3, 2, 1, "", "get_nameid"], [3, 2, 1, "", "get_nameid_data"], [3, 2, 1, "", "get_nameid_format"], [3, 2, 1, "", "get_request"], [3, 2, 1, "", "get_session_indexes"], [3, 2, 1, "", "get_xml"], [3, 2, 1, "", "is_valid"]], "onelogin.saml2.logout_response": [[3, 1, 1, "", "OneLogin_Saml2_Logout_Response"]], "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response": [[3, 2, 1, "", "build"], [3, 2, 1, "", "get_error"], [3, 2, 1, "", "get_in_response_to"], [3, 2, 1, "", "get_issuer"], [3, 2, 1, "", "get_response"], [3, 2, 1, "", "get_status"], [3, 2, 1, "", "get_xml"], [3, 2, 1, "", "is_valid"]], "onelogin.saml2.metadata": [[3, 1, 1, "", "OneLogin_Saml2_Metadata"]], "onelogin.saml2.metadata.OneLogin_Saml2_Metadata": [[3, 3, 1, "", "TIME_CACHED"], [3, 3, 1, "", "TIME_VALID"], [3, 2, 1, "", "add_x509_key_descriptors"], [3, 2, 1, "", "builder"], [3, 2, 1, "", "sign_metadata"]], "onelogin.saml2.response": [[3, 1, 1, "", "OneLogin_Saml2_Response"]], "onelogin.saml2.response.OneLogin_Saml2_Response": [[3, 2, 1, "", "check_one_authnstatement"], [3, 2, 1, "", "check_one_condition"], [3, 2, 1, "", "check_status"], [3, 2, 1, "", "get_assertion_id"], [3, 2, 1, "", "get_assertion_issue_instant"], [3, 2, 1, "", "get_assertion_not_on_or_after"], [3, 2, 1, "", "get_attributes"], [3, 2, 1, "", "get_audiences"], [3, 2, 1, "", "get_authn_contexts"], [3, 2, 1, "", "get_error"], [3, 2, 1, "", "get_friendlyname_attributes"], [3, 2, 1, "", "get_id"], [3, 2, 1, "", "get_in_response_to"], [3, 2, 1, "", "get_issuers"], [3, 2, 1, "", "get_nameid"], [3, 2, 1, "", "get_nameid_data"], [3, 2, 1, "", "get_nameid_format"], [3, 2, 1, "", "get_nameid_nq"], [3, 2, 1, "", "get_nameid_spnq"], [3, 2, 1, "", "get_session_index"], [3, 2, 1, "", "get_session_not_on_or_after"], [3, 2, 1, "", "get_xml_document"], [3, 2, 1, "", "is_valid"], [3, 2, 1, "", "process_signed_elements"], [3, 2, 1, "", "validate_num_assertions"], [3, 2, 1, "", "validate_signed_elements"], [3, 2, 1, "", "validate_timestamps"]], "onelogin.saml2.settings": [[3, 1, 1, "", "OneLogin_Saml2_Settings"], [3, 4, 1, "", "validate_url"]], "onelogin.saml2.settings.OneLogin_Saml2_Settings": [[3, 2, 1, "", "check_idp_settings"], [3, 2, 1, "", "check_settings"], [3, 2, 1, "", "check_sp_certs"], [3, 2, 1, "", "check_sp_settings"], [3, 2, 1, "", "format_idp_cert"], [3, 2, 1, "", "format_idp_cert_multi"], [3, 2, 1, "", "format_sp_cert"], [3, 2, 1, "", "format_sp_cert_new"], [3, 2, 1, "", "format_sp_key"], [3, 2, 1, "", "get_base_path"], [3, 2, 1, "", "get_cert_path"], [3, 2, 1, "", "get_contacts"], [3, 2, 1, "", "get_errors"], [3, 2, 1, "", "get_idp_cert"], [3, 2, 1, "", "get_idp_data"], [3, 2, 1, "", "get_idp_slo_response_url"], [3, 2, 1, "", "get_idp_slo_url"], [3, 2, 1, "", "get_idp_sso_url"], [3, 2, 1, "", "get_lib_path"], [3, 2, 1, "", "get_organization"], [3, 2, 1, "", "get_schemas_path"], [3, 2, 1, "", "get_security_data"], [3, 2, 1, "", "get_sp_cert"], [3, 2, 1, "", "get_sp_cert_new"], [3, 2, 1, "", "get_sp_data"], [3, 2, 1, "", "get_sp_key"], [3, 2, 1, "", "get_sp_metadata"], [3, 2, 1, "", "is_debug_active"], [3, 2, 1, "", "is_strict"], [3, 3, 1, "", "metadata_class"], [3, 2, 1, "", "set_cert_path"], [3, 2, 1, "", "set_strict"], [3, 2, 1, "", "validate_metadata"]], "onelogin.saml2.utils": [[3, 1, 1, "", "OneLogin_Saml2_Utils"], [3, 4, 1, "", "return_false_on_exception"]], "onelogin.saml2.utils.OneLogin_Saml2_Utils": [[3, 3, 1, "", "ASSERTION_SIGNATURE_XPATH"], [3, 3, 1, "", "RESPONSE_SIGNATURE_XPATH"], [3, 3, 1, "", "TIME_FORMAT"], [3, 3, 1, "", "TIME_FORMAT_2"], [3, 3, 1, "", "TIME_FORMAT_WITH_FRAGMENT"], [3, 2, 1, "", "add_sign"], [3, 2, 1, "", "b64decode"], [3, 2, 1, "", "b64encode"], [3, 2, 1, "", "calculate_x509_fingerprint"], [3, 2, 1, "", "decode_base64_and_inflate"], [3, 2, 1, "", "decrypt_element"], [3, 2, 1, "", "deflate_and_base64_encode"], [3, 2, 1, "", "delete_local_session"], [3, 2, 1, "", "escape_url"], [3, 2, 1, "", "format_cert"], [3, 2, 1, "", "format_finger_print"], [3, 2, 1, "", "format_private_key"], [3, 2, 1, "", "generate_name_id"], [3, 2, 1, "", "generate_unique_id"], [3, 2, 1, "", "get_expire_time"], [3, 2, 1, "", "get_self_host"], [3, 2, 1, "", "get_self_routed_url_no_query"], [3, 2, 1, "", "get_self_url"], [3, 2, 1, "", "get_self_url_host"], [3, 2, 1, "", "get_self_url_no_query"], [3, 2, 1, "", "get_status"], [3, 2, 1, "", "is_https"], [3, 2, 1, "", "normalize_url"], [3, 2, 1, "", "now"], [3, 2, 1, "", "parse_SAML_to_time"], [3, 2, 1, "", "parse_duration"], [3, 2, 1, "", "parse_time_to_SAML"], [3, 2, 1, "", "redirect"], [3, 2, 1, "", "sign_binary"], [3, 2, 1, "", "validate_binary_sign"], [3, 2, 1, "", "validate_metadata_sign"], [3, 2, 1, "", "validate_node_sign"], [3, 2, 1, "", "validate_sign"]], "onelogin.saml2.xml_templates": [[3, 1, 1, "", "OneLogin_Saml2_Templates"]], "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates": [[3, 3, 1, "", "ATTRIBUTE"], [3, 3, 1, "", "AUTHN_REQUEST"], [3, 3, 1, "", "LOGOUT_REQUEST"], [3, 3, 1, "", "LOGOUT_RESPONSE"], [3, 3, 1, "", "MD_ATTR_CONSUMER_SERVICE"], [3, 3, 1, "", "MD_CONTACT_PERSON"], [3, 3, 1, "", "MD_ENTITY_DESCRIPTOR"], [3, 3, 1, "", "MD_ORGANISATION"], [3, 3, 1, "", "MD_REQUESTED_ATTRIBUTE"], [3, 3, 1, "", "MD_SLS"], [3, 3, 1, "", "RESPONSE"]], "onelogin.saml2.xml_utils": [[3, 1, 1, "", "OneLogin_Saml2_XML"]], "onelogin.saml2.xml_utils.OneLogin_Saml2_XML": [[3, 2, 1, "", "cleanup_namespaces"], [3, 2, 1, "", "dump"], [3, 2, 1, "", "element_text"], [3, 2, 1, "", "extract_tag_text"], [3, 2, 1, "", "make_child"], [3, 2, 1, "", "make_root"], [3, 2, 1, "", "query"], [3, 2, 1, "", "to_etree"], [3, 2, 1, "", "to_string"], [3, 2, 1, "", "validate_xml"]], "onelogin.saml2.xmlparser": [[3, 5, 1, "", "DTDForbidden"], [3, 5, 1, "", "EntitiesForbidden"], [3, 1, 1, "", "GlobalParserTLS"], [3, 5, 1, "", "NotSupportedError"], [3, 1, 1, "", "RestrictedElement"], [3, 4, 1, "", "XML"], [3, 4, 1, "", "check_docinfo"], [3, 4, 1, "", "fromstring"], [3, 4, 1, "", "getDefaultParser"], [3, 4, 1, "", "iterparse"], [3, 4, 1, "", "parse"]], "onelogin.saml2.xmlparser.GlobalParserTLS": [[3, 2, 1, "", "createDefaultParser"], [3, 3, 1, "", "element_class"], [3, 2, 1, "", "getDefaultParser"], [3, 3, 1, "", "parser_config"], [3, 2, 1, "", "setDefaultParser"]], "onelogin.saml2.xmlparser.RestrictedElement": [[3, 3, 1, "", "blacklist"], [3, 2, 1, "", "getchildren"], [3, 2, 1, "", "getiterator"], [3, 2, 1, "", "iter"], [3, 2, 1, "", "iterchildren"], [3, 2, 1, "", "iterdescendants"], [3, 2, 1, "", "itersiblings"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:function", "5": "py:exception"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "function", "Python function"], "5": ["py", "exception", "Python exception"]}, "titleterms": {"welcom": 0, "saml": 0, "python2": 0, "3": 0, "toolkit": 0, "": 0, "document": 0, "content": [0, 2, 3], "onelogin": [1, 2, 3], "packag": [2, 3], "subpackag": 2, "modul": [2, 3], "saml2": 3, "submodul": 3, "auth": 3, "authn_request": 3, "compat": 3, "constant": 3, "error": 3, "idp_metadata_pars": 3, "logout_request": 3, "logout_respons": 3, "metadata": 3, "respons": 3, "set": 3, "util": 3, "xml_templat": 3, "xml_util": 3, "xmlparser": 3}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 58}, "alltitles": {"Welcome to SAML Python2/3 Toolkit\u2019s documentation!": [[0, "welcome-to-saml-python2-3-toolkit-s-documentation"]], "Contents:": [[0, null]], "onelogin": [[1, "onelogin"]], "onelogin package": [[2, "onelogin-package"]], "Subpackages": [[2, "subpackages"]], "Module contents": [[2, "module-onelogin"], [3, "module-onelogin.saml2"]], "onelogin.saml2 package": [[3, "onelogin-saml2-package"]], "Submodules": [[3, "submodules"]], "onelogin.saml2.auth module": [[3, "module-onelogin.saml2.auth"]], "onelogin.saml2.authn_request module": [[3, "module-onelogin.saml2.authn_request"]], "onelogin.saml2.compat module": [[3, "module-onelogin.saml2.compat"]], "onelogin.saml2.constants module": [[3, "module-onelogin.saml2.constants"]], "onelogin.saml2.errors module": [[3, "module-onelogin.saml2.errors"]], "onelogin.saml2.idp_metadata_parser module": [[3, "module-onelogin.saml2.idp_metadata_parser"]], "onelogin.saml2.logout_request module": [[3, "module-onelogin.saml2.logout_request"]], "onelogin.saml2.logout_response module": [[3, "module-onelogin.saml2.logout_response"]], "onelogin.saml2.metadata module": [[3, "module-onelogin.saml2.metadata"]], "onelogin.saml2.response module": [[3, "module-onelogin.saml2.response"]], "onelogin.saml2.settings module": [[3, "module-onelogin.saml2.settings"]], "onelogin.saml2.utils module": [[3, "module-onelogin.saml2.utils"]], "onelogin.saml2.xml_templates module": [[3, "module-onelogin.saml2.xml_templates"]], "onelogin.saml2.xml_utils module": [[3, "module-onelogin.saml2.xml_utils"]], "onelogin.saml2.xmlparser module": [[3, "module-onelogin.saml2.xmlparser"]]}, "indexentries": {"module": [[2, "module-onelogin"], [3, "module-onelogin.saml2"], [3, "module-onelogin.saml2.auth"], [3, "module-onelogin.saml2.authn_request"], [3, "module-onelogin.saml2.compat"], [3, "module-onelogin.saml2.constants"], [3, "module-onelogin.saml2.errors"], [3, "module-onelogin.saml2.idp_metadata_parser"], [3, "module-onelogin.saml2.logout_request"], [3, "module-onelogin.saml2.logout_response"], [3, "module-onelogin.saml2.metadata"], [3, "module-onelogin.saml2.response"], [3, "module-onelogin.saml2.settings"], [3, "module-onelogin.saml2.utils"], [3, "module-onelogin.saml2.xml_templates"], [3, "module-onelogin.saml2.xml_utils"], [3, "module-onelogin.saml2.xmlparser"]], "onelogin": [[2, "module-onelogin"]], "ac_kerberos (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AC_KERBEROS"]], "ac_password (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AC_PASSWORD"]], "ac_password_protected (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AC_PASSWORD_PROTECTED"]], "ac_smartcard (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AC_SMARTCARD"]], "ac_unspecified (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AC_UNSPECIFIED"]], "ac_x509 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AC_X509"]], "aes128_cbc (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AES128_CBC"]], "aes192_cbc (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AES192_CBC"]], "aes256_cbc (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.AES256_CBC"]], "allowed_clock_drift (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT"]], "assertion_expired (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.ASSERTION_EXPIRED"]], "assertion_signature_xpath (onelogin.saml2.utils.onelogin_saml2_utils attribute)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH"]], "assertion_too_early (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.ASSERTION_TOO_EARLY"]], "attribute (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.ATTRIBUTE"]], "attrname_format_basic (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_BASIC"]], "attrname_format_unspecified (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_UNSPECIFIED"]], "attrname_format_uri (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.ATTRNAME_FORMAT_URI"]], "authn_context_mismatch (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.AUTHN_CONTEXT_MISMATCH"]], "authn_request (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.AUTHN_REQUEST"]], "binding_deflate (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.BINDING_DEFLATE"]], "binding_http_artifact (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_ARTIFACT"]], "binding_http_post (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_POST"]], "binding_http_redirect (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT"]], "binding_soap (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.BINDING_SOAP"]], "cert_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.CERT_NOT_FOUND"]], "children_node_not_found_in_keyinfo (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.CHILDREN_NODE_NOT_FOUND_IN_KEYINFO"]], "cm_bearer (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.CM_BEARER"]], "cm_holder_key (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.CM_HOLDER_KEY"]], "cm_sender_vouches (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.CM_SENDER_VOUCHES"]], "deprecated_algorithms (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS"]], "deprecated_digest_method (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.DEPRECATED_DIGEST_METHOD"]], "deprecated_signature_method (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.DEPRECATED_SIGNATURE_METHOD"]], "dsa_sha1 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.DSA_SHA1"]], "dtdforbidden": [[3, "onelogin.saml2.xmlparser.DTDForbidden"]], "duplicated_attribute_name_found (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.DUPLICATED_ATTRIBUTE_NAME_FOUND"]], "duplicated_id_in_signed_elements (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.DUPLICATED_ID_IN_SIGNED_ELEMENTS"]], "duplicated_reference_in_signed_elements (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS"]], "empty_destination (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.EMPTY_DESTINATION"]], "empty_nameid (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.EMPTY_NAMEID"]], "encrypted_attributes (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.ENCRYPTED_ATTRIBUTES"]], "entitiesforbidden": [[3, "onelogin.saml2.xmlparser.EntitiesForbidden"]], "globalparsertls (class in onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.GlobalParserTLS"]], "id_not_found_in_signed_element (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.ID_NOT_FOUND_IN_SIGNED_ELEMENT"]], "invalid_signature (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.INVALID_SIGNATURE"]], "invalid_signed_element (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.INVALID_SIGNED_ELEMENT"]], "invalid_xml_format (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT"]], "issuer_multiple_in_response (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.ISSUER_MULTIPLE_IN_RESPONSE"]], "issuer_not_found_in_assertion (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.ISSUER_NOT_FOUND_IN_ASSERTION"]], "keyinfo_not_found_in_encrypted_data (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA"]], "logout_request (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.LOGOUT_REQUEST"]], "logout_response (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.LOGOUT_RESPONSE"]], "md_attr_consumer_service (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.MD_ATTR_CONSUMER_SERVICE"]], "md_contact_person (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.MD_CONTACT_PERSON"]], "md_entity_descriptor (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.MD_ENTITY_DESCRIPTOR"]], "md_organisation (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.MD_ORGANISATION"]], "md_requested_attribute (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.MD_REQUESTED_ATTRIBUTE"]], "md_sls (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.MD_SLS"]], "metadata_sp_invalid (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.METADATA_SP_INVALID"]], "missing_conditions (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.MISSING_CONDITIONS"]], "missing_id (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.MISSING_ID"]], "missing_status (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.MISSING_STATUS"]], "missing_status_code (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.MISSING_STATUS_CODE"]], "nameid_email_address (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_EMAIL_ADDRESS"]], "nameid_encrypted (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_ENCRYPTED"]], "nameid_entity (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_ENTITY"]], "nameid_kerberos (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_KERBEROS"]], "nameid_persistent (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_PERSISTENT"]], "nameid_transient (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_TRANSIENT"]], "nameid_unspecified (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED"]], "nameid_windows_domain_qualified_name (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME"]], "nameid_x509_subject_name (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NAMEID_X509_SUBJECT_NAME"]], "no_attributestatement (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_ATTRIBUTESTATEMENT"]], "no_encrypted_assertion (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_ENCRYPTED_ASSERTION"]], "no_encrypted_nameid (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_ENCRYPTED_NAMEID"]], "no_nameid (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_NAMEID"]], "no_signature_found (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_SIGNATURE_FOUND"]], "no_signed_assertion (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_SIGNED_ASSERTION"]], "no_signed_message (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE"]], "nsmap (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NSMAP"]], "ns_ds (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_DS"]], "ns_md (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_MD"]], "ns_prefix_ds (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_DS"]], "ns_prefix_md (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_MD"]], "ns_prefix_saml (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_SAML"]], "ns_prefix_samlp (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_SAMLP"]], "ns_prefix_xenc (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_XENC"]], "ns_prefix_xs (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_XS"]], "ns_prefix_xsd (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_XSD"]], "ns_prefix_xsi (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_PREFIX_XSI"]], "ns_saml (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_SAML"]], "ns_samlp (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_SAMLP"]], "ns_soap (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_SOAP"]], "ns_xenc (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_XENC"]], "ns_xs (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_XS"]], "ns_xsi (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.NS_XSI"]], "notsupportederror": [[3, "onelogin.saml2.xmlparser.NotSupportedError"]], "onelogin_saml2_auth (class in onelogin.saml2.auth)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth"]], "onelogin_saml2_authn_request (class in onelogin.saml2.authn_request)": [[3, "onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request"]], "onelogin_saml2_constants (class in onelogin.saml2.constants)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants"]], "onelogin_saml2_error": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error"]], "onelogin_saml2_idpmetadataparser (class in onelogin.saml2.idp_metadata_parser)": [[3, "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser"]], "onelogin_saml2_logout_request (class in onelogin.saml2.logout_request)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request"]], "onelogin_saml2_logout_response (class in onelogin.saml2.logout_response)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response"]], "onelogin_saml2_metadata (class in onelogin.saml2.metadata)": [[3, "onelogin.saml2.metadata.OneLogin_Saml2_Metadata"]], "onelogin_saml2_response (class in onelogin.saml2.response)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response"]], "onelogin_saml2_settings (class in onelogin.saml2.settings)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings"]], "onelogin_saml2_templates (class in onelogin.saml2.xml_templates)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates"]], "onelogin_saml2_utils (class in onelogin.saml2.utils)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils"]], "onelogin_saml2_validationerror": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError"]], "onelogin_saml2_xml (class in onelogin.saml2.xml_utils)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML"]], "private_key_file_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.PRIVATE_KEY_FILE_NOT_FOUND"]], "private_key_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND"]], "public_cert_file_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND"]], "redirect_invalid_url (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.REDIRECT_INVALID_URL"]], "response (onelogin.saml2.xml_templates.onelogin_saml2_templates attribute)": [[3, "onelogin.saml2.xml_templates.OneLogin_Saml2_Templates.RESPONSE"]], "response_expired (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.RESPONSE_EXPIRED"]], "response_signature_xpath (onelogin.saml2.utils.onelogin_saml2_utils attribute)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH"]], "rsa_1_5 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.RSA_1_5"]], "rsa_oaep_mgf1p (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.RSA_OAEP_MGF1P"]], "rsa_sha1 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.RSA_SHA1"]], "rsa_sha256 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.RSA_SHA256"]], "rsa_sha384 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.RSA_SHA384"]], "rsa_sha512 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.RSA_SHA512"]], "restrictedelement (class in onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.RestrictedElement"]], "saml_logoutmessage_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND"]], "saml_logoutrequest_invalid (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTREQUEST_INVALID"]], "saml_logoutresponse_invalid (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SAML_LOGOUTRESPONSE_INVALID"]], "saml_response_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND"]], "saml_single_logout_not_supported (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED"]], "session_expired (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.SESSION_EXPIRED"]], "settings_file_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SETTINGS_FILE_NOT_FOUND"]], "settings_invalid (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SETTINGS_INVALID"]], "settings_invalid_syntax (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SETTINGS_INVALID_SYNTAX"]], "sha1 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.SHA1"]], "sha256 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.SHA256"]], "sha384 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.SHA384"]], "sha512 (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.SHA512"]], "sp_certs_not_found (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.SP_CERTS_NOT_FOUND"]], "sp_name_qualifier_name_mismatch (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.SP_NAME_QUALIFIER_NAME_MISMATCH"]], "status_code_is_not_success (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.STATUS_CODE_IS_NOT_SUCCESS"]], "status_no_passive (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_NO_PASSIVE"]], "status_partial_logout (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_PARTIAL_LOGOUT"]], "status_proxy_count_exceeded (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_PROXY_COUNT_EXCEEDED"]], "status_requester (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_REQUESTER"]], "status_responder (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_RESPONDER"]], "status_success (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_SUCCESS"]], "status_version_mismatch (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.STATUS_VERSION_MISMATCH"]], "time_cached (onelogin.saml2.metadata.onelogin_saml2_metadata attribute)": [[3, "onelogin.saml2.metadata.OneLogin_Saml2_Metadata.TIME_CACHED"]], "time_format (onelogin.saml2.utils.onelogin_saml2_utils attribute)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.TIME_FORMAT"]], "time_format_2 (onelogin.saml2.utils.onelogin_saml2_utils attribute)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.TIME_FORMAT_2"]], "time_format_with_fragment (onelogin.saml2.utils.onelogin_saml2_utils attribute)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.TIME_FORMAT_WITH_FRAGMENT"]], "time_valid (onelogin.saml2.metadata.onelogin_saml2_metadata attribute)": [[3, "onelogin.saml2.metadata.OneLogin_Saml2_Metadata.TIME_VALID"]], "tripledes_cbc (onelogin.saml2.constants.onelogin_saml2_constants attribute)": [[3, "onelogin.saml2.constants.OneLogin_Saml2_Constants.TRIPLEDES_CBC"]], "unexpected_signed_elements (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.UNEXPECTED_SIGNED_ELEMENTS"]], "unsupported_retrieval_method (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.UNSUPPORTED_RETRIEVAL_METHOD"]], "unsupported_saml_version (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.UNSUPPORTED_SAML_VERSION"]], "unsupported_settings_object (onelogin.saml2.errors.onelogin_saml2_error attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_Error.UNSUPPORTED_SETTINGS_OBJECT"]], "wrong_audience (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_AUDIENCE"]], "wrong_destination (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_DESTINATION"]], "wrong_inresponseto (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO"]], "wrong_issuer (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_ISSUER"]], "wrong_number_of_assertions (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS"]], "wrong_number_of_authstatements (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_AUTHSTATEMENTS"]], "wrong_number_of_signatures (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES"]], "wrong_number_of_signatures_in_assertion (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION"]], "wrong_number_of_signatures_in_response (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE"]], "wrong_signed_element (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_SIGNED_ELEMENT"]], "wrong_subjectconfirmation (onelogin.saml2.errors.onelogin_saml2_validationerror attribute)": [[3, "onelogin.saml2.errors.OneLogin_Saml2_ValidationError.WRONG_SUBJECTCONFIRMATION"]], "xml() (in module onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.XML"]], "add_request_signature() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.add_request_signature"]], "add_response_signature() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.add_response_signature"]], "add_sign() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.add_sign"]], "add_x509_key_descriptors() (onelogin.saml2.metadata.onelogin_saml2_metadata class method)": [[3, "onelogin.saml2.metadata.OneLogin_Saml2_Metadata.add_x509_key_descriptors"]], "authn_request_class (onelogin.saml2.auth.onelogin_saml2_auth attribute)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.authn_request_class"]], "b64decode() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.b64decode"]], "b64encode() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.b64encode"]], "blacklist (onelogin.saml2.xmlparser.restrictedelement attribute)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.blacklist"]], "build() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.build"]], "builder() (onelogin.saml2.metadata.onelogin_saml2_metadata class method)": [[3, "onelogin.saml2.metadata.OneLogin_Saml2_Metadata.builder"]], "calculate_x509_fingerprint() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.calculate_x509_fingerprint"]], "check_docinfo() (in module onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.check_docinfo"]], "check_idp_settings() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.check_idp_settings"]], "check_one_authnstatement() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.check_one_authnstatement"]], "check_one_condition() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.check_one_condition"]], "check_settings() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.check_settings"]], "check_sp_certs() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.check_sp_certs"]], "check_sp_settings() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.check_sp_settings"]], "check_status() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.check_status"]], "cleanup_namespaces() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.cleanup_namespaces"]], "createdefaultparser() (onelogin.saml2.xmlparser.globalparsertls method)": [[3, "onelogin.saml2.xmlparser.GlobalParserTLS.createDefaultParser"]], "decode_base64_and_inflate() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.decode_base64_and_inflate"]], "decrypt_element() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.decrypt_element"]], "deflate_and_base64_encode() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.deflate_and_base64_encode"]], "delete_local_session() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.delete_local_session"]], "dict_deep_merge() (in module onelogin.saml2.idp_metadata_parser)": [[3, "onelogin.saml2.idp_metadata_parser.dict_deep_merge"]], "dump() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.dump"]], "element_class (onelogin.saml2.xmlparser.globalparsertls attribute)": [[3, "onelogin.saml2.xmlparser.GlobalParserTLS.element_class"]], "element_text() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.element_text"]], "escape_url() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.escape_url"]], "extract_tag_text() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.extract_tag_text"]], "format_cert() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.format_cert"]], "format_finger_print() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.format_finger_print"]], "format_idp_cert() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.format_idp_cert"]], "format_idp_cert_multi() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.format_idp_cert_multi"]], "format_private_key() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.format_private_key"]], "format_sp_cert() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.format_sp_cert"]], "format_sp_cert_new() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.format_sp_cert_new"]], "format_sp_key() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.format_sp_key"]], "fromstring() (in module onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.fromstring"]], "generate_name_id() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.generate_name_id"]], "generate_unique_id() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.generate_unique_id"]], "getdefaultparser() (in module onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.getDefaultParser"]], "getdefaultparser() (onelogin.saml2.xmlparser.globalparsertls method)": [[3, "onelogin.saml2.xmlparser.GlobalParserTLS.getDefaultParser"]], "get_assertion_id() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_assertion_id"]], "get_assertion_issue_instant() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_assertion_issue_instant"]], "get_assertion_not_on_or_after() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_assertion_not_on_or_after"]], "get_attribute() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_attribute"]], "get_attributes() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_attributes"]], "get_attributes() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_attributes"]], "get_audiences() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_audiences"]], "get_authn_contexts() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_authn_contexts"]], "get_base_path() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_base_path"]], "get_cert_path() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_cert_path"]], "get_contacts() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_contacts"]], "get_error() (onelogin.saml2.logout_request.onelogin_saml2_logout_request method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_error"]], "get_error() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.get_error"]], "get_error() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_error"]], "get_errors() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_errors"]], "get_errors() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_errors"]], "get_expire_time() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_expire_time"]], "get_friendlyname_attribute() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_friendlyname_attribute"]], "get_friendlyname_attributes() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_friendlyname_attributes"]], "get_friendlyname_attributes() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_friendlyname_attributes"]], "get_id() (onelogin.saml2.authn_request.onelogin_saml2_authn_request method)": [[3, "onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request.get_id"]], "get_id() (onelogin.saml2.logout_request.onelogin_saml2_logout_request class method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_id"]], "get_id() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_id"]], "get_idp_cert() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_idp_cert"]], "get_idp_data() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_idp_data"]], "get_idp_slo_response_url() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_idp_slo_response_url"]], "get_idp_slo_url() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_idp_slo_url"]], "get_idp_sso_url() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_idp_sso_url"]], "get_in_response_to() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.get_in_response_to"]], "get_in_response_to() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_in_response_to"]], "get_issuer() (onelogin.saml2.logout_request.onelogin_saml2_logout_request class method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_issuer"]], "get_issuer() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.get_issuer"]], "get_issuers() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_issuers"]], "get_last_assertion_id() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_assertion_id"]], "get_last_assertion_issue_instant() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_assertion_issue_instant"]], "get_last_assertion_not_on_or_after() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_assertion_not_on_or_after"]], "get_last_authn_contexts() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_authn_contexts"]], "get_last_error_reason() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_error_reason"]], "get_last_message_id() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_message_id"]], "get_last_request_id() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_request_id"]], "get_last_request_xml() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_request_xml"]], "get_last_response_in_response_to() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_response_in_response_to"]], "get_last_response_xml() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_last_response_xml"]], "get_lib_path() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_lib_path"]], "get_metadata() (onelogin.saml2.idp_metadata_parser.onelogin_saml2_idpmetadataparser class method)": [[3, "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser.get_metadata"]], "get_nameid() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_nameid"]], "get_nameid() (onelogin.saml2.logout_request.onelogin_saml2_logout_request class method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_nameid"]], "get_nameid() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_nameid"]], "get_nameid_data() (onelogin.saml2.logout_request.onelogin_saml2_logout_request class method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_nameid_data"]], "get_nameid_data() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_nameid_data"]], "get_nameid_format() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_nameid_format"]], "get_nameid_format() (onelogin.saml2.logout_request.onelogin_saml2_logout_request class method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_nameid_format"]], "get_nameid_format() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_nameid_format"]], "get_nameid_nq() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_nameid_nq"]], "get_nameid_nq() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_nameid_nq"]], "get_nameid_spnq() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_nameid_spnq"]], "get_nameid_spnq() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_nameid_spnq"]], "get_organization() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_organization"]], "get_request() (onelogin.saml2.authn_request.onelogin_saml2_authn_request method)": [[3, "onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request.get_request"]], "get_request() (onelogin.saml2.logout_request.onelogin_saml2_logout_request method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_request"]], "get_response() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.get_response"]], "get_schemas_path() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_schemas_path"]], "get_security_data() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_security_data"]], "get_self_host() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_self_host"]], "get_self_routed_url_no_query() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_self_routed_url_no_query"]], "get_self_url() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_self_url"]], "get_self_url_host() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_self_url_host"]], "get_self_url_no_query() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_self_url_no_query"]], "get_session_expiration() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_session_expiration"]], "get_session_index() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_session_index"]], "get_session_index() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_session_index"]], "get_session_indexes() (onelogin.saml2.logout_request.onelogin_saml2_logout_request class method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_session_indexes"]], "get_session_not_on_or_after() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_session_not_on_or_after"]], "get_settings() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_settings"]], "get_slo_response_url() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_slo_response_url"]], "get_slo_url() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_slo_url"]], "get_sp_cert() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_sp_cert"]], "get_sp_cert_new() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_sp_cert_new"]], "get_sp_data() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_sp_data"]], "get_sp_key() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_sp_key"]], "get_sp_metadata() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.get_sp_metadata"]], "get_sso_url() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.get_sso_url"]], "get_status() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.get_status"]], "get_status() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_status"]], "get_xml() (onelogin.saml2.authn_request.onelogin_saml2_authn_request method)": [[3, "onelogin.saml2.authn_request.OneLogin_Saml2_Authn_Request.get_xml"]], "get_xml() (onelogin.saml2.logout_request.onelogin_saml2_logout_request method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.get_xml"]], "get_xml() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.get_xml"]], "get_xml_document() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.get_xml_document"]], "getchildren() (onelogin.saml2.xmlparser.restrictedelement method)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.getchildren"]], "getiterator() (onelogin.saml2.xmlparser.restrictedelement method)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.getiterator"]], "is_authenticated() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.is_authenticated"]], "is_debug_active() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.is_debug_active"]], "is_https() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.is_https"]], "is_strict() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.is_strict"]], "is_valid() (onelogin.saml2.logout_request.onelogin_saml2_logout_request method)": [[3, "onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request.is_valid"]], "is_valid() (onelogin.saml2.logout_response.onelogin_saml2_logout_response method)": [[3, "onelogin.saml2.logout_response.OneLogin_Saml2_Logout_Response.is_valid"]], "is_valid() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.is_valid"]], "iter() (onelogin.saml2.xmlparser.restrictedelement method)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.iter"]], "iterchildren() (onelogin.saml2.xmlparser.restrictedelement method)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.iterchildren"]], "iterdescendants() (onelogin.saml2.xmlparser.restrictedelement method)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.iterdescendants"]], "iterparse() (in module onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.iterparse"]], "itersiblings() (onelogin.saml2.xmlparser.restrictedelement method)": [[3, "onelogin.saml2.xmlparser.RestrictedElement.itersiblings"]], "login() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.login"]], "logout() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.logout"]], "logout_request_class (onelogin.saml2.auth.onelogin_saml2_auth attribute)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.logout_request_class"]], "logout_response_class (onelogin.saml2.auth.onelogin_saml2_auth attribute)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.logout_response_class"]], "make_child() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.make_child"]], "make_root() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.make_root"]], "merge_settings() (onelogin.saml2.idp_metadata_parser.onelogin_saml2_idpmetadataparser static method)": [[3, "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser.merge_settings"]], "metadata_class (onelogin.saml2.settings.onelogin_saml2_settings attribute)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.metadata_class"]], "normalize_url() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.normalize_url"]], "now() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.now"]], "onelogin.saml2": [[3, "module-onelogin.saml2"]], "onelogin.saml2.auth": [[3, "module-onelogin.saml2.auth"]], "onelogin.saml2.authn_request": [[3, "module-onelogin.saml2.authn_request"]], "onelogin.saml2.compat": [[3, "module-onelogin.saml2.compat"]], "onelogin.saml2.constants": [[3, "module-onelogin.saml2.constants"]], "onelogin.saml2.errors": [[3, "module-onelogin.saml2.errors"]], "onelogin.saml2.idp_metadata_parser": [[3, "module-onelogin.saml2.idp_metadata_parser"]], "onelogin.saml2.logout_request": [[3, "module-onelogin.saml2.logout_request"]], "onelogin.saml2.logout_response": [[3, "module-onelogin.saml2.logout_response"]], "onelogin.saml2.metadata": [[3, "module-onelogin.saml2.metadata"]], "onelogin.saml2.response": [[3, "module-onelogin.saml2.response"]], "onelogin.saml2.settings": [[3, "module-onelogin.saml2.settings"]], "onelogin.saml2.utils": [[3, "module-onelogin.saml2.utils"]], "onelogin.saml2.xml_templates": [[3, "module-onelogin.saml2.xml_templates"]], "onelogin.saml2.xml_utils": [[3, "module-onelogin.saml2.xml_utils"]], "onelogin.saml2.xmlparser": [[3, "module-onelogin.saml2.xmlparser"]], "parse() (in module onelogin.saml2.xmlparser)": [[3, "onelogin.saml2.xmlparser.parse"]], "parse() (onelogin.saml2.idp_metadata_parser.onelogin_saml2_idpmetadataparser class method)": [[3, "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser.parse"]], "parse_saml_to_time() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.parse_SAML_to_time"]], "parse_duration() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.parse_duration"]], "parse_remote() (onelogin.saml2.idp_metadata_parser.onelogin_saml2_idpmetadataparser class method)": [[3, "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser.parse_remote"]], "parse_time_to_saml() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.parse_time_to_SAML"]], "parser_config (onelogin.saml2.xmlparser.globalparsertls attribute)": [[3, "onelogin.saml2.xmlparser.GlobalParserTLS.parser_config"]], "process_response() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.process_response"]], "process_signed_elements() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.process_signed_elements"]], "process_slo() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.process_slo"]], "query() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.query"]], "redirect() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.redirect"]], "redirect_to() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.redirect_to"]], "response_class (onelogin.saml2.auth.onelogin_saml2_auth attribute)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.response_class"]], "return_false_on_exception() (in module onelogin.saml2.utils)": [[3, "onelogin.saml2.utils.return_false_on_exception"]], "setdefaultparser() (onelogin.saml2.xmlparser.globalparsertls method)": [[3, "onelogin.saml2.xmlparser.GlobalParserTLS.setDefaultParser"]], "set_cert_path() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.set_cert_path"]], "set_strict() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.set_strict"]], "set_strict() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.set_strict"]], "sign_binary() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.sign_binary"]], "sign_metadata() (onelogin.saml2.metadata.onelogin_saml2_metadata static method)": [[3, "onelogin.saml2.metadata.OneLogin_Saml2_Metadata.sign_metadata"]], "store_valid_response() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.store_valid_response"]], "to_bytes() (in module onelogin.saml2.compat)": [[3, "onelogin.saml2.compat.to_bytes"]], "to_etree() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.to_etree"]], "to_string() (in module onelogin.saml2.compat)": [[3, "onelogin.saml2.compat.to_string"]], "to_string() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.to_string"]], "utf8() (in module onelogin.saml2.compat)": [[3, "onelogin.saml2.compat.utf8"]], "validate_binary_sign() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.validate_binary_sign"]], "validate_metadata() (onelogin.saml2.settings.onelogin_saml2_settings method)": [[3, "onelogin.saml2.settings.OneLogin_Saml2_Settings.validate_metadata"]], "validate_metadata_sign() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.validate_metadata_sign"]], "validate_node_sign() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.validate_node_sign"]], "validate_num_assertions() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.validate_num_assertions"]], "validate_request_signature() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.validate_request_signature"]], "validate_response_signature() (onelogin.saml2.auth.onelogin_saml2_auth method)": [[3, "onelogin.saml2.auth.OneLogin_Saml2_Auth.validate_response_signature"]], "validate_sign() (onelogin.saml2.utils.onelogin_saml2_utils static method)": [[3, "onelogin.saml2.utils.OneLogin_Saml2_Utils.validate_sign"]], "validate_signed_elements() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.validate_signed_elements"]], "validate_timestamps() (onelogin.saml2.response.onelogin_saml2_response method)": [[3, "onelogin.saml2.response.OneLogin_Saml2_Response.validate_timestamps"]], "validate_url() (in module onelogin.saml2.settings)": [[3, "onelogin.saml2.settings.validate_url"]], "validate_xml() (onelogin.saml2.xml_utils.onelogin_saml2_xml static method)": [[3, "onelogin.saml2.xml_utils.OneLogin_Saml2_XML.validate_xml"]]}}) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..eee84f5b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,122 @@ +[build-system] +requires = ["setuptools>=61.0.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "python3-saml" +version = "1.16.0" +description = "Saml Python Toolkit. Add SAML support to your Python software using this library" +license = {file = "LICENSE"} +authors = [ + {name = "SAML-Toolkits", email = "contact@iamdigitalservices.com"} +] +maintainers = [ + {name = "Sixto Martin", email = "sixto.martin.garcia@gmail.com"} +] +readme = "README.md" +keywords = [ + "saml", + "saml2", + "sso", + "xmlsec", + "federation", + "identity", +] +classifiers = [ + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "lxml>=4.6.5,!=4.7.0", + "xmlsec>=1.3.9", + "isodate>=0.6.1", +] +requires-python = ">=3.7" + +[project.urls] +Homepage = "https://saml.info" +Source = "https://github.com/SAML-Toolkits/python3-saml" +"Bug Tracker" = "https://github.com/SAML-Toolkits/python3-saml/issues" +Changelog = "https://github.com/SAML-Toolkits/python3-saml/blob/master/changelog.md" + +[project.optional-dependencies] +test = [ + "coverage[toml]>=4.5.2", + "pytest>=4.6", +] +lint = [ + "black==24.4.2", + "flake8>=3.6.0, <=5.0.0", +] + +[tool.setuptools] +package-dir = {"" = "src"} + +[tool.setuptools.package-data] +"onelogin.saml2.schemas" = ["*.xsd"] + +[tool.pytest.ini_options] +minversion = "4.6.11" +addopts = "-ra -vvv" +testpaths = [ + "tests", +] +pythonpath = [ + "tests", +] + +[tool.black] +line-length = 200 + +[tool.isort] +profile = "black" +# The 'black' profile means: +# multi_line_output = 3 +# include_trailing_comma = true +# force_grid_wrap = 0 +# use_parentheses = true +# ensure_newline_before_comments = true +# line_length = 88 +line_length = 200 # override black provile line_length +force_single_line = true # override black profile multi_line_output +star_first = true +group_by_package = true +force_sort_within_sections = true +lines_after_imports = 2 +honor_noqa = true +atomic = true +ignore_comments = true +skip_gitignore = true +src_paths = ['src'] + +[tool.coverage.run] +branch = true + +[tool.coverage.paths] +source = [ + "src/onelogin/saml2" +] + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "if self.debug", + "if debug", + "raise AssertionError", + "raise NotImplementedError", + "if 0:", + "if __name__ == .__main__.:" +] +show_missing = true +ignore_errors = true + + +[tool.coverage.html] +directory = "coverage_html_report" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e9d41598..00000000 --- a/setup.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[flake8] -ignore = E731,W504 -max-complexity = 48 -max-line-length = 1900 - -[wheel] -python-tag = py27 diff --git a/setup.py b/setup.py deleted file mode 100644 index 3a248144..00000000 --- a/setup.py +++ /dev/null @@ -1,54 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License - -from setuptools import setup - - -setup( - name='python3-saml', - version='1.7.0', - description='Onelogin Python Toolkit. Add SAML support to your Python software using this library', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - ], - author='OneLogin', - author_email='support@onelogin.com', - license='MIT', - url='https://github.com/onelogin/python3-saml', - packages=['onelogin', 'onelogin/saml2'], - include_package_data=True, - package_data={ - 'onelogin/saml2/schemas': ['*.xsd'], - }, - package_dir={ - '': 'src', - }, - test_suite='tests', - install_requires=[ - 'isodate>=0.5.0', - 'xmlsec>=0.6.0', - 'defusedxml>=0.5.0' - ], - dependency_links=['http://github.com/mehcode/python-xmlsec/tarball/master'], - extras_require={ - 'test': ( - 'coverage>=4.5.2', - 'freezegun==0.3.11', - 'pylint==1.9.4', - 'flake8==3.6.0', - 'coveralls==1.5.1', - ), - }, - keywords='saml saml2 xmlsec django flask pyramid python3', -) diff --git a/src/onelogin/__init__.py b/src/onelogin/__init__.py index ba664a65..57f87a32 100644 --- a/src/onelogin/__init__.py +++ b/src/onelogin/__init__.py @@ -1,14 +1,10 @@ # -*- coding: utf-8 -*- """ -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License Add SAML support to your Python softwares using this library. -Forget those complicated libraries and use that open source -library provided and supported by OneLogin Inc. -OneLogin's SAML Python toolkit let you build a SP (Service Provider) +SAML Python toolkit let you build a SP (Service Provider) over your Python application and connect it to any IdP (Identity Provider). Supports: diff --git a/src/onelogin/saml2/__init__.py b/src/onelogin/saml2/__init__.py index ba664a65..57f87a32 100644 --- a/src/onelogin/saml2/__init__.py +++ b/src/onelogin/saml2/__init__.py @@ -1,14 +1,10 @@ # -*- coding: utf-8 -*- """ -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License Add SAML support to your Python softwares using this library. -Forget those complicated libraries and use that open source -library provided and supported by OneLogin Inc. -OneLogin's SAML Python toolkit let you build a SP (Service Provider) +SAML Python toolkit let you build a SP (Service Provider) over your Python application and connect it to any IdP (Identity Provider). Supports: diff --git a/src/onelogin/saml2/auth.py b/src/onelogin/saml2/auth.py index 2a9b7cde..a55f7f8e 100644 --- a/src/onelogin/saml2/auth.py +++ b/src/onelogin/saml2/auth.py @@ -2,26 +2,24 @@ """ OneLogin_Saml2_Auth class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Main class of OneLogin's Python Toolkit. +Main class of SAML Python Toolkit. Initializes the SP SAML instance """ import xmlsec -from defusedxml.lxml import tostring from onelogin.saml2 import compat -from onelogin.saml2.settings import OneLogin_Saml2_Settings -from onelogin.saml2.response import OneLogin_Saml2_Response -from onelogin.saml2.logout_response import OneLogin_Saml2_Logout_Response +from onelogin.saml2.authn_request import OneLogin_Saml2_Authn_Request from onelogin.saml2.constants import OneLogin_Saml2_Constants -from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError from onelogin.saml2.logout_request import OneLogin_Saml2_Logout_Request -from onelogin.saml2.authn_request import OneLogin_Saml2_Authn_Request +from onelogin.saml2.logout_response import OneLogin_Saml2_Logout_Response +from onelogin.saml2.response import OneLogin_Saml2_Response +from onelogin.saml2.settings import OneLogin_Saml2_Settings +from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError +from onelogin.saml2.xmlparser import tostring class OneLogin_Saml2_Auth(object): @@ -34,6 +32,11 @@ class OneLogin_Saml2_Auth(object): SAML Response, a Logout Request or a Logout Response). """ + authn_request_class = OneLogin_Saml2_Authn_Request + logout_request_class = OneLogin_Saml2_Logout_Request + logout_response_class = OneLogin_Saml2_Logout_Response + response_class = OneLogin_Saml2_Response + def __init__(self, request_data, old_settings=None, custom_base_path=None): """ Initializes the SP SAML instance. @@ -47,28 +50,31 @@ def __init__(self, request_data, old_settings=None, custom_base_path=None): :param custom_base_path: Optional. Path where are stored the settings file and the cert folder :type custom_base_path: string """ - self.__request_data = request_data + self._request_data = request_data if isinstance(old_settings, OneLogin_Saml2_Settings): - self.__settings = old_settings + self._settings = old_settings else: - self.__settings = OneLogin_Saml2_Settings(old_settings, custom_base_path) - self.__attributes = dict() - self.__nameid = None - self.__nameid_format = None - self.__nameid_nq = None - self.__nameid_spnq = None - self.__session_index = None - self.__session_expiration = None - self.__authenticated = False - self.__errors = [] - self.__error_reason = None - self.__last_request_id = None - self.__last_message_id = None - self.__last_assertion_id = None - self.__last_authn_contexts = [] - self.__last_request = None - self.__last_response = None - self.__last_assertion_not_on_or_after = None + self._settings = OneLogin_Saml2_Settings(old_settings, custom_base_path) + self._attributes = dict() + self._friendlyname_attributes = dict() + self._nameid = None + self._nameid_format = None + self._nameid_nq = None + self._nameid_spnq = None + self._session_index = None + self._session_expiration = None + self._authenticated = False + self._errors = [] + self._error_reason = None + self._last_request_id = None + self._last_message_id = None + self._last_assertion_id = None + self._last_assertion_issue_instant = None + self._last_authn_contexts = [] + self._last_request = None + self._last_response = None + self._last_response_in_response_to = None + self._last_assertion_not_on_or_after = None def get_settings(self): """ @@ -76,7 +82,7 @@ def get_settings(self): :return: Setting info :rtype: OneLogin_Saml2_Setting object """ - return self.__settings + return self._settings def set_strict(self, value): """ @@ -86,7 +92,24 @@ def set_strict(self, value): :type value: bool """ assert isinstance(value, bool) - self.__settings.set_strict(value) + self._settings.set_strict(value) + + def store_valid_response(self, response): + self._attributes = response.get_attributes() + self._friendlyname_attributes = response.get_friendlyname_attributes() + self._nameid = response.get_nameid() + self._nameid_format = response.get_nameid_format() + self._nameid_nq = response.get_nameid_nq() + self._nameid_spnq = response.get_nameid_spnq() + self._session_index = response.get_session_index() + self._session_expiration = response.get_session_not_on_or_after() + self._last_message_id = response.get_id() + self._last_assertion_id = response.get_assertion_id() + self._last_assertion_issue_instant = response.get_assertion_issue_instant() + self._last_authn_contexts = response.get_authn_contexts() + self._authenticated = True + self._last_response_in_response_to = response.get_in_response_to() + self._last_assertion_not_on_or_after = response.get_assertion_not_on_or_after() def process_response(self, request_id=None): """ @@ -97,38 +120,23 @@ def process_response(self, request_id=None): :raises: OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND, when a POST with a SAMLResponse is not found """ - self.__errors = [] - self.__error_reason = None + self._errors = [] + self._error_reason = None - if 'post_data' in self.__request_data and 'SAMLResponse' in self.__request_data['post_data']: + if "post_data" in self._request_data and "SAMLResponse" in self._request_data["post_data"]: # AuthnResponse -- HTTP_POST Binding - response = OneLogin_Saml2_Response(self.__settings, self.__request_data['post_data']['SAMLResponse']) - self.__last_response = response.get_xml_document() - - if response.is_valid(self.__request_data, request_id): - self.__attributes = response.get_attributes() - self.__nameid = response.get_nameid() - self.__nameid_format = response.get_nameid_format() - self.__nameid_nq = response.get_nameid_nq() - self.__nameid_spnq = response.get_nameid_spnq() - self.__session_index = response.get_session_index() - self.__session_expiration = response.get_session_not_on_or_after() - self.__last_message_id = response.get_id() - self.__last_assertion_id = response.get_assertion_id() - self.__last_authn_contexts = response.get_authn_contexts() - self.__authenticated = True - self.__last_assertion_not_on_or_after = response.get_assertion_not_on_or_after() + response = self.response_class(self._settings, self._request_data["post_data"]["SAMLResponse"]) + self._last_response = response.get_xml_document() + if response.is_valid(self._request_data, request_id): + self.store_valid_response(response) else: - self.__errors.append('invalid_response') - self.__error_reason = response.get_error() + self._errors.append("invalid_response") + self._error_reason = response.get_error() else: - self.__errors.append('invalid_binding') - raise OneLogin_Saml2_Error( - 'SAML Response not found, Only supported HTTP_POST Binding', - OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND - ) + self._errors.append("invalid_binding") + raise OneLogin_Saml2_Error("SAML Response not found, Only supported HTTP_POST Binding", OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND) def process_slo(self, keep_local_session=False, request_id=None, delete_session_cb=None): """ @@ -142,61 +150,56 @@ def process_slo(self, keep_local_session=False, request_id=None, delete_session_ :returns: Redirection url """ - self.__errors = [] - self.__error_reason = None + self._errors = [] + self._error_reason = None - get_data = 'get_data' in self.__request_data and self.__request_data['get_data'] - if get_data and 'SAMLResponse' in get_data: - logout_response = OneLogin_Saml2_Logout_Response(self.__settings, get_data['SAMLResponse']) - self.__last_response = logout_response.get_xml() + get_data = "get_data" in self._request_data and self._request_data["get_data"] + if get_data and "SAMLResponse" in get_data: + logout_response = self.logout_response_class(self._settings, get_data["SAMLResponse"]) + self._last_response = logout_response.get_xml() if not self.validate_response_signature(get_data): - self.__errors.append('invalid_logout_response_signature') - self.__errors.append('Signature validation failed. Logout Response rejected') - elif not logout_response.is_valid(self.__request_data, request_id): - self.__errors.append('invalid_logout_response') - self.__error_reason = logout_response.get_error() + self._errors.append("invalid_logout_response_signature") + self._errors.append("Signature validation failed. Logout Response rejected") + elif not logout_response.is_valid(self._request_data, request_id): + self._errors.append("invalid_logout_response") elif logout_response.get_status() != OneLogin_Saml2_Constants.STATUS_SUCCESS: - self.__errors.append('logout_not_success') + self._errors.append("logout_not_success") else: - self.__last_message_id = logout_response.id + self._last_message_id = logout_response.id if not keep_local_session: OneLogin_Saml2_Utils.delete_local_session(delete_session_cb) - elif get_data and 'SAMLRequest' in get_data: - logout_request = OneLogin_Saml2_Logout_Request(self.__settings, get_data['SAMLRequest']) - self.__last_request = logout_request.get_xml() + elif get_data and "SAMLRequest" in get_data: + logout_request = self.logout_request_class(self._settings, get_data["SAMLRequest"]) + self._last_request = logout_request.get_xml() if not self.validate_request_signature(get_data): - self.__errors.append("invalid_logout_request_signature") - self.__errors.append('Signature validation failed. Logout Request rejected') - elif not logout_request.is_valid(self.__request_data): - self.__errors.append('invalid_logout_request') - self.__error_reason = logout_request.get_error() + self._errors.append("invalid_logout_request_signature") + self._errors.append("Signature validation failed. Logout Request rejected") + elif not logout_request.is_valid(self._request_data): + self._errors.append("invalid_logout_request") else: if not keep_local_session: OneLogin_Saml2_Utils.delete_local_session(delete_session_cb) in_response_to = logout_request.id - self.__last_message_id = logout_request.id - response_builder = OneLogin_Saml2_Logout_Response(self.__settings) + self._last_message_id = logout_request.id + response_builder = self.logout_response_class(self._settings) response_builder.build(in_response_to) - self.__last_response = response_builder.get_xml() + self._last_response = response_builder.get_xml() logout_response = response_builder.get_response() - parameters = {'SAMLResponse': logout_response} - if 'RelayState' in self.__request_data['get_data']: - parameters['RelayState'] = self.__request_data['get_data']['RelayState'] + parameters = {"SAMLResponse": logout_response} + if "RelayState" in self._request_data["get_data"]: + parameters["RelayState"] = self._request_data["get_data"]["RelayState"] - security = self.__settings.get_security_data() - if security['logoutResponseSigned']: - self.add_response_signature(parameters, security['signatureAlgorithm']) + security = self._settings.get_security_data() + if security["logoutResponseSigned"]: + self.add_response_signature(parameters, security["signatureAlgorithm"]) - return self.redirect_to(self.get_slo_url(), parameters) + return self.redirect_to(self.get_slo_response_url(), parameters) else: - self.__errors.append('invalid_binding') - raise OneLogin_Saml2_Error( - 'SAML LogoutRequest/LogoutResponse not found. Only supported HTTP_REDIRECT Binding', - OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND - ) + self._errors.append("invalid_binding") + raise OneLogin_Saml2_Error("SAML LogoutRequest/LogoutResponse not found. Only supported HTTP_REDIRECT Binding", OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND) def redirect_to(self, url=None, parameters={}): """ @@ -209,9 +212,9 @@ def redirect_to(self, url=None, parameters={}): :returns: Redirection URL """ - if url is None and 'RelayState' in self.__request_data['get_data']: - url = self.__request_data['get_data']['RelayState'] - return OneLogin_Saml2_Utils.redirect(url, parameters, request_data=self.__request_data) + if url is None and "RelayState" in self._request_data["get_data"]: + url = self._request_data["get_data"]["RelayState"] + return OneLogin_Saml2_Utils.redirect(url, parameters, request_data=self._request_data) def is_authenticated(self): """ @@ -220,7 +223,7 @@ def is_authenticated(self): :returns: True if is authenticated, False if not :rtype: bool """ - return self.__authenticated + return self._authenticated def get_attributes(self): """ @@ -229,7 +232,16 @@ def get_attributes(self): :returns: SAML attributes :rtype: dict """ - return self.__attributes + return self._attributes + + def get_friendlyname_attributes(self): + """ + Returns the set of SAML attributes indexed by FiendlyName. + + :returns: SAML attributes + :rtype: dict + """ + return self._friendlyname_attributes def get_nameid(self): """ @@ -238,7 +250,7 @@ def get_nameid(self): :returns: NameID :rtype: string|None """ - return self.__nameid + return self._nameid def get_nameid_format(self): """ @@ -247,7 +259,7 @@ def get_nameid_format(self): :returns: NameID Format :rtype: string|None """ - return self.__nameid_format + return self._nameid_format def get_nameid_nq(self): """ @@ -256,7 +268,7 @@ def get_nameid_nq(self): :returns: NameID NameQualifier :rtype: string|None """ - return self.__nameid_nq + return self._nameid_nq def get_nameid_spnq(self): """ @@ -265,7 +277,7 @@ def get_nameid_spnq(self): :returns: NameID SP NameQualifier :rtype: string|None """ - return self.__nameid_spnq + return self._nameid_spnq def get_session_index(self): """ @@ -273,22 +285,22 @@ def get_session_index(self): :returns: The SessionIndex of the assertion :rtype: string """ - return self.__session_index + return self._session_index def get_session_expiration(self): """ Returns the SessionNotOnOrAfter from the AuthnStatement. :returns: The SessionNotOnOrAfter of the assertion - :rtype: DateTime|None + :rtype: unix/posix timestamp|None """ - return self.__session_expiration + return self._session_expiration def get_last_assertion_not_on_or_after(self): """ The NotOnOrAfter value of the valid SubjectConfirmationData node (if any) of the last assertion processed """ - return self.__last_assertion_not_on_or_after + return self._last_assertion_not_on_or_after def get_errors(self): """ @@ -297,7 +309,7 @@ def get_errors(self): :returns: List of errors :rtype: list """ - return self.__errors + return self._errors def get_last_error_reason(self): """ @@ -306,7 +318,7 @@ def get_last_error_reason(self): :returns: Reason of the last error :rtype: None | string """ - return self.__error_reason + return self._error_reason def get_attribute(self, name): """ @@ -315,39 +327,66 @@ def get_attribute(self, name): :param name: Name of the attribute :type name: string - :returns: Attribute value if exists or [] - :rtype: string + :returns: Attribute value(s) if exists or None + :rtype: list """ assert isinstance(name, compat.str_type) - return self.__attributes.get(name) + return self._attributes.get(name) + + def get_friendlyname_attribute(self, friendlyname): + """ + Returns the requested SAML attribute searched by FriendlyName. + + :param friendlyname: FriendlyName of the attribute + :type friendlyname: string + + :returns: Attribute value(s) if exists or None + :rtype: list + """ + assert isinstance(friendlyname, compat.str_type) + return self._friendlyname_attributes.get(friendlyname) def get_last_request_id(self): """ :returns: The ID of the last Request SAML message generated. :rtype: string """ - return self.__last_request_id + return self._last_request_id def get_last_message_id(self): """ :returns: The ID of the last Response SAML message processed. :rtype: string """ - return self.__last_message_id + return self._last_message_id def get_last_assertion_id(self): """ :returns: The ID of the last assertion processed. :rtype: string """ - return self.__last_assertion_id + return self._last_assertion_id + + def get_last_assertion_issue_instant(self): + """ + :returns: The IssueInstant of the last assertion processed. + :rtype: unix/posix timestamp|None + """ + return self._last_assertion_issue_instant def get_last_authn_contexts(self): """ :returns: The list of authentication contexts sent in the last SAML Response. :rtype: list """ - return self.__last_authn_contexts + return self._last_authn_contexts + + def get_last_response_in_response_to(self): + """ + :returns: InResponseTo attribute of the last Response SAML processed or None if it is not present. + :rtype: string + """ + return self._last_response_in_response_to def login(self, return_to=None, force_authn=False, is_passive=False, set_nameid_policy=True, name_id_value_req=None): """ @@ -371,21 +410,21 @@ def login(self, return_to=None, force_authn=False, is_passive=False, set_nameid_ :returns: Redirection URL :rtype: string """ - authn_request = OneLogin_Saml2_Authn_Request(self.__settings, force_authn, is_passive, set_nameid_policy, name_id_value_req) - self.__last_request = authn_request.get_xml() - self.__last_request_id = authn_request.get_id() + authn_request = self.authn_request_class(self._settings, force_authn, is_passive, set_nameid_policy, name_id_value_req) + self._last_request = authn_request.get_xml() + self._last_request_id = authn_request.get_id() saml_request = authn_request.get_request() - parameters = {'SAMLRequest': saml_request} + parameters = {"SAMLRequest": saml_request} if return_to is not None: - parameters['RelayState'] = return_to + parameters["RelayState"] = return_to else: - parameters['RelayState'] = OneLogin_Saml2_Utils.get_self_url_no_query(self.__request_data) + parameters["RelayState"] = OneLogin_Saml2_Utils.get_self_url_no_query(self._request_data) - security = self.__settings.get_security_data() - if security.get('authnRequestsSigned', False): - self.add_request_signature(parameters, security['signatureAlgorithm']) + security = self._settings.get_security_data() + if security.get("authnRequestsSigned", False): + self.add_request_signature(parameters, security["signatureAlgorithm"]) return self.redirect_to(self.get_sso_url(), parameters) def logout(self, return_to=None, name_id=None, session_index=None, nq=None, name_id_format=None, spnq=None): @@ -414,37 +453,27 @@ def logout(self, return_to=None, name_id=None, session_index=None, nq=None, name """ slo_url = self.get_slo_url() if slo_url is None: - raise OneLogin_Saml2_Error( - 'The IdP does not support Single Log Out', - OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED - ) - - if name_id is None and self.__nameid is not None: - name_id = self.__nameid - - if name_id_format is None and self.__nameid_format is not None: - name_id_format = self.__nameid_format - - logout_request = OneLogin_Saml2_Logout_Request( - self.__settings, - name_id=name_id, - session_index=session_index, - nq=nq, - name_id_format=name_id_format, - spnq=spnq - ) - self.__last_request = logout_request.get_xml() - self.__last_request_id = logout_request.id - - parameters = {'SAMLRequest': logout_request.get_request()} + raise OneLogin_Saml2_Error("The IdP does not support Single Log Out", OneLogin_Saml2_Error.SAML_SINGLE_LOGOUT_NOT_SUPPORTED) + + if name_id is None and self._nameid is not None: + name_id = self._nameid + + if name_id_format is None and self._nameid_format is not None: + name_id_format = self._nameid_format + + logout_request = self.logout_request_class(self._settings, name_id=name_id, session_index=session_index, nq=nq, name_id_format=name_id_format, spnq=spnq) + self._last_request = logout_request.get_xml() + self._last_request_id = logout_request.id + + parameters = {"SAMLRequest": logout_request.get_request()} if return_to is not None: - parameters['RelayState'] = return_to + parameters["RelayState"] = return_to else: - parameters['RelayState'] = OneLogin_Saml2_Utils.get_self_url_no_query(self.__request_data) + parameters["RelayState"] = OneLogin_Saml2_Utils.get_self_url_no_query(self._request_data) - security = self.__settings.get_security_data() - if security.get('logoutRequestSigned', False): - self.add_request_signature(parameters, security['signatureAlgorithm']) + security = self._settings.get_security_data() + if security.get("logoutRequestSigned", False): + self.add_request_signature(parameters, security["signatureAlgorithm"]) return self.redirect_to(slo_url, parameters) def get_sso_url(self): @@ -454,8 +483,7 @@ def get_sso_url(self): :returns: An URL, the SSO endpoint of the IdP :rtype: string """ - idp_data = self.__settings.get_idp_data() - return idp_data['singleSignOnService']['url'] + return self._settings.get_idp_sso_url() def get_slo_url(self): """ @@ -464,11 +492,18 @@ def get_slo_url(self): :returns: An URL, the SLO endpoint of the IdP :rtype: string """ - idp_data = self.__settings.get_idp_data() - if 'url' in idp_data['singleLogoutService']: - return idp_data['singleLogoutService']['url'] + return self._settings.get_idp_slo_url() - def add_request_signature(self, request_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1): + def get_slo_response_url(self): + """ + Gets the SLO return URL for IdP-initiated logout. + + :returns: an URL, the SLO return endpoint of the IdP + :rtype: string + """ + return self._settings.get_idp_slo_response_url() + + def add_request_signature(self, request_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256): """ Builds the Signature of the SAML Request. @@ -478,9 +513,9 @@ def add_request_signature(self, request_data, sign_algorithm=OneLogin_Saml2_Cons :param sign_algorithm: Signature algorithm method :type sign_algorithm: string """ - return self.__build_signature(request_data, 'SAMLRequest', sign_algorithm) + return self._build_signature(request_data, "SAMLRequest", sign_algorithm) - def add_response_signature(self, response_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1): + def add_response_signature(self, response_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256): """ Builds the Signature of the SAML Response. :param response_data: The Response parameters @@ -489,10 +524,26 @@ def add_response_signature(self, response_data, sign_algorithm=OneLogin_Saml2_Co :param sign_algorithm: Signature algorithm method :type sign_algorithm: string """ - return self.__build_signature(response_data, 'SAMLResponse', sign_algorithm) + return self._build_signature(response_data, "SAMLResponse", sign_algorithm) + + @staticmethod + def _build_sign_query_from_qs(query_string, saml_type): + """ + Build sign query from query string + + :param query_string: The query string + :type query_string: str + + :param saml_type: The target URL the user should be redirected to + :type saml_type: string SAMLRequest | SAMLResponse + """ + args = ("%s=" % saml_type, "RelayState=", "SigAlg=") + parts = query_string.split("&") + # Join in the order of arguments rather than the original order of parts. + return "&".join(part for arg in args for part in parts if part.startswith(arg)) @staticmethod - def __build_sign_query(saml_data, relay_state, algorithm, saml_type, lowercase_urlencoding=False): + def _build_sign_query(saml_data, relay_state, algorithm, saml_type, lowercase_urlencoding=False): """ Build sign query @@ -511,13 +562,13 @@ def __build_sign_query(saml_data, relay_state, algorithm, saml_type, lowercase_u :param lowercase_urlencoding: lowercase or no :type lowercase_urlencoding: boolean """ - sign_data = ['%s=%s' % (saml_type, OneLogin_Saml2_Utils.escape_url(saml_data, lowercase_urlencoding))] + sign_data = ["%s=%s" % (saml_type, OneLogin_Saml2_Utils.escape_url(saml_data, lowercase_urlencoding))] if relay_state is not None: - sign_data.append('RelayState=%s' % OneLogin_Saml2_Utils.escape_url(relay_state, lowercase_urlencoding)) - sign_data.append('SigAlg=%s' % OneLogin_Saml2_Utils.escape_url(algorithm, lowercase_urlencoding)) - return '&'.join(sign_data) + sign_data.append("RelayState=%s" % OneLogin_Saml2_Utils.escape_url(relay_state, lowercase_urlencoding)) + sign_data.append("SigAlg=%s" % OneLogin_Saml2_Utils.escape_url(algorithm, lowercase_urlencoding)) + return "&".join(sign_data) - def __build_signature(self, data, saml_type, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1): + def _build_signature(self, data, saml_type, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256): """ Builds the Signature :param data: The Request data @@ -529,32 +580,26 @@ def __build_signature(self, data, saml_type, sign_algorithm=OneLogin_Saml2_Const :param sign_algorithm: Signature algorithm method :type sign_algorithm: string """ - assert saml_type in ('SAMLRequest', 'SAMLResponse') + assert saml_type in ("SAMLRequest", "SAMLResponse") key = self.get_settings().get_sp_key() if not key: - raise OneLogin_Saml2_Error( - "Trying to sign the %s but can't load the SP private key." % saml_type, - OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND - ) + raise OneLogin_Saml2_Error("Trying to sign the %s but can't load the SP private key." % saml_type, OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND) - msg = self.__build_sign_query(data[saml_type], - data.get('RelayState', None), - sign_algorithm, - saml_type) + msg = self._build_sign_query(data[saml_type], data.get("RelayState", None), sign_algorithm, saml_type) sign_algorithm_transform_map = { OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.Transform.DSA_SHA1, OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1, OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256, OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384, - OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512 + OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512, } - sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA1) + sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA256) - signature = OneLogin_Saml2_Utils.sign_binary(msg, key, sign_algorithm_transform, self.__settings.is_debug_active()) - data['Signature'] = OneLogin_Saml2_Utils.b64encode(signature) - data['SigAlg'] = sign_algorithm + signature = OneLogin_Saml2_Utils.sign_binary(msg, key, sign_algorithm_transform, self._settings.is_debug_active()) + data["Signature"] = OneLogin_Saml2_Utils.b64encode(signature) + data["SigAlg"] = sign_algorithm def validate_request_signature(self, request_data): """ @@ -565,7 +610,7 @@ def validate_request_signature(self, request_data): """ - return self.__validate_signature(request_data, 'SAMLRequest') + return self._validate_signature(request_data, "SAMLRequest") def validate_response_signature(self, request_data): """ @@ -576,9 +621,9 @@ def validate_response_signature(self, request_data): """ - return self.__validate_signature(request_data, 'SAMLResponse') + return self._validate_signature(request_data, "SAMLResponse") - def __validate_signature(self, data, saml_type, raise_exceptions=False): + def _validate_signature(self, data, saml_type, raise_exceptions=False): """ Validate Signature @@ -595,71 +640,52 @@ def __validate_signature(self, data, saml_type, raise_exceptions=False): :type raise_exceptions: Boolean """ try: - signature = data.get('Signature', None) + signature = data.get("Signature", None) if signature is None: - if self.__settings.is_strict() and self.__settings.get_security_data().get('wantMessagesSigned', False): - raise OneLogin_Saml2_ValidationError( - 'The %s is not signed. Rejected.' % saml_type, - OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE - ) + if self._settings.is_strict() and self._settings.get_security_data().get("wantMessagesSigned", False): + raise OneLogin_Saml2_ValidationError("The %s is not signed. Rejected." % saml_type, OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE) return True idp_data = self.get_settings().get_idp_data() - exists_x509cert = 'x509cert' in idp_data and idp_data['x509cert'] - exists_multix509sign = 'x509certMulti' in idp_data and \ - 'signing' in idp_data['x509certMulti'] and \ - idp_data['x509certMulti']['signing'] + exists_x509cert = self.get_settings().get_idp_cert() is not None + exists_multix509sign = "x509certMulti" in idp_data and "signing" in idp_data["x509certMulti"] and idp_data["x509certMulti"]["signing"] if not (exists_x509cert or exists_multix509sign): - error_msg = 'In order to validate the sign on the %s, the x509cert of the IdP is required' % saml_type - self.__errors.append(error_msg) - raise OneLogin_Saml2_Error( - error_msg, - OneLogin_Saml2_Error.CERT_NOT_FOUND - ) - - sign_alg = data.get('SigAlg', OneLogin_Saml2_Constants.RSA_SHA1) + error_msg = "In order to validate the sign on the %s, the x509cert of the IdP is required" % saml_type + self._errors.append(error_msg) + raise OneLogin_Saml2_Error(error_msg, OneLogin_Saml2_Error.CERT_NOT_FOUND) + + sign_alg = data.get("SigAlg", OneLogin_Saml2_Constants.RSA_SHA1) if isinstance(sign_alg, bytes): - sign_alg = sign_alg.decode('utf8') + sign_alg = sign_alg.decode("utf8") - lowercase_urlencoding = False - if 'lowercase_urlencoding' in self.__request_data.keys(): - lowercase_urlencoding = self.__request_data['lowercase_urlencoding'] + security = self._settings.get_security_data() + reject_deprecated_alg = security.get("rejectDeprecatedAlgorithm", False) + if reject_deprecated_alg: + if sign_alg in OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS: + raise OneLogin_Saml2_ValidationError("Deprecated signature algorithm found: %s" % sign_alg, OneLogin_Saml2_ValidationError.DEPRECATED_SIGNATURE_METHOD) - signed_query = self.__build_sign_query(data[saml_type], - data.get('RelayState', None), - sign_alg, - saml_type, - lowercase_urlencoding - ) + query_string = self._request_data.get("query_string") + if query_string and self._request_data.get("validate_signature_from_qs"): + signed_query = self._build_sign_query_from_qs(query_string, saml_type) + else: + lowercase_urlencoding = self._request_data.get("lowercase_urlencoding", False) + signed_query = self._build_sign_query(data[saml_type], data.get("RelayState"), sign_alg, saml_type, lowercase_urlencoding) if exists_multix509sign: - for cert in idp_data['x509certMulti']['signing']: - if OneLogin_Saml2_Utils.validate_binary_sign(signed_query, - OneLogin_Saml2_Utils.b64decode(signature), - cert, - sign_alg): + for cert in idp_data["x509certMulti"]["signing"]: + if OneLogin_Saml2_Utils.validate_binary_sign(signed_query, OneLogin_Saml2_Utils.b64decode(signature), cert, sign_alg): return True - raise OneLogin_Saml2_ValidationError( - 'Signature validation failed. %s rejected' % saml_type, - OneLogin_Saml2_ValidationError.INVALID_SIGNATURE - ) + raise OneLogin_Saml2_ValidationError("Signature validation failed. %s rejected" % saml_type, OneLogin_Saml2_ValidationError.INVALID_SIGNATURE) else: - cert = idp_data['x509cert'] - - if not OneLogin_Saml2_Utils.validate_binary_sign(signed_query, - OneLogin_Saml2_Utils.b64decode(signature), - cert, - sign_alg, - self.__settings.is_debug_active()): - raise OneLogin_Saml2_ValidationError( - 'Signature validation failed. %s rejected' % saml_type, - OneLogin_Saml2_ValidationError.INVALID_SIGNATURE - ) + cert = self.get_settings().get_idp_cert() + + if not OneLogin_Saml2_Utils.validate_binary_sign(signed_query, OneLogin_Saml2_Utils.b64decode(signature), cert, sign_alg, self._settings.is_debug_active()): + raise OneLogin_Saml2_ValidationError("Signature validation failed. %s rejected" % saml_type, OneLogin_Saml2_ValidationError.INVALID_SIGNATURE) return True except Exception as e: - self.__error_reason = str(e) + self._error_reason = str(e) if raise_exceptions: raise e return False @@ -672,11 +698,11 @@ def get_last_response_xml(self, pretty_print_if_possible=False): :rtype: string|None """ response = None - if self.__last_response is not None: - if isinstance(self.__last_response, compat.str_type): - response = self.__last_response + if self._last_response is not None: + if isinstance(self._last_response, compat.str_type): + response = self._last_response else: - response = tostring(self.__last_response, encoding='unicode', pretty_print=pretty_print_if_possible) + response = tostring(self._last_response, encoding="unicode", pretty_print=pretty_print_if_possible) return response def get_last_request_xml(self): @@ -685,4 +711,4 @@ def get_last_request_xml(self): :returns: SAML request XML :rtype: string|None """ - return self.__last_request or None + return self._last_request or None diff --git a/src/onelogin/saml2/authn_request.py b/src/onelogin/saml2/authn_request.py index 57da1561..42585e8b 100644 --- a/src/onelogin/saml2/authn_request.py +++ b/src/onelogin/saml2/authn_request.py @@ -2,10 +2,8 @@ """ OneLogin_Saml2_Authn_Request class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -AuthNRequest class of OneLogin's Python Toolkit. +AuthNRequest class of SAML Python Toolkit. """ @@ -41,95 +39,107 @@ def __init__(self, settings, force_authn=False, is_passive=False, set_nameid_pol :param name_id_value_req: Optional argument. Indicates to the IdP the subject that should be authenticated :type name_id_value_req: string """ - self.__settings = settings + self._settings = settings - sp_data = self.__settings.get_sp_data() - idp_data = self.__settings.get_idp_data() - security = self.__settings.get_security_data() + sp_data = self._settings.get_sp_data() + idp_data = self._settings.get_idp_data() + security = self._settings.get_security_data() - uid = OneLogin_Saml2_Utils.generate_unique_id() - self.__id = uid + self._id = self._generate_request_id() issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now()) - destination = idp_data['singleSignOnService']['url'] + destination = idp_data["singleSignOnService"]["url"] - provider_name_str = '' + provider_name_str = "" organization_data = settings.get_organization() if isinstance(organization_data, dict) and organization_data: langs = organization_data - if 'en-US' in langs: - lang = 'en-US' + if "en-US" in langs: + lang = "en-US" else: lang = sorted(langs)[0] - display_name = 'displayname' in organization_data[lang] and organization_data[lang]['displayname'] + display_name = "displayname" in organization_data[lang] and organization_data[lang]["displayname"] if display_name: - provider_name_str = "\n" + ' ProviderName="%s"' % organization_data[lang]['displayname'] + provider_name_str = "\n" + ' ProviderName="%s"' % organization_data[lang]["displayname"] - force_authn_str = '' + force_authn_str = "" if force_authn is True: force_authn_str = "\n" + ' ForceAuthn="true"' - is_passive_str = '' + is_passive_str = "" if is_passive is True: is_passive_str = "\n" + ' IsPassive="true"' - subject_str = '' + subject_str = "" if name_id_value_req: subject_str = """ %s - """ % (sp_data['NameIDFormat'], name_id_value_req) + """ % ( + sp_data["NameIDFormat"], + name_id_value_req, + ) - nameid_policy_str = '' + nameid_policy_str = "" if set_nameid_policy: - name_id_policy_format = sp_data['NameIDFormat'] - if security['wantNameIdEncrypted']: + name_id_policy_format = sp_data["NameIDFormat"] + if security["wantNameIdEncrypted"]: name_id_policy_format = OneLogin_Saml2_Constants.NAMEID_ENCRYPTED - nameid_policy_str = """ + nameid_policy_str = ( + """ """ % name_id_policy_format + AllowCreate="true" />""" + % name_id_policy_format + ) - requested_authn_context_str = '' - if security['requestedAuthnContext'] is not False: - authn_comparison = 'exact' - if 'requestedAuthnContextComparison' in security.keys(): - authn_comparison = security['requestedAuthnContextComparison'] + requested_authn_context_str = "" + if security["requestedAuthnContext"] is not False: + authn_comparison = security["requestedAuthnContextComparison"] - if security['requestedAuthnContext'] is True: - requested_authn_context_str = """ + if security["requestedAuthnContext"] is True: + requested_authn_context_str = ( + """ urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport - """ % authn_comparison + """ + % authn_comparison + ) else: requested_authn_context_str = ' ' % authn_comparison - for authn_context in security['requestedAuthnContext']: - requested_authn_context_str += '%s' % authn_context - requested_authn_context_str += ' ' - - attr_consuming_service_str = '' - if 'attributeConsumingService' in sp_data and sp_data['attributeConsumingService']: - attr_consuming_service_str = "\n AttributeConsumingServiceIndex=\"1\"" - - request = OneLogin_Saml2_Templates.AUTHN_REQUEST % \ - { - 'id': uid, - 'provider_name': provider_name_str, - 'force_authn_str': force_authn_str, - 'is_passive_str': is_passive_str, - 'issue_instant': issue_instant, - 'destination': destination, - 'assertion_url': sp_data['assertionConsumerService']['url'], - 'entity_id': sp_data['entityId'], - 'subject_str': subject_str, - 'nameid_policy_str': nameid_policy_str, - 'requested_authn_context_str': requested_authn_context_str, - 'attr_consuming_service_str': attr_consuming_service_str, - } - - self.__authn_request = request + for authn_context in security["requestedAuthnContext"]: + requested_authn_context_str += "%s" % authn_context + requested_authn_context_str += " " + + attr_consuming_service_str = "" + if "attributeConsumingService" in sp_data and sp_data["attributeConsumingService"]: + attr_consuming_service_str = '\n AttributeConsumingServiceIndex="%s"' % sp_data["attributeConsumingService"].get("index", "1") + + request = OneLogin_Saml2_Templates.AUTHN_REQUEST % { + "id": self._id, + "provider_name": provider_name_str, + "force_authn_str": force_authn_str, + "is_passive_str": is_passive_str, + "issue_instant": issue_instant, + "destination": destination, + "assertion_url": sp_data["assertionConsumerService"]["url"], + "entity_id": sp_data["entityId"], + "subject_str": subject_str, + "nameid_policy_str": nameid_policy_str, + "requested_authn_context_str": requested_authn_context_str, + "attr_consuming_service_str": attr_consuming_service_str, + "acs_binding": sp_data["assertionConsumerService"].get("binding", "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"), + } + + self._authn_request = request + + def _generate_request_id(self): + """ + Generate an unique request ID. + """ + return OneLogin_Saml2_Utils.generate_unique_id() def get_request(self, deflate=True): """ @@ -140,9 +150,9 @@ def get_request(self, deflate=True): :rtype: str object """ if deflate: - request = OneLogin_Saml2_Utils.deflate_and_base64_encode(self.__authn_request) + request = OneLogin_Saml2_Utils.deflate_and_base64_encode(self._authn_request) else: - request = OneLogin_Saml2_Utils.b64encode(self.__authn_request) + request = OneLogin_Saml2_Utils.b64encode(self._authn_request) return request def get_id(self): @@ -151,7 +161,7 @@ def get_id(self): :return: AuthNRequest ID :rtype: string """ - return self.__id + return self._id def get_xml(self): """ @@ -159,4 +169,4 @@ def get_xml(self): :return: XML request body :rtype: string """ - return self.__authn_request + return self._authn_request diff --git a/src/onelogin/saml2/compat.py b/src/onelogin/saml2/compat.py index b69e61e4..138e09f8 100644 --- a/src/onelogin/saml2/compat.py +++ b/src/onelogin/saml2/compat.py @@ -2,8 +2,6 @@ """ py3 compatibility class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License """ @@ -20,25 +18,27 @@ unicode = str -if isinstance(b'', type('')): # py 2.x +if isinstance(b"", type("")): # py 2.x text_types = (basestring,) # noqa bytes_type = bytes str_type = basestring # noqa def utf8(data): - """ return utf8-encoded string """ + """return utf8-encoded string""" if isinstance(data, basestring): return data.decode("utf8") return unicode(data) def to_string(data): - """ return string """ + """return string""" if isinstance(data, unicode): return data.encode("utf8") return str(data) def to_bytes(data): - """ return bytes """ + """return bytes""" + if isinstance(data, unicode): + return data.encode("utf8") return str(data) else: # py 3.x @@ -47,7 +47,7 @@ def to_bytes(data): str_type = str def utf8(data): - """ return utf8-encoded string """ + """return utf8-encoded string""" if isinstance(data, bytes): return data.decode("utf8") return str(data) diff --git a/src/onelogin/saml2/constants.py b/src/onelogin/saml2/constants.py index e0778bd2..51392393 100644 --- a/src/onelogin/saml2/constants.py +++ b/src/onelogin/saml2/constants.py @@ -2,10 +2,8 @@ """ OneLogin_Saml2_Constants class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Constants class of OneLogin's Python Toolkit. +Constants class of SAML Python Toolkit. """ @@ -14,7 +12,7 @@ class OneLogin_Saml2_Constants(object): """ This class defines all the constants that will be used - in the OneLogin's Python Toolkit. + in the SAML Python Toolkit. """ @@ -22,95 +20,92 @@ class OneLogin_Saml2_Constants(object): ALLOWED_CLOCK_DRIFT = 300 # NameID Formats - NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' - NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName' - NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName' - NAMEID_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' - NAMEID_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos' - NAMEID_ENTITY = 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity' - NAMEID_TRANSIENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' - NAMEID_PERSISTENT = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' - NAMEID_ENCRYPTED = 'urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted' + NAMEID_EMAIL_ADDRESS = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + NAMEID_X509_SUBJECT_NAME = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName" + NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME = "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName" + NAMEID_UNSPECIFIED = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" + NAMEID_KERBEROS = "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos" + NAMEID_ENTITY = "urn:oasis:names:tc:SAML:2.0:nameid-format:entity" + NAMEID_TRANSIENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:transient" + NAMEID_PERSISTENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" + NAMEID_ENCRYPTED = "urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted" # Attribute Name Formats - ATTRNAME_FORMAT_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' - ATTRNAME_FORMAT_URI = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri' - ATTRNAME_FORMAT_BASIC = 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' + ATTRNAME_FORMAT_UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" + ATTRNAME_FORMAT_URI = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" + ATTRNAME_FORMAT_BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic" # Namespaces - NS_SAML = 'urn:oasis:names:tc:SAML:2.0:assertion' - NS_SAMLP = 'urn:oasis:names:tc:SAML:2.0:protocol' - NS_SOAP = 'http://schemas.xmlsoap.org/soap/envelope/' - NS_MD = 'urn:oasis:names:tc:SAML:2.0:metadata' - NS_XS = 'http://www.w3.org/2001/XMLSchema' - NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance' - NS_XENC = 'http://www.w3.org/2001/04/xmlenc#' - NS_DS = 'http://www.w3.org/2000/09/xmldsig#' + NS_SAML = "urn:oasis:names:tc:SAML:2.0:assertion" + NS_SAMLP = "urn:oasis:names:tc:SAML:2.0:protocol" + NS_SOAP = "http://schemas.xmlsoap.org/soap/envelope/" + NS_MD = "urn:oasis:names:tc:SAML:2.0:metadata" + NS_XS = "http://www.w3.org/2001/XMLSchema" + NS_XSI = "http://www.w3.org/2001/XMLSchema-instance" + NS_XENC = "http://www.w3.org/2001/04/xmlenc#" + NS_DS = "http://www.w3.org/2000/09/xmldsig#" # Namespace Prefixes - NS_PREFIX_SAML = 'saml' - NS_PREFIX_SAMLP = 'samlp' - NS_PREFIX_MD = 'md' - NS_PREFIX_XS = 'xs' - NS_PREFIX_XSI = 'xsi' - NS_PREFIX_XSD = 'xsd' - NS_PREFIX_XENC = 'xenc' - NS_PREFIX_DS = 'ds' + NS_PREFIX_SAML = "saml" + NS_PREFIX_SAMLP = "samlp" + NS_PREFIX_MD = "md" + NS_PREFIX_XS = "xs" + NS_PREFIX_XSI = "xsi" + NS_PREFIX_XSD = "xsd" + NS_PREFIX_XENC = "xenc" + NS_PREFIX_DS = "ds" # Prefix:Namespace Mappings - NSMAP = { - NS_PREFIX_SAMLP: NS_SAMLP, - NS_PREFIX_SAML: NS_SAML, - NS_PREFIX_DS: NS_DS, - NS_PREFIX_XENC: NS_XENC, - NS_PREFIX_MD: NS_MD - } + NSMAP = {NS_PREFIX_SAMLP: NS_SAMLP, NS_PREFIX_SAML: NS_SAML, NS_PREFIX_DS: NS_DS, NS_PREFIX_XENC: NS_XENC, NS_PREFIX_MD: NS_MD} # Bindings - BINDING_HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' - BINDING_HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' - BINDING_HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact' - BINDING_SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP' - BINDING_DEFLATE = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE' + BINDING_HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" + BINDING_HTTP_REDIRECT = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + BINDING_HTTP_ARTIFACT = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact" + BINDING_SOAP = "urn:oasis:names:tc:SAML:2.0:bindings:SOAP" + BINDING_DEFLATE = "urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE" # Auth Context Class - AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified' - AC_PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password' - AC_PASSWORD_PROTECTED = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' - AC_X509 = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509' - AC_SMARTCARD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard' - AC_KERBEROS = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos' + AC_UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified" + AC_PASSWORD = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password" + AC_PASSWORD_PROTECTED = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" + AC_X509 = "urn:oasis:names:tc:SAML:2.0:ac:classes:X509" + AC_SMARTCARD = "urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard" + AC_KERBEROS = "urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos" # Subject Confirmation - CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer' - CM_HOLDER_KEY = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key' - CM_SENDER_VOUCHES = 'urn:oasis:names:tc:SAML:2.0:cm:sender-vouches' + CM_BEARER = "urn:oasis:names:tc:SAML:2.0:cm:bearer" + CM_HOLDER_KEY = "urn:oasis:names:tc:SAML:2.0:cm:holder-of-key" + CM_SENDER_VOUCHES = "urn:oasis:names:tc:SAML:2.0:cm:sender-vouches" # Status Codes - STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success' - STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester' - STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder' - STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch' - STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive' - STATUS_PARTIAL_LOGOUT = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout' - STATUS_PROXY_COUNT_EXCEEDED = 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded' + STATUS_SUCCESS = "urn:oasis:names:tc:SAML:2.0:status:Success" + STATUS_REQUESTER = "urn:oasis:names:tc:SAML:2.0:status:Requester" + STATUS_RESPONDER = "urn:oasis:names:tc:SAML:2.0:status:Responder" + STATUS_VERSION_MISMATCH = "urn:oasis:names:tc:SAML:2.0:status:VersionMismatch" + STATUS_NO_PASSIVE = "urn:oasis:names:tc:SAML:2.0:status:NoPassive" + STATUS_PARTIAL_LOGOUT = "urn:oasis:names:tc:SAML:2.0:status:PartialLogout" + STATUS_PROXY_COUNT_EXCEEDED = "urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded" # Sign & Crypto - SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1' - SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256' - SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384' - SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512' + SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1" + SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256" + SHA384 = "http://www.w3.org/2001/04/xmldsig-more#sha384" + SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512" - DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1' - RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' - RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' - RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384' - RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512' + DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1" + RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" + RSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" + RSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384" + RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512" # Enc - TRIPLEDES_CBC = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc' - AES128_CBC = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc' - AES192_CBC = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc' - AES256_CBC = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' - RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' - RSA_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' + TRIPLEDES_CBC = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc" + AES128_CBC = "http://www.w3.org/2001/04/xmlenc#aes128-cbc" + AES192_CBC = "http://www.w3.org/2001/04/xmlenc#aes192-cbc" + AES256_CBC = "http://www.w3.org/2001/04/xmlenc#aes256-cbc" + RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5" + RSA_OAEP_MGF1P = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" + + # Define here the deprecated algorithms + DEPRECATED_ALGORITHMS = [DSA_SHA1, RSA_SHA1, SHA1] diff --git a/src/onelogin/saml2/errors.py b/src/onelogin/saml2/errors.py index 6faba2e2..bcb4890d 100644 --- a/src/onelogin/saml2/errors.py +++ b/src/onelogin/saml2/errors.py @@ -2,10 +2,8 @@ """ OneLogin_Saml2_Error class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Error class of OneLogin's Python Toolkit. +Error class of SAML Python Toolkit. Defines common Error codes and has a custom initializator. @@ -110,6 +108,8 @@ class OneLogin_Saml2_ValidationError(Exception): WRONG_NUMBER_OF_SIGNATURES = 43 RESPONSE_EXPIRED = 44 AUTHN_CONTEXT_MISMATCH = 45 + DEPRECATED_SIGNATURE_METHOD = 46 + DEPRECATED_DIGEST_METHOD = 47 def __init__(self, message, code=0, errors=None): """ diff --git a/src/onelogin/saml2/idp_metadata_parser.py b/src/onelogin/saml2/idp_metadata_parser.py index 036028a2..b3b3d9be 100644 --- a/src/onelogin/saml2/idp_metadata_parser.py +++ b/src/onelogin/saml2/idp_metadata_parser.py @@ -1,18 +1,12 @@ # -*- coding: utf-8 -*- """ OneLogin_Saml2_IdPMetadataParser class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Metadata class of OneLogin's Python Toolkit. +Metadata class of SAML Python Toolkit. """ from copy import deepcopy - -try: - import urllib.request as urllib2 -except ImportError: - import urllib2 +from urllib.request import Request, urlopen import ssl @@ -23,10 +17,21 @@ class OneLogin_Saml2_IdPMetadataParser(object): """ A class that contain methods related to obtaining and parsing metadata from IdP + + This class does not validate in any way the URL that is introduced, + make sure to validate it properly before use it in a get_metadata method. """ - @staticmethod - def get_metadata(url, validate_cert=True): + @classmethod + def get_metadata( + cls, + url, + validate_cert=True, + cafile=None, + capath=None, + timeout=None, + headers=None, + ): """ Gets the metadata XML from the provided URL :param url: Url where the XML of the Identity Provider Metadata is published. @@ -35,36 +40,48 @@ def get_metadata(url, validate_cert=True): :param validate_cert: If the url uses https schema, that flag enables or not the verification of the associated certificate. :type validate_cert: bool + :param timeout: Timeout in seconds to wait for metadata response + :type timeout: int + :param headers: Extra headers to send in the request + :type headers: dict + :returns: metadata XML :rtype: string """ valid = False - if validate_cert: - response = urllib2.urlopen(url) - else: + # Respect the no-TLS-certificate validation option + ctx = None + if not validate_cert: + if cafile or capath: + raise ValueError( + "Specifying 'cafile' or 'capath' while disabling certificate " + "validation is contradictory." + ) ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE - response = urllib2.urlopen(url, context=ctx) + + request = Request(url, headers=headers or {}) + response = urlopen(request, timeout=timeout, cafile=cafile, capath=capath, context=ctx) xml = response.read() if xml: try: dom = OneLogin_Saml2_XML.to_etree(xml) - idp_descriptor_nodes = OneLogin_Saml2_XML.query(dom, '//md:IDPSSODescriptor') + idp_descriptor_nodes = OneLogin_Saml2_XML.query(dom, "//md:IDPSSODescriptor") if idp_descriptor_nodes: valid = True except Exception: pass if not valid: - raise Exception('Not valid IdP XML found from URL: %s' % (url)) + raise Exception("Not valid IdP XML found from URL: %s" % (url)) return xml - @staticmethod - def parse_remote(url, validate_cert=True, entity_id=None, **kwargs): + @classmethod + def parse_remote(cls, url, validate_cert=True, entity_id=None, timeout=None, **kwargs): """ Gets the metadata XML from the provided URL and parse it, returning a dict with extracted data :param url: Url where the XML of the Identity Provider Metadata is published. @@ -77,18 +94,17 @@ def parse_remote(url, validate_cert=True, entity_id=None, **kwargs): that contains multiple EntityDescriptor. :type entity_id: string + :param timeout: Timeout in seconds to wait for metadata response + :type timeout: int + :returns: settings dict with extracted data :rtype: dict """ - idp_metadata = OneLogin_Saml2_IdPMetadataParser.get_metadata(url, validate_cert) - return OneLogin_Saml2_IdPMetadataParser.parse(idp_metadata, entity_id=entity_id, **kwargs) + idp_metadata = cls.get_metadata(url, validate_cert, timeout, headers=kwargs.pop("headers", None)) + return cls.parse(idp_metadata, entity_id=entity_id, **kwargs) - @staticmethod - def parse( - idp_metadata, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, - required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, - entity_id=None): + @classmethod + def parse(cls, idp_metadata, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, entity_id=None): """ Parses the Identity Provider metadata and return a dict with extracted data. @@ -127,40 +143,34 @@ def parse( dom = OneLogin_Saml2_XML.to_etree(idp_metadata) idp_entity_id = want_authn_requests_signed = idp_name_id_format = idp_sso_url = idp_slo_url = certs = None - entity_desc_path = '//md:EntityDescriptor' + entity_desc_path = "//md:EntityDescriptor" if entity_id: entity_desc_path += "[@entityID='%s']" % entity_id entity_descriptor_nodes = OneLogin_Saml2_XML.query(dom, entity_desc_path) if len(entity_descriptor_nodes) > 0: entity_descriptor_node = entity_descriptor_nodes[0] - idp_descriptor_nodes = OneLogin_Saml2_XML.query(entity_descriptor_node, './md:IDPSSODescriptor') + idp_descriptor_nodes = OneLogin_Saml2_XML.query(entity_descriptor_node, "./md:IDPSSODescriptor") if len(idp_descriptor_nodes) > 0: idp_descriptor_node = idp_descriptor_nodes[0] - idp_entity_id = entity_descriptor_node.get('entityID', None) + idp_entity_id = entity_descriptor_node.get("entityID", None) - want_authn_requests_signed = entity_descriptor_node.get('WantAuthnRequestsSigned', None) + want_authn_requests_signed = idp_descriptor_node.get("WantAuthnRequestsSigned", None) - name_id_format_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, './md:NameIDFormat') + name_id_format_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:NameIDFormat") if len(name_id_format_nodes) > 0: idp_name_id_format = OneLogin_Saml2_XML.element_text(name_id_format_nodes[0]) - sso_nodes = OneLogin_Saml2_XML.query( - idp_descriptor_node, - "./md:SingleSignOnService[@Binding='%s']" % required_sso_binding - ) + sso_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:SingleSignOnService[@Binding='%s']" % required_sso_binding) if len(sso_nodes) > 0: - idp_sso_url = sso_nodes[0].get('Location', None) + idp_sso_url = sso_nodes[0].get("Location", None) - slo_nodes = OneLogin_Saml2_XML.query( - idp_descriptor_node, - "./md:SingleLogoutService[@Binding='%s']" % required_slo_binding - ) + slo_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:SingleLogoutService[@Binding='%s']" % required_slo_binding) if len(slo_nodes) > 0: - idp_slo_url = slo_nodes[0].get('Location', None) + idp_slo_url = slo_nodes[0].get("Location", None) signing_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:KeyDescriptor[not(contains(@use, 'encryption'))]/ds:KeyInfo/ds:X509Data/ds:X509Certificate") encryption_nodes = OneLogin_Saml2_XML.query(idp_descriptor_node, "./md:KeyDescriptor[not(contains(@use, 'signing'))]/ds:KeyInfo/ds:X509Data/ds:X509Certificate") @@ -168,50 +178,47 @@ def parse( if len(signing_nodes) > 0 or len(encryption_nodes) > 0: certs = {} if len(signing_nodes) > 0: - certs['signing'] = [] + certs["signing"] = [] for cert_node in signing_nodes: - certs['signing'].append(''.join(OneLogin_Saml2_XML.element_text(cert_node).split())) + certs["signing"].append("".join(OneLogin_Saml2_XML.element_text(cert_node).split())) if len(encryption_nodes) > 0: - certs['encryption'] = [] + certs["encryption"] = [] for cert_node in encryption_nodes: - certs['encryption'].append(''.join(OneLogin_Saml2_XML.element_text(cert_node).split())) + certs["encryption"].append("".join(OneLogin_Saml2_XML.element_text(cert_node).split())) - data['idp'] = {} + data["idp"] = {} if idp_entity_id is not None: - data['idp']['entityId'] = idp_entity_id + data["idp"]["entityId"] = idp_entity_id if idp_sso_url is not None: - data['idp']['singleSignOnService'] = {} - data['idp']['singleSignOnService']['url'] = idp_sso_url - data['idp']['singleSignOnService']['binding'] = required_sso_binding + data["idp"]["singleSignOnService"] = {} + data["idp"]["singleSignOnService"]["url"] = idp_sso_url + data["idp"]["singleSignOnService"]["binding"] = required_sso_binding if idp_slo_url is not None: - data['idp']['singleLogoutService'] = {} - data['idp']['singleLogoutService']['url'] = idp_slo_url - data['idp']['singleLogoutService']['binding'] = required_slo_binding + data["idp"]["singleLogoutService"] = {} + data["idp"]["singleLogoutService"]["url"] = idp_slo_url + data["idp"]["singleLogoutService"]["binding"] = required_slo_binding if want_authn_requests_signed is not None: - data['security'] = {} - data['security']['authnRequestsSigned'] = want_authn_requests_signed + data["security"] = {} + data["security"]["authnRequestsSigned"] = want_authn_requests_signed == "true" if idp_name_id_format: - data['sp'] = {} - data['sp']['NameIDFormat'] = idp_name_id_format + data["sp"] = {} + data["sp"]["NameIDFormat"] = idp_name_id_format if certs is not None: - if (len(certs) == 1 and - (('signing' in certs and len(certs['signing']) == 1) or - ('encryption' in certs and len(certs['encryption']) == 1))) or \ - (('signing' in certs and len(certs['signing']) == 1) and - ('encryption' in certs and len(certs['encryption']) == 1 and - certs['signing'][0] == certs['encryption'][0])): - if 'signing' in certs: - data['idp']['x509cert'] = certs['signing'][0] + if (len(certs) == 1 and (("signing" in certs and len(certs["signing"]) == 1) or ("encryption" in certs and len(certs["encryption"]) == 1))) or ( + ("signing" in certs and len(certs["signing"]) == 1) and ("encryption" in certs and len(certs["encryption"]) == 1 and certs["signing"][0] == certs["encryption"][0]) + ): + if "signing" in certs: + data["idp"]["x509cert"] = certs["signing"][0] else: - data['idp']['x509cert'] = certs['encryption'][0] + data["idp"]["x509cert"] = certs["encryption"][0] else: - data['idp']['x509certMulti'] = certs + data["idp"]["x509certMulti"] = certs return data @staticmethod @@ -219,26 +226,26 @@ def merge_settings(settings, new_metadata_settings): """ Will update the settings with the provided new settings data extracted from the IdP metadata :param settings: Current settings dict data - :type settings: string + :type settings: dict :param new_metadata_settings: Settings to be merged (extracted from IdP metadata after parsing) - :type new_metadata_settings: string + :type new_metadata_settings: dict :returns: merged settings :rtype: dict """ for d in (settings, new_metadata_settings): if not isinstance(d, dict): - raise TypeError('Both arguments must be dictionaries.') + raise TypeError("Both arguments must be dictionaries.") # Guarantee to not modify original data (`settings.copy()` would not # be sufficient, as it's just a shallow copy). result_settings = deepcopy(settings) # previously I will take care of cert stuff - if 'idp' in new_metadata_settings and 'idp' in result_settings: - if new_metadata_settings['idp'].get('x509cert', None) and result_settings['idp'].get('x509certMulti', None): - del result_settings['idp']['x509certMulti'] - if new_metadata_settings['idp'].get('x509certMulti', None) and result_settings['idp'].get('x509cert', None): - del result_settings['idp']['x509cert'] + if "idp" in new_metadata_settings and "idp" in result_settings: + if new_metadata_settings["idp"].get("x509cert", None) and result_settings["idp"].get("x509certMulti", None): + del result_settings["idp"]["x509certMulti"] + if new_metadata_settings["idp"].get("x509certMulti", None) and result_settings["idp"].get("x509cert", None): + del result_settings["idp"]["x509cert"] # Merge `new_metadata_settings` into `result_settings`. dict_deep_merge(result_settings, new_metadata_settings) diff --git a/src/onelogin/saml2/logout_request.py b/src/onelogin/saml2/logout_request.py index 252726b7..dea7f806 100644 --- a/src/onelogin/saml2/logout_request.py +++ b/src/onelogin/saml2/logout_request.py @@ -2,10 +2,8 @@ """ OneLogin_Saml2_Logout_Request class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Logout Request class of OneLogin's Python Toolkit. +Logout Request class of SAML Python Toolkit. """ @@ -50,35 +48,32 @@ def __init__(self, settings, request=None, name_id=None, session_index=None, nq= :param spnq: SP Name Qualifier :type: string """ - self.__settings = settings - self.__error = None + self._settings = settings + self._error = None self.id = None if request is None: - sp_data = self.__settings.get_sp_data() - idp_data = self.__settings.get_idp_data() - security = self.__settings.get_security_data() + sp_data = self._settings.get_sp_data() + idp_data = self._settings.get_idp_data() + security = self._settings.get_security_data() - uid = OneLogin_Saml2_Utils.generate_unique_id() - self.id = uid + self.id = self._generate_request_id() issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now()) cert = None - if security['nameIdEncrypted']: - exists_multix509enc = 'x509certMulti' in idp_data and \ - 'encryption' in idp_data['x509certMulti'] and \ - idp_data['x509certMulti']['encryption'] + if security["nameIdEncrypted"]: + exists_multix509enc = "x509certMulti" in idp_data and "encryption" in idp_data["x509certMulti"] and idp_data["x509certMulti"]["encryption"] if exists_multix509enc: - cert = idp_data['x509certMulti']['encryption'][0] + cert = idp_data["x509certMulti"]["encryption"][0] else: - cert = idp_data['x509cert'] + cert = self._settings.get_idp_cert() if name_id is not None: - if not name_id_format and sp_data['NameIDFormat'] != OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED: - name_id_format = sp_data['NameIDFormat'] + if not name_id_format and sp_data["NameIDFormat"] != OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED: + name_id_format = sp_data["NameIDFormat"] else: - name_id = idp_data['entityId'] + name_id = idp_data["entityId"] name_id_format = OneLogin_Saml2_Constants.NAMEID_ENTITY # From saml-core-2.0-os 8.3.6, when the entity Format is used: @@ -92,34 +87,26 @@ def __init__(self, settings, request=None, name_id=None, session_index=None, nq= if name_id_format and name_id_format == OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED: name_id_format = None - name_id_obj = OneLogin_Saml2_Utils.generate_name_id( - name_id, - spnq, - name_id_format, - cert, - False, - nq - ) + name_id_obj = OneLogin_Saml2_Utils.generate_name_id(name_id, spnq, name_id_format, cert, False, nq) if session_index: - session_index_str = '%s' % session_index + session_index_str = "%s" % session_index else: - session_index_str = '' - - logout_request = OneLogin_Saml2_Templates.LOGOUT_REQUEST % \ - { - 'id': uid, - 'issue_instant': issue_instant, - 'single_logout_url': idp_data['singleLogoutService']['url'], - 'entity_id': sp_data['entityId'], - 'name_id': name_id_obj, - 'session_index': session_index_str, - } + session_index_str = "" + + logout_request = OneLogin_Saml2_Templates.LOGOUT_REQUEST % { + "id": self.id, + "issue_instant": issue_instant, + "single_logout_url": self._settings.get_idp_slo_url(), + "entity_id": sp_data["entityId"], + "name_id": name_id_obj, + "session_index": session_index_str, + } else: logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(request, ignore_zip=True) self.id = self.get_id(logout_request) - self.__logout_request = compat.to_string(logout_request) + self._logout_request = compat.to_string(logout_request) def get_request(self, deflate=True): """ @@ -130,9 +117,9 @@ def get_request(self, deflate=True): :rtype: str object """ if deflate: - request = OneLogin_Saml2_Utils.deflate_and_base64_encode(self.__logout_request) + request = OneLogin_Saml2_Utils.deflate_and_base64_encode(self._logout_request) else: - request = OneLogin_Saml2_Utils.b64encode(self.__logout_request) + request = OneLogin_Saml2_Utils.b64encode(self._logout_request) return request def get_xml(self): @@ -142,10 +129,10 @@ def get_xml(self): :return: XML request body :rtype: string """ - return self.__logout_request + return self._logout_request - @staticmethod - def get_id(request): + @classmethod + def get_id(cls, request): """ Returns the ID of the Logout Request :param request: Logout Request Message @@ -155,10 +142,10 @@ def get_id(request): """ elem = OneLogin_Saml2_XML.to_etree(request) - return elem.get('ID', None) + return elem.get("ID", None) - @staticmethod - def get_nameid_data(request, key=None): + @classmethod + def get_nameid_data(cls, request, key=None): """ Gets the NameID Data of the the Logout Request :param request: Logout Request Message @@ -170,41 +157,33 @@ def get_nameid_data(request, key=None): """ elem = OneLogin_Saml2_XML.to_etree(request) name_id = None - encrypted_entries = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:EncryptedID') + encrypted_entries = OneLogin_Saml2_XML.query(elem, "/samlp:LogoutRequest/saml:EncryptedID") if len(encrypted_entries) == 1: if key is None: - raise OneLogin_Saml2_Error( - 'Private Key is required in order to decrypt the NameID, check settings', - OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND - ) + raise OneLogin_Saml2_Error("Private Key is required in order to decrypt the NameID, check settings", OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND) - encrypted_data_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:EncryptedID/xenc:EncryptedData') + encrypted_data_nodes = OneLogin_Saml2_XML.query(elem, "/samlp:LogoutRequest/saml:EncryptedID/xenc:EncryptedData") if len(encrypted_data_nodes) == 1: encrypted_data = encrypted_data_nodes[0] name_id = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key) else: - entries = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:NameID') + entries = OneLogin_Saml2_XML.query(elem, "/samlp:LogoutRequest/saml:NameID") if len(entries) == 1: name_id = entries[0] if name_id is None: - raise OneLogin_Saml2_ValidationError( - 'NameID not found in the Logout Request', - OneLogin_Saml2_ValidationError.NO_NAMEID - ) - - name_id_data = { - 'Value': OneLogin_Saml2_XML.element_text(name_id) - } - for attr in ['Format', 'SPNameQualifier', 'NameQualifier']: + raise OneLogin_Saml2_ValidationError("NameID not found in the Logout Request", OneLogin_Saml2_ValidationError.NO_NAMEID) + + name_id_data = {"Value": OneLogin_Saml2_XML.element_text(name_id)} + for attr in ["Format", "SPNameQualifier", "NameQualifier"]: if attr in name_id.attrib: name_id_data[attr] = name_id.attrib[attr] return name_id_data - @staticmethod - def get_nameid(request, key=None): + @classmethod + def get_nameid(cls, request, key=None): """ Gets the NameID of the Logout Request Message :param request: Logout Request Message @@ -214,11 +193,11 @@ def get_nameid(request, key=None): :return: Name ID Value :rtype: string """ - name_id = OneLogin_Saml2_Logout_Request.get_nameid_data(request, key) - return name_id['Value'] + name_id = cls.get_nameid_data(request, key) + return name_id["Value"] - @staticmethod - def get_nameid_format(request, key=None): + @classmethod + def get_nameid_format(cls, request, key=None): """ Gets the NameID Format of the Logout Request Message :param request: Logout Request Message @@ -229,13 +208,13 @@ def get_nameid_format(request, key=None): :rtype: string """ name_id_format = None - name_id_data = OneLogin_Saml2_Logout_Request.get_nameid_data(request, key) - if name_id_data and 'Format' in name_id_data.keys(): - name_id_format = name_id_data['Format'] + name_id_data = cls.get_nameid_data(request, key) + if name_id_data and "Format" in name_id_data.keys(): + name_id_format = name_id_data["Format"] return name_id_format - @staticmethod - def get_issuer(request): + @classmethod + def get_issuer(cls, request): """ Gets the Issuer of the Logout Request Message :param request: Logout Request Message @@ -246,13 +225,13 @@ def get_issuer(request): elem = OneLogin_Saml2_XML.to_etree(request) issuer = None - issuer_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:Issuer') + issuer_nodes = OneLogin_Saml2_XML.query(elem, "/samlp:LogoutRequest/saml:Issuer") if len(issuer_nodes) == 1: issuer = OneLogin_Saml2_XML.element_text(issuer_nodes[0]) return issuer - @staticmethod - def get_session_indexes(request): + @classmethod + def get_session_indexes(cls, request): """ Gets the SessionIndexes from the Logout Request :param request: Logout Request Message @@ -263,7 +242,7 @@ def get_session_indexes(request): elem = OneLogin_Saml2_XML.to_etree(request) session_indexes = [] - session_index_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/samlp:SessionIndex') + session_index_nodes = OneLogin_Saml2_XML.query(elem, "/samlp:LogoutRequest/samlp:SessionIndex") for session_index_node in session_index_nodes: session_indexes.append(OneLogin_Saml2_XML.element_text(session_index_node)) return session_indexes @@ -280,75 +259,61 @@ def is_valid(self, request_data, raise_exceptions=False): :return: If the Logout Request is or not valid :rtype: boolean """ - self.__error = None + self._error = None try: - root = OneLogin_Saml2_XML.to_etree(self.__logout_request) + root = OneLogin_Saml2_XML.to_etree(self._logout_request) - idp_data = self.__settings.get_idp_data() - idp_entity_id = idp_data['entityId'] + idp_data = self._settings.get_idp_data() + idp_entity_id = idp_data["entityId"] - get_data = ('get_data' in request_data and request_data['get_data']) or dict() + get_data = ("get_data" in request_data and request_data["get_data"]) or dict() - if self.__settings.is_strict(): - res = OneLogin_Saml2_XML.validate_xml(root, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active()) + if self._settings.is_strict(): + res = OneLogin_Saml2_XML.validate_xml(root, "saml-schema-protocol-2.0.xsd", self._settings.is_debug_active()) if isinstance(res, str): - raise OneLogin_Saml2_ValidationError( - 'Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd', - OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT - ) + raise OneLogin_Saml2_ValidationError("Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd", OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT) - security = self.__settings.get_security_data() + security = self._settings.get_security_data() current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) # Check NotOnOrAfter - if root.get('NotOnOrAfter', None): - na = OneLogin_Saml2_Utils.parse_SAML_to_time(root.get('NotOnOrAfter')) + if root.get("NotOnOrAfter", None): + na = OneLogin_Saml2_Utils.parse_SAML_to_time(root.get("NotOnOrAfter")) if na <= OneLogin_Saml2_Utils.now(): - raise OneLogin_Saml2_ValidationError( - 'Could not validate timestamp: expired. Check system clock.)', - OneLogin_Saml2_ValidationError.RESPONSE_EXPIRED - ) + raise OneLogin_Saml2_ValidationError("Could not validate timestamp: expired. Check system clock.)", OneLogin_Saml2_ValidationError.RESPONSE_EXPIRED) # Check destination - if root.get('Destination', None): - destination = root.get('Destination') - if destination != '': - if current_url not in destination: - raise OneLogin_Saml2_ValidationError( - 'The LogoutRequest was received at ' - '%(currentURL)s instead of %(destination)s' % - { - 'currentURL': current_url, - 'destination': destination, - }, - OneLogin_Saml2_ValidationError.WRONG_DESTINATION - ) + destination = root.get("Destination", None) + if destination: + if not OneLogin_Saml2_Utils.normalize_url(url=destination).startswith(OneLogin_Saml2_Utils.normalize_url(url=current_url)): + raise OneLogin_Saml2_ValidationError( + "The LogoutRequest was received at " + "%(currentURL)s instead of %(destination)s" + % { + "currentURL": current_url, + "destination": destination, + }, + OneLogin_Saml2_ValidationError.WRONG_DESTINATION, + ) # Check issuer - issuer = OneLogin_Saml2_Logout_Request.get_issuer(root) + issuer = self.get_issuer(root) if issuer is not None and issuer != idp_entity_id: raise OneLogin_Saml2_ValidationError( - 'Invalid issuer in the Logout Request (expected %(idpEntityId)s, got %(issuer)s)' % - { - 'idpEntityId': idp_entity_id, - 'issuer': issuer - }, - OneLogin_Saml2_ValidationError.WRONG_ISSUER + "Invalid issuer in the Logout Request (expected %(idpEntityId)s, got %(issuer)s)" % {"idpEntityId": idp_entity_id, "issuer": issuer}, + OneLogin_Saml2_ValidationError.WRONG_ISSUER, ) - if security['wantMessagesSigned']: - if 'Signature' not in get_data: - raise OneLogin_Saml2_ValidationError( - 'The Message of the Logout Request is not signed and the SP require it', - OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE - ) + if security["wantMessagesSigned"]: + if "Signature" not in get_data: + raise OneLogin_Saml2_ValidationError("The Message of the Logout Request is not signed and the SP require it", OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE) return True except Exception as err: # pylint: disable=R0801 - self.__error = str(err) - debug = self.__settings.is_debug_active() + self._error = str(err) + debug = self._settings.is_debug_active() if debug: print(err) if raise_exceptions: @@ -359,4 +324,10 @@ def get_error(self): """ After executing a validation process, if it fails this method returns the cause """ - return self.__error + return self._error + + def _generate_request_id(self): + """ + Generate an unique logout request ID. + """ + return OneLogin_Saml2_Utils.generate_unique_id() diff --git a/src/onelogin/saml2/logout_response.py b/src/onelogin/saml2/logout_response.py index 6dd0a6d8..573a4d5d 100644 --- a/src/onelogin/saml2/logout_response.py +++ b/src/onelogin/saml2/logout_response.py @@ -2,14 +2,13 @@ """ OneLogin_Saml2_Logout_Response class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Logout Response class of OneLogin's Python Toolkit. +Logout Response class of SAML Python Toolkit. """ from onelogin.saml2 import compat +from onelogin.saml2.constants import OneLogin_Saml2_Constants from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_ValidationError from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates from onelogin.saml2.xml_utils import OneLogin_Saml2_XML @@ -33,14 +32,14 @@ def __init__(self, settings, response=None): * (string) response. An UUEncoded SAML Logout response from the IdP. """ - self.__settings = settings - self.__error = None + self._settings = settings + self._error = None self.id = None if response is not None: - self.__logout_response = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(response, ignore_zip=True)) - self.document = OneLogin_Saml2_XML.to_etree(self.__logout_response) - self.id = self.document.get('ID', None) + self._logout_response = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(response, ignore_zip=True)) + self.document = OneLogin_Saml2_XML.to_etree(self._logout_response) + self.id = self.document.get("ID", None) def get_issuer(self): """ @@ -49,7 +48,7 @@ def get_issuer(self): :rtype: string """ issuer = None - issuer_nodes = self.__query('/samlp:LogoutResponse/saml:Issuer') + issuer_nodes = self._query("/samlp:LogoutResponse/saml:Issuer") if len(issuer_nodes) == 1: issuer = OneLogin_Saml2_XML.element_text(issuer_nodes[0]) return issuer @@ -60,10 +59,10 @@ def get_status(self): :return: The Status :rtype: string """ - entries = self.__query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode') + entries = self._query("/samlp:LogoutResponse/samlp:Status/samlp:StatusCode") if len(entries) == 0: return None - status = entries[0].attrib['Value'] + status = entries[0].attrib["Value"] return status def is_valid(self, request_data, request_id=None, raise_exceptions=False): @@ -78,70 +77,58 @@ def is_valid(self, request_data, request_id=None, raise_exceptions=False): :return: Returns if the SAML LogoutResponse is or not valid :rtype: boolean """ - self.__error = None + self._error = None try: - idp_data = self.__settings.get_idp_data() - idp_entity_id = idp_data['entityId'] - get_data = request_data['get_data'] + idp_data = self._settings.get_idp_data() + idp_entity_id = idp_data["entityId"] + get_data = request_data["get_data"] - if self.__settings.is_strict(): - res = OneLogin_Saml2_XML.validate_xml(self.document, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active()) + if self._settings.is_strict(): + res = OneLogin_Saml2_XML.validate_xml(self.document, "saml-schema-protocol-2.0.xsd", self._settings.is_debug_active()) if isinstance(res, str): - raise OneLogin_Saml2_ValidationError( - 'Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd', - OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT - ) + raise OneLogin_Saml2_ValidationError("Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd", OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT) - security = self.__settings.get_security_data() + security = self._settings.get_security_data() # Check if the InResponseTo of the Logout Response matches the ID of the Logout Request (requestId) if provided in_response_to = self.get_in_response_to() if request_id is not None and in_response_to and in_response_to != request_id: raise OneLogin_Saml2_ValidationError( - 'The InResponseTo of the Logout Response: %s, does not match the ID of the Logout request sent by the SP: %s' % (in_response_to, request_id), - OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO + "The InResponseTo of the Logout Response: %s, does not match the ID of the Logout request sent by the SP: %s" % (in_response_to, request_id), + OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO, ) # Check issuer issuer = self.get_issuer() if issuer is not None and issuer != idp_entity_id: raise OneLogin_Saml2_ValidationError( - 'Invalid issuer in the Logout Response (expected %(idpEntityId)s, got %(issuer)s)' % - { - 'idpEntityId': idp_entity_id, - 'issuer': issuer - }, - OneLogin_Saml2_ValidationError.WRONG_ISSUER + "Invalid issuer in the Logout Response (expected %(idpEntityId)s, got %(issuer)s)" % {"idpEntityId": idp_entity_id, "issuer": issuer}, + OneLogin_Saml2_ValidationError.WRONG_ISSUER, ) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) # Check destination - destination = self.document.get('Destination', None) - if destination and current_url not in destination: - raise OneLogin_Saml2_ValidationError( - 'The LogoutResponse was received at %s instead of %s' % (current_url, destination), - OneLogin_Saml2_ValidationError.WRONG_DESTINATION - ) - - if security['wantMessagesSigned']: - if 'Signature' not in get_data: - raise OneLogin_Saml2_ValidationError( - 'The Message of the Logout Response is not signed and the SP require it', - OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE - ) + destination = self.document.get("Destination", None) + if destination: + if not OneLogin_Saml2_Utils.normalize_url(url=destination).startswith(OneLogin_Saml2_Utils.normalize_url(url=current_url)): + raise OneLogin_Saml2_ValidationError("The LogoutResponse was received at %s instead of %s" % (current_url, destination), OneLogin_Saml2_ValidationError.WRONG_DESTINATION) + + if security["wantMessagesSigned"]: + if "Signature" not in get_data: + raise OneLogin_Saml2_ValidationError("The Message of the Logout Response is not signed and the SP require it", OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE) return True # pylint: disable=R0801 except Exception as err: - self.__error = str(err) - debug = self.__settings.is_debug_active() + self._error = str(err) + debug = self._settings.is_debug_active() if debug: print(err) if raise_exceptions: raise return False - def __query(self, query): + def _query(self, query): """ Extracts a node from the Etree (Logout Response Message) :param query: Xpath Expression @@ -151,29 +138,30 @@ def __query(self, query): """ return OneLogin_Saml2_XML.query(self.document, query) - def build(self, in_response_to): + def build(self, in_response_to, status=OneLogin_Saml2_Constants.STATUS_SUCCESS): """ Creates a Logout Response object. :param in_response_to: InResponseTo value for the Logout Response. :type in_response_to: string + :param: status: The status of the response + :type: status: string """ - sp_data = self.__settings.get_sp_data() - idp_data = self.__settings.get_idp_data() + sp_data = self._settings.get_sp_data() + + self.id = self._generate_request_id() - uid = OneLogin_Saml2_Utils.generate_unique_id() issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now()) - logout_response = OneLogin_Saml2_Templates.LOGOUT_RESPONSE % \ - { - 'id': uid, - 'issue_instant': issue_instant, - 'destination': idp_data['singleLogoutService']['url'], - 'in_response_to': in_response_to, - 'entity_id': sp_data['entityId'], - 'status': "urn:oasis:names:tc:SAML:2.0:status:Success" - } + logout_response = OneLogin_Saml2_Templates.LOGOUT_RESPONSE % { + "id": self.id, + "issue_instant": issue_instant, + "destination": self._settings.get_idp_slo_response_url(), + "in_response_to": in_response_to, + "entity_id": sp_data["entityId"], + "status": status, + } - self.__logout_response = logout_response + self._logout_response = logout_response def get_in_response_to(self): """ @@ -181,7 +169,7 @@ def get_in_response_to(self): :returns: ID of LogoutRequest this LogoutResponse is in response to or None if it is not present :rtype: str """ - return self.document.get('InResponseTo') + return self.document.get("InResponseTo") def get_response(self, deflate=True): """ @@ -192,16 +180,16 @@ def get_response(self, deflate=True): :rtype: string """ if deflate: - response = OneLogin_Saml2_Utils.deflate_and_base64_encode(self.__logout_response) + response = OneLogin_Saml2_Utils.deflate_and_base64_encode(self._logout_response) else: - response = OneLogin_Saml2_Utils.b64encode(self.__logout_response) + response = OneLogin_Saml2_Utils.b64encode(self._logout_response) return response def get_error(self): """ After executing a validation process, if it fails this method returns the cause """ - return self.__error + return self._error def get_xml(self): """ @@ -210,4 +198,10 @@ def get_xml(self): :return: XML response body :rtype: string """ - return self.__logout_response + return self._logout_response + + def _generate_request_id(self): + """ + Generate an unique logout response ID. + """ + return OneLogin_Saml2_Utils.generate_unique_id() diff --git a/src/onelogin/saml2/metadata.py b/src/onelogin/saml2/metadata.py index 0aab105c..d6f1d6ae 100644 --- a/src/onelogin/saml2/metadata.py +++ b/src/onelogin/saml2/metadata.py @@ -2,10 +2,8 @@ """ OneLoginSaml2Metadata class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Metadata class of OneLogin's Python Toolkit. +Metadata class of SAML Python Toolkit. """ @@ -31,11 +29,11 @@ class OneLogin_Saml2_Metadata(object): """ - TIME_VALID = 172800 # 2 days + TIME_VALID = 172800 # 2 days TIME_CACHED = 604800 # 1 week - @staticmethod - def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None): + @classmethod + def builder(cls, sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None): """ Builds the metadata of the SP @@ -61,20 +59,20 @@ def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=N :type organization: dict """ if valid_until is None: - valid_until = int(time()) + OneLogin_Saml2_Metadata.TIME_VALID + valid_until = int(time()) + cls.TIME_VALID if not isinstance(valid_until, basestring): if isinstance(valid_until, datetime): valid_until_time = valid_until.timetuple() else: valid_until_time = gmtime(valid_until) - valid_until_str = strftime(r'%Y-%m-%dT%H:%M:%SZ', valid_until_time) + valid_until_str = strftime(r"%Y-%m-%dT%H:%M:%SZ", valid_until_time) else: valid_until_str = valid_until if cache_duration is None: - cache_duration = OneLogin_Saml2_Metadata.TIME_CACHED + cache_duration = cls.TIME_CACHED if not isinstance(cache_duration, compat.str_type): - cache_duration_str = 'PT%sS' % cache_duration # Period of Time x Seconds + cache_duration_str = "PT%sS" % cache_duration # Period of Time x Seconds else: cache_duration_str = cache_duration @@ -83,116 +81,117 @@ def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=N if organization is None: organization = {} - sls = '' - if 'singleLogoutService' in sp and 'url' in sp['singleLogoutService']: - sls = OneLogin_Saml2_Templates.MD_SLS % \ - { - 'binding': sp['singleLogoutService']['binding'], - 'location': sp['singleLogoutService']['url'], - } + sls = "" + if "singleLogoutService" in sp and "url" in sp["singleLogoutService"]: + sls = OneLogin_Saml2_Templates.MD_SLS % { + "binding": sp["singleLogoutService"]["binding"], + "location": sp["singleLogoutService"]["url"], + } - str_authnsign = 'true' if authnsign else 'false' - str_wsign = 'true' if wsign else 'false' + str_authnsign = "true" if authnsign else "false" + str_wsign = "true" if wsign else "false" - str_organization = '' + str_organization = "" if len(organization) > 0: organization_names = [] organization_displaynames = [] organization_urls = [] - for (lang, info) in organization.items(): - organization_names.append(""" %s""" % (lang, info['name'])) - organization_displaynames.append(""" %s""" % (lang, info['displayname'])) - organization_urls.append(""" %s""" % (lang, info['url'])) - org_data = '\n'.join(organization_names) + '\n' + '\n'.join(organization_displaynames) + '\n' + '\n'.join(organization_urls) - str_organization = """ \n%(org)s\n """ % {'org': org_data} - - str_contacts = '' + for lang, info in organization.items(): + organization_names.append(""" %s""" % (lang, info["name"])) + organization_displaynames.append(""" %s""" % (lang, info["displayname"])) + organization_urls.append(""" %s""" % (lang, info["url"])) + org_data = "\n".join(organization_names) + "\n" + "\n".join(organization_displaynames) + "\n" + "\n".join(organization_urls) + str_organization = """ \n%(org)s\n """ % {"org": org_data} + + str_contacts = "" if len(contacts) > 0: contacts_info = [] - for (ctype, info) in contacts.items(): - contact = OneLogin_Saml2_Templates.MD_CONTACT_PERSON % \ - { - 'type': ctype, - 'name': info['givenName'], - 'email': info['emailAddress'], - } + for ctype, info in contacts.items(): + contact = OneLogin_Saml2_Templates.MD_CONTACT_PERSON % { + "type": ctype, + "name": info["givenName"], + "email": info["emailAddress"], + } contacts_info.append(contact) - str_contacts = '\n'.join(contacts_info) - - str_attribute_consuming_service = '' - if 'attributeConsumingService' in sp and len(sp['attributeConsumingService']): - attr_cs_desc_str = '' - if "serviceDescription" in sp['attributeConsumingService']: - attr_cs_desc_str = """ %s -""" % sp['attributeConsumingService']['serviceDescription'] + str_contacts = "\n".join(contacts_info) + + str_attribute_consuming_service = "" + if "attributeConsumingService" in sp and len(sp["attributeConsumingService"]): + attr_cs_desc_str = "" + if "serviceDescription" in sp["attributeConsumingService"]: + attr_cs_desc_str = ( + """ %s +""" + % sp["attributeConsumingService"]["serviceDescription"] + ) requested_attribute_data = [] - for req_attribs in sp['attributeConsumingService']['requestedAttributes']: - req_attr_nameformat_str = req_attr_friendlyname_str = req_attr_isrequired_str = '' - req_attr_aux_str = ' />' - - if 'nameFormat' in req_attribs.keys() and req_attribs['nameFormat']: - req_attr_nameformat_str = " NameFormat=\"%s\"" % req_attribs['nameFormat'] - if 'friendlyName' in req_attribs.keys() and req_attribs['friendlyName']: - req_attr_friendlyname_str = " FriendlyName=\"%s\"" % req_attribs['friendlyName'] - if 'isRequired' in req_attribs.keys() and req_attribs['isRequired']: - req_attr_isrequired_str = " isRequired=\"%s\"" % 'true' if req_attribs['isRequired'] else 'false' - if 'attributeValue' in req_attribs.keys() and req_attribs['attributeValue']: - if isinstance(req_attribs['attributeValue'], basestring): - req_attribs['attributeValue'] = [req_attribs['attributeValue']] + for req_attribs in sp["attributeConsumingService"]["requestedAttributes"]: + req_attr_nameformat_str = req_attr_friendlyname_str = req_attr_isrequired_str = "" + req_attr_aux_str = " />" + + if "nameFormat" in req_attribs.keys() and req_attribs["nameFormat"]: + req_attr_nameformat_str = ' NameFormat="%s"' % req_attribs["nameFormat"] + if "friendlyName" in req_attribs.keys() and req_attribs["friendlyName"]: + req_attr_friendlyname_str = ' FriendlyName="%s"' % req_attribs["friendlyName"] + if "isRequired" in req_attribs.keys() and req_attribs["isRequired"]: + req_attr_isrequired_str = ' isRequired="%s"' % "true" if req_attribs["isRequired"] else "false" + if "attributeValue" in req_attribs.keys() and req_attribs["attributeValue"]: + if isinstance(req_attribs["attributeValue"], basestring): + req_attribs["attributeValue"] = [req_attribs["attributeValue"]] req_attr_aux_str = ">" - for attrValue in req_attribs['attributeValue']: + for attrValue in req_attribs["attributeValue"]: req_attr_aux_str += """ - %(attributeValue)s""" % \ - { - 'attributeValue': attrValue - } + %(attributeValue)s""" % { + "attributeValue": attrValue + } req_attr_aux_str += """ """ - requested_attribute = """ + str_attribute_consuming_service = """ %(service_name)s %(attr_cs_desc)s%(requested_attribute_str)s -""" % \ - { - 'service_name': sp['attributeConsumingService']['serviceName'], - 'attr_cs_desc': attr_cs_desc_str, - 'requested_attribute_str': '\n'.join(requested_attribute_data) - } - - metadata = OneLogin_Saml2_Templates.MD_ENTITY_DESCRIPTOR % \ - { - 'valid': ('validUntil="%s"' % valid_until_str) if valid_until_str else '', - 'cache': ('cacheDuration="%s"' % cache_duration_str) if cache_duration_str else '', - 'entity_id': sp['entityId'], - 'authnsign': str_authnsign, - 'wsign': str_wsign, - 'name_id_format': sp['NameIDFormat'], - 'binding': sp['assertionConsumerService']['binding'], - 'location': sp['assertionConsumerService']['url'], - 'sls': sls, - 'organization': str_organization, - 'contacts': str_contacts, - 'attribute_consuming_service': str_attribute_consuming_service +""" % { + "service_name": sp["attributeConsumingService"]["serviceName"], + "attr_cs_desc": attr_cs_desc_str, + "attribute_consuming_service_index": sp["attributeConsumingService"].get("index", "1"), + "requested_attribute_str": "\n".join(requested_attribute_data), } + metadata = OneLogin_Saml2_Templates.MD_ENTITY_DESCRIPTOR % { + "valid": ('validUntil="%s"' % valid_until_str) if valid_until_str else "", + "cache": ('cacheDuration="%s"' % cache_duration_str) if cache_duration_str else "", + "entity_id": sp["entityId"], + "authnsign": str_authnsign, + "wsign": str_wsign, + "name_id_format": sp["NameIDFormat"], + "binding": sp["assertionConsumerService"]["binding"], + "location": sp["assertionConsumerService"]["url"], + "sls": sls, + "organization": str_organization, + "contacts": str_contacts, + "attribute_consuming_service": str_attribute_consuming_service, + } + return metadata @staticmethod - def sign_metadata(metadata, key, cert, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1, digest_algorithm=OneLogin_Saml2_Constants.SHA1): + def sign_metadata(metadata, key, cert, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256, digest_algorithm=OneLogin_Saml2_Constants.SHA256): """ Signs the metadata with the key/cert provided @@ -217,19 +216,19 @@ def sign_metadata(metadata, key, cert, sign_algorithm=OneLogin_Saml2_Constants.R return OneLogin_Saml2_Utils.add_sign(metadata, key, cert, False, sign_algorithm, digest_algorithm) @staticmethod - def __add_x509_key_descriptors(root, cert, signing): - key_descriptor = OneLogin_Saml2_XML.make_child(root, '{%s}KeyDescriptor' % OneLogin_Saml2_Constants.NS_MD) + def _add_x509_key_descriptors(root, cert, signing): + key_descriptor = OneLogin_Saml2_XML.make_child(root, "{%s}KeyDescriptor" % OneLogin_Saml2_Constants.NS_MD) root.remove(key_descriptor) root.insert(0, key_descriptor) - key_info = OneLogin_Saml2_XML.make_child(key_descriptor, '{%s}KeyInfo' % OneLogin_Saml2_Constants.NS_DS) - key_data = OneLogin_Saml2_XML.make_child(key_info, '{%s}X509Data' % OneLogin_Saml2_Constants.NS_DS) + key_info = OneLogin_Saml2_XML.make_child(key_descriptor, "{%s}KeyInfo" % OneLogin_Saml2_Constants.NS_DS) + key_data = OneLogin_Saml2_XML.make_child(key_info, "{%s}X509Data" % OneLogin_Saml2_Constants.NS_DS) - x509_certificate = OneLogin_Saml2_XML.make_child(key_data, '{%s}X509Certificate' % OneLogin_Saml2_Constants.NS_DS) + x509_certificate = OneLogin_Saml2_XML.make_child(key_data, "{%s}X509Certificate" % OneLogin_Saml2_Constants.NS_DS) x509_certificate.text = OneLogin_Saml2_Utils.format_cert(cert, False) - key_descriptor.set('use', ('encryption', 'signing')[signing]) + key_descriptor.set("use", ("encryption", "signing")[signing]) - @staticmethod - def add_x509_key_descriptors(metadata, cert=None, add_encryption=True): + @classmethod + def add_x509_key_descriptors(cls, metadata, cert=None, add_encryption=True): """ Adds the x509 descriptors (sign/encryption) to the metadata The same cert will be used for sign/encrypt @@ -246,20 +245,20 @@ def add_x509_key_descriptors(metadata, cert=None, add_encryption=True): :returns: Metadata with KeyDescriptors :rtype: string """ - if cert is None or cert == '': + if cert is None or cert == "": return metadata try: root = OneLogin_Saml2_XML.to_etree(metadata) except Exception as e: - raise Exception('Error parsing metadata. ' + str(e)) + raise Exception("Error parsing metadata. " + str(e)) - assert root.tag == '{%s}EntityDescriptor' % OneLogin_Saml2_Constants.NS_MD + assert root.tag == "{%s}EntityDescriptor" % OneLogin_Saml2_Constants.NS_MD try: - sp_sso_descriptor = next(root.iterfind('.//md:SPSSODescriptor', namespaces=OneLogin_Saml2_Constants.NSMAP)) + sp_sso_descriptor = next(root.iterfind(".//md:SPSSODescriptor", namespaces=OneLogin_Saml2_Constants.NSMAP)) except StopIteration: - raise Exception('Malformed metadata.') + raise Exception("Malformed metadata.") if add_encryption: - OneLogin_Saml2_Metadata.__add_x509_key_descriptors(sp_sso_descriptor, cert, False) - OneLogin_Saml2_Metadata.__add_x509_key_descriptors(sp_sso_descriptor, cert, True) + cls._add_x509_key_descriptors(sp_sso_descriptor, cert, False) + cls._add_x509_key_descriptors(sp_sso_descriptor, cert, True) return OneLogin_Saml2_XML.to_string(root) diff --git a/src/onelogin/saml2/response.py b/src/onelogin/saml2/response.py index 8aa309c5..5677ad9e 100644 --- a/src/onelogin/saml2/response.py +++ b/src/onelogin/saml2/response.py @@ -2,10 +2,8 @@ """ OneLogin_Saml2_Response class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -SAML Response class of OneLogin's Python Toolkit. +SAML Response class of SAML Python Toolkit. """ @@ -33,8 +31,8 @@ def __init__(self, settings, response): :param response: The base64 encoded, XML string containing the samlp:Response :type response: string """ - self.__settings = settings - self.__error = None + self._settings = settings + self._error = None self.response = OneLogin_Saml2_Utils.b64decode(response) self.document = OneLogin_Saml2_XML.to_etree(self.response) self.decrypted_document = None @@ -42,11 +40,11 @@ def __init__(self, settings, response): self.valid_scd_not_on_or_after = None # Quick check for the presence of EncryptedAssertion - encrypted_assertion_nodes = self.__query('/samlp:Response/saml:EncryptedAssertion') + encrypted_assertion_nodes = self._query("/samlp:Response/saml:EncryptedAssertion") if encrypted_assertion_nodes: decrypted_document = deepcopy(self.document) self.encrypted = True - self.decrypted_document = self.__decrypt_assertion(decrypted_document) + self.decrypted_document = self._decrypt_assertion(decrypted_document) def is_valid(self, request_data, request_id=None, raise_exceptions=False): """ @@ -64,61 +62,46 @@ def is_valid(self, request_data, request_id=None, raise_exceptions=False): :returns: True if the SAML Response is valid, False if not :rtype: bool """ - self.__error = None + self._error = None try: # Checks SAML version - if self.document.get('Version', None) != '2.0': - raise OneLogin_Saml2_ValidationError( - 'Unsupported SAML version', - OneLogin_Saml2_ValidationError.UNSUPPORTED_SAML_VERSION - ) + if self.document.get("Version", None) != "2.0": + raise OneLogin_Saml2_ValidationError("Unsupported SAML version", OneLogin_Saml2_ValidationError.UNSUPPORTED_SAML_VERSION) # Checks that ID exists - if self.document.get('ID', None) is None: - raise OneLogin_Saml2_ValidationError( - 'Missing ID attribute on SAML Response', - OneLogin_Saml2_ValidationError.MISSING_ID - ) + if self.document.get("ID", None) is None: + raise OneLogin_Saml2_ValidationError("Missing ID attribute on SAML Response", OneLogin_Saml2_ValidationError.MISSING_ID) # Checks that the response has the SUCCESS status self.check_status() # Checks that the response only has one assertion if not self.validate_num_assertions(): - raise OneLogin_Saml2_ValidationError( - 'SAML Response must contain 1 assertion', - OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS - ) + raise OneLogin_Saml2_ValidationError("SAML Response must contain 1 assertion", OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS) - idp_data = self.__settings.get_idp_data() - idp_entity_id = idp_data['entityId'] - sp_data = self.__settings.get_sp_data() - sp_entity_id = sp_data['entityId'] + idp_data = self._settings.get_idp_data() + idp_entity_id = idp_data["entityId"] + sp_data = self._settings.get_sp_data() + sp_entity_id = sp_data["entityId"] signed_elements = self.process_signed_elements() - has_signed_response = '{%s}Response' % OneLogin_Saml2_Constants.NS_SAMLP in signed_elements - has_signed_assertion = '{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML in signed_elements + has_signed_response = "{%s}Response" % OneLogin_Saml2_Constants.NS_SAMLP in signed_elements + has_signed_assertion = "{%s}Assertion" % OneLogin_Saml2_Constants.NS_SAML in signed_elements - if self.__settings.is_strict(): - no_valid_xml_msg = 'Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd' - res = OneLogin_Saml2_XML.validate_xml(self.document, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active()) + if self._settings.is_strict(): + no_valid_xml_msg = "Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd" + res = OneLogin_Saml2_XML.validate_xml(self.document, "saml-schema-protocol-2.0.xsd", self._settings.is_debug_active()) if isinstance(res, str): - raise OneLogin_Saml2_ValidationError( - no_valid_xml_msg, - OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT - ) + raise OneLogin_Saml2_ValidationError(no_valid_xml_msg, OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT) # If encrypted, check also the decrypted document if self.encrypted: - res = OneLogin_Saml2_XML.validate_xml(self.decrypted_document, 'saml-schema-protocol-2.0.xsd', self.__settings.is_debug_active()) + res = OneLogin_Saml2_XML.validate_xml(self.decrypted_document, "saml-schema-protocol-2.0.xsd", self._settings.is_debug_active()) if isinstance(res, str): - raise OneLogin_Saml2_ValidationError( - no_valid_xml_msg, - OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT - ) + raise OneLogin_Saml2_ValidationError(no_valid_xml_msg, OneLogin_Saml2_ValidationError.INVALID_XML_FORMAT) - security = self.__settings.get_security_data() + security = self._settings.get_security_data() current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) # Check if the InResponseTo of the Response matchs the ID of the AuthNRequest (requestId) if provided @@ -126,141 +109,109 @@ def is_valid(self, request_data, request_id=None, raise_exceptions=False): if in_response_to is not None and request_id is not None: if in_response_to != request_id: raise OneLogin_Saml2_ValidationError( - 'The InResponseTo of the Response: %s, does not match the ID of the AuthNRequest sent by the SP: %s' % (in_response_to, request_id), - OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO + "The InResponseTo of the Response: %s, does not match the ID of the AuthNRequest sent by the SP: %s" % (in_response_to, request_id), + OneLogin_Saml2_ValidationError.WRONG_INRESPONSETO, ) - if not self.encrypted and security['wantAssertionsEncrypted']: - raise OneLogin_Saml2_ValidationError( - 'The assertion of the Response is not encrypted and the SP require it', - OneLogin_Saml2_ValidationError.NO_ENCRYPTED_ASSERTION - ) + if not self.encrypted and security["wantAssertionsEncrypted"]: + raise OneLogin_Saml2_ValidationError("The assertion of the Response is not encrypted and the SP require it", OneLogin_Saml2_ValidationError.NO_ENCRYPTED_ASSERTION) - if security['wantNameIdEncrypted']: - encrypted_nameid_nodes = self.__query_assertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData') + if security["wantNameIdEncrypted"]: + encrypted_nameid_nodes = self._query_assertion("/saml:Subject/saml:EncryptedID/xenc:EncryptedData") if len(encrypted_nameid_nodes) != 1: - raise OneLogin_Saml2_ValidationError( - 'The NameID of the Response is not encrypted and the SP require it', - OneLogin_Saml2_ValidationError.NO_ENCRYPTED_NAMEID - ) + raise OneLogin_Saml2_ValidationError("The NameID of the Response is not encrypted and the SP require it", OneLogin_Saml2_ValidationError.NO_ENCRYPTED_NAMEID) # Checks that a Conditions element exists if not self.check_one_condition(): - raise OneLogin_Saml2_ValidationError( - 'The Assertion must include a Conditions element', - OneLogin_Saml2_ValidationError.MISSING_CONDITIONS - ) + raise OneLogin_Saml2_ValidationError("The Assertion must include a Conditions element", OneLogin_Saml2_ValidationError.MISSING_CONDITIONS) # Validates Assertion timestamps self.validate_timestamps(raise_exceptions=True) # Checks that an AuthnStatement element exists and is unique if not self.check_one_authnstatement(): - raise OneLogin_Saml2_ValidationError( - 'The Assertion must include an AuthnStatement element', - OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_AUTHSTATEMENTS - ) + raise OneLogin_Saml2_ValidationError("The Assertion must include an AuthnStatement element", OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_AUTHSTATEMENTS) # Checks that the response has all of the AuthnContexts that we provided in the request. # Only check if failOnAuthnContextMismatch is true and requestedAuthnContext is set to a list. - requested_authn_contexts = security['requestedAuthnContext'] - if security['failOnAuthnContextMismatch'] and requested_authn_contexts and requested_authn_contexts is not True: + requested_authn_contexts = security["requestedAuthnContext"] + if security["failOnAuthnContextMismatch"] and requested_authn_contexts and requested_authn_contexts is not True: authn_contexts = self.get_authn_contexts() - unmatched_contexts = set(requested_authn_contexts).difference(authn_contexts) + unmatched_contexts = set(authn_contexts).difference(requested_authn_contexts) if unmatched_contexts: raise OneLogin_Saml2_ValidationError( - 'The AuthnContext "%s" didn\'t include requested context "%s"' % (', '.join(authn_contexts), ', '.join(unmatched_contexts)), - OneLogin_Saml2_ValidationError.AUTHN_CONTEXT_MISMATCH + 'The AuthnContext "%s" was not a requested context "%s"' % (", ".join(unmatched_contexts), ", ".join(requested_authn_contexts)), + OneLogin_Saml2_ValidationError.AUTHN_CONTEXT_MISMATCH, ) # Checks that there is at least one AttributeStatement if required - attribute_statement_nodes = self.__query_assertion('/saml:AttributeStatement') - if security.get('wantAttributeStatement', True) and not attribute_statement_nodes: - raise OneLogin_Saml2_ValidationError( - 'There is no AttributeStatement on the Response', - OneLogin_Saml2_ValidationError.NO_ATTRIBUTESTATEMENT - ) + attribute_statement_nodes = self._query_assertion("/saml:AttributeStatement") + if security.get("wantAttributeStatement", True) and not attribute_statement_nodes: + raise OneLogin_Saml2_ValidationError("There is no AttributeStatement on the Response", OneLogin_Saml2_ValidationError.NO_ATTRIBUTESTATEMENT) - encrypted_attributes_nodes = self.__query_assertion('/saml:AttributeStatement/saml:EncryptedAttribute') + encrypted_attributes_nodes = self._query_assertion("/saml:AttributeStatement/saml:EncryptedAttribute") if encrypted_attributes_nodes: - raise OneLogin_Saml2_ValidationError( - 'There is an EncryptedAttribute in the Response and this SP not support them', - OneLogin_Saml2_ValidationError.ENCRYPTED_ATTRIBUTES - ) + raise OneLogin_Saml2_ValidationError("There is an EncryptedAttribute in the Response and this SP not support them", OneLogin_Saml2_ValidationError.ENCRYPTED_ATTRIBUTES) # Checks destination - destination = self.document.get('Destination', None) + destination = self.document.get("Destination", None) if destination: - if not destination.startswith(current_url): + if not OneLogin_Saml2_Utils.normalize_url(url=destination).startswith(OneLogin_Saml2_Utils.normalize_url(url=current_url)): # TODO: Review if following lines are required, since we can control the # request_data # current_url_routed = OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data) # if not destination.startswith(current_url_routed): - raise OneLogin_Saml2_ValidationError( - 'The response was received at %s instead of %s' % (current_url, destination), - OneLogin_Saml2_ValidationError.WRONG_DESTINATION - ) - elif destination == '': - raise OneLogin_Saml2_ValidationError( - 'The response has an empty Destination value', - OneLogin_Saml2_ValidationError.EMPTY_DESTINATION - ) + raise OneLogin_Saml2_ValidationError("The response was received at %s instead of %s" % (current_url, destination), OneLogin_Saml2_ValidationError.WRONG_DESTINATION) + elif destination == "": + raise OneLogin_Saml2_ValidationError("The response has an empty Destination value", OneLogin_Saml2_ValidationError.EMPTY_DESTINATION) # Checks audience valid_audiences = self.get_audiences() if valid_audiences and sp_entity_id not in valid_audiences: - raise OneLogin_Saml2_ValidationError( - '%s is not a valid audience for this Response' % sp_entity_id, - OneLogin_Saml2_ValidationError.WRONG_AUDIENCE - ) + raise OneLogin_Saml2_ValidationError("%s is not a valid audience for this Response" % sp_entity_id, OneLogin_Saml2_ValidationError.WRONG_AUDIENCE) # Checks the issuers issuers = self.get_issuers() for issuer in issuers: if issuer is None or issuer != idp_entity_id: raise OneLogin_Saml2_ValidationError( - 'Invalid issuer in the Assertion/Response (expected %(idpEntityId)s, got %(issuer)s)' % - { - 'idpEntityId': idp_entity_id, - 'issuer': issuer - }, - OneLogin_Saml2_ValidationError.WRONG_ISSUER + "Invalid issuer in the Assertion/Response (expected %(idpEntityId)s, got %(issuer)s)" % {"idpEntityId": idp_entity_id, "issuer": issuer}, + OneLogin_Saml2_ValidationError.WRONG_ISSUER, ) # Checks the session Expiration session_expiration = self.get_session_not_on_or_after() - if session_expiration and session_expiration <= OneLogin_Saml2_Utils.now(): + if session_expiration and session_expiration + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT <= OneLogin_Saml2_Utils.now(): raise OneLogin_Saml2_ValidationError( - 'The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response', - OneLogin_Saml2_ValidationError.SESSION_EXPIRED + "The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response", OneLogin_Saml2_ValidationError.SESSION_EXPIRED ) # Checks the SubjectConfirmation, at least one SubjectConfirmation must be valid any_subject_confirmation = False - subject_confirmation_nodes = self.__query_assertion('/saml:Subject/saml:SubjectConfirmation') + subject_confirmation_nodes = self._query_assertion("/saml:Subject/saml:SubjectConfirmation") for scn in subject_confirmation_nodes: - method = scn.get('Method', None) + method = scn.get("Method", None) if method and method != OneLogin_Saml2_Constants.CM_BEARER: continue - sc_data = scn.find('saml:SubjectConfirmationData', namespaces=OneLogin_Saml2_Constants.NSMAP) + sc_data = scn.find("saml:SubjectConfirmationData", namespaces=OneLogin_Saml2_Constants.NSMAP) if sc_data is None: continue else: - irt = sc_data.get('InResponseTo', None) + irt = sc_data.get("InResponseTo", None) if in_response_to and irt and irt != in_response_to: continue - recipient = sc_data.get('Recipient', None) + recipient = sc_data.get("Recipient", None) if recipient and current_url not in recipient: continue - nooa = sc_data.get('NotOnOrAfter', None) + nooa = sc_data.get("NotOnOrAfter", None) if nooa: parsed_nooa = OneLogin_Saml2_Utils.parse_SAML_to_time(nooa) - if parsed_nooa <= OneLogin_Saml2_Utils.now(): + if parsed_nooa + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT <= OneLogin_Saml2_Utils.now(): continue - nb = sc_data.get('NotBefore', None) + nb = sc_data.get("NotBefore", None) if nb: parsed_nb = OneLogin_Saml2_Utils.parse_SAML_to_time(nb) - if parsed_nb > OneLogin_Saml2_Utils.now(): + if parsed_nb > OneLogin_Saml2_Utils.now() + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT: continue if nooa: @@ -270,57 +221,43 @@ def is_valid(self, request_data, request_id=None, raise_exceptions=False): break if not any_subject_confirmation: - raise OneLogin_Saml2_ValidationError( - 'A valid SubjectConfirmation was not found on this Response', - OneLogin_Saml2_ValidationError.WRONG_SUBJECTCONFIRMATION - ) + raise OneLogin_Saml2_ValidationError("A valid SubjectConfirmation was not found on this Response", OneLogin_Saml2_ValidationError.WRONG_SUBJECTCONFIRMATION) - if security['wantAssertionsSigned'] and not has_signed_assertion: - raise OneLogin_Saml2_ValidationError( - 'The Assertion of the Response is not signed and the SP require it', - OneLogin_Saml2_ValidationError.NO_SIGNED_ASSERTION - ) + if security["wantAssertionsSigned"] and not has_signed_assertion: + raise OneLogin_Saml2_ValidationError("The Assertion of the Response is not signed and the SP require it", OneLogin_Saml2_ValidationError.NO_SIGNED_ASSERTION) - if security['wantMessagesSigned'] and not has_signed_response: - raise OneLogin_Saml2_ValidationError( - 'The Message of the Response is not signed and the SP require it', - OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE - ) + if security["wantMessagesSigned"] and not has_signed_response: + raise OneLogin_Saml2_ValidationError("The Message of the Response is not signed and the SP require it", OneLogin_Saml2_ValidationError.NO_SIGNED_MESSAGE) if not signed_elements or (not has_signed_response and not has_signed_assertion): - raise OneLogin_Saml2_ValidationError( - 'No Signature found. SAML Response rejected', - OneLogin_Saml2_ValidationError.NO_SIGNATURE_FOUND - ) + raise OneLogin_Saml2_ValidationError("No Signature found. SAML Response rejected", OneLogin_Saml2_ValidationError.NO_SIGNATURE_FOUND) else: - cert = idp_data.get('x509cert', None) - fingerprint = idp_data.get('certFingerprint', None) + cert = self._settings.get_idp_cert() + fingerprint = idp_data.get("certFingerprint", None) if fingerprint: fingerprint = OneLogin_Saml2_Utils.format_finger_print(fingerprint) - fingerprintalg = idp_data.get('certFingerprintAlgorithm', None) + fingerprintalg = idp_data.get("certFingerprintAlgorithm", None) multicerts = None - if 'x509certMulti' in idp_data and 'signing' in idp_data['x509certMulti'] and idp_data['x509certMulti']['signing']: - multicerts = idp_data['x509certMulti']['signing'] + if "x509certMulti" in idp_data and "signing" in idp_data["x509certMulti"] and idp_data["x509certMulti"]["signing"]: + multicerts = idp_data["x509certMulti"]["signing"] # If find a Signature on the Response, validates it checking the original response - if has_signed_response and not OneLogin_Saml2_Utils.validate_sign(self.document, cert, fingerprint, fingerprintalg, xpath=OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH, multicerts=multicerts, raise_exceptions=False): - raise OneLogin_Saml2_ValidationError( - 'Signature validation failed. SAML Response rejected', - OneLogin_Saml2_ValidationError.INVALID_SIGNATURE - ) + if has_signed_response and not OneLogin_Saml2_Utils.validate_sign( + self.document, cert, fingerprint, fingerprintalg, xpath=OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH, multicerts=multicerts, raise_exceptions=False + ): + raise OneLogin_Saml2_ValidationError("Signature validation failed. SAML Response rejected", OneLogin_Saml2_ValidationError.INVALID_SIGNATURE) document_check_assertion = self.decrypted_document if self.encrypted else self.document - if has_signed_assertion and not OneLogin_Saml2_Utils.validate_sign(document_check_assertion, cert, fingerprint, fingerprintalg, xpath=OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH, multicerts=multicerts, raise_exceptions=False): - raise OneLogin_Saml2_ValidationError( - 'Signature validation failed. SAML Response rejected', - OneLogin_Saml2_ValidationError.INVALID_SIGNATURE - ) + if has_signed_assertion and not OneLogin_Saml2_Utils.validate_sign( + document_check_assertion, cert, fingerprint, fingerprintalg, xpath=OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH, multicerts=multicerts, raise_exceptions=False + ): + raise OneLogin_Saml2_ValidationError("Signature validation failed. SAML Response rejected", OneLogin_Saml2_ValidationError.INVALID_SIGNATURE) return True except Exception as err: - self.__error = str(err) - debug = self.__settings.is_debug_active() + self._error = str(err) + debug = self._settings.is_debug_active() if debug: print(err) if raise_exceptions: @@ -334,24 +271,21 @@ def check_status(self): :raises: Exception. If the status is not success """ status = OneLogin_Saml2_Utils.get_status(self.document) - code = status.get('code', None) + code = status.get("code", None) if code and code != OneLogin_Saml2_Constants.STATUS_SUCCESS: - splited_code = code.split(':') + splited_code = code.split(":") printable_code = splited_code.pop() - status_exception_msg = 'The status code of the Response was not Success, was %s' % printable_code - status_msg = status.get('msg', None) + status_exception_msg = "The status code of the Response was not Success, was %s" % printable_code + status_msg = status.get("msg", None) if status_msg: - status_exception_msg += ' -> ' + status_msg - raise OneLogin_Saml2_ValidationError( - status_exception_msg, - OneLogin_Saml2_ValidationError.STATUS_CODE_IS_NOT_SUCCESS - ) + status_exception_msg += " -> " + status_msg + raise OneLogin_Saml2_ValidationError(status_exception_msg, OneLogin_Saml2_ValidationError.STATUS_CODE_IS_NOT_SUCCESS) def check_one_condition(self): """ Checks that the samlp:Response/saml:Assertion/saml:Conditions element exists and is unique. """ - condition_nodes = self.__query_assertion('/saml:Conditions') + condition_nodes = self._query_assertion("/saml:Conditions") if len(condition_nodes) == 1: return True else: @@ -361,7 +295,7 @@ def check_one_authnstatement(self): """ Checks that the samlp:Response/saml:Assertion/saml:AuthnStatement element exists and is unique. """ - authnstatement_nodes = self.__query_assertion('/saml:AuthnStatement') + authnstatement_nodes = self._query_assertion("/saml:AuthnStatement") if len(authnstatement_nodes) == 1: return True else: @@ -374,7 +308,7 @@ def get_audiences(self): :returns: The valid audiences for the SAML Response :rtype: list """ - audience_nodes = self.__query_assertion('/saml:Conditions/saml:AudienceRestriction/saml:Audience') + audience_nodes = self._query_assertion("/saml:Conditions/saml:AudienceRestriction/saml:Audience") return [OneLogin_Saml2_XML.element_text(node) for node in audience_nodes if OneLogin_Saml2_XML.element_text(node) is not None] def get_authn_contexts(self): @@ -384,7 +318,7 @@ def get_authn_contexts(self): :returns: The authentication classes for the SAML Response :rtype: list """ - authn_context_nodes = self.__query_assertion('/saml:AuthnStatement/saml:AuthnContext/saml:AuthnContextClassRef') + authn_context_nodes = self._query_assertion("/saml:AuthnStatement/saml:AuthnContext/saml:AuthnContextClassRef") return [OneLogin_Saml2_XML.element_text(node) for node in authn_context_nodes] def get_in_response_to(self): @@ -393,7 +327,7 @@ def get_in_response_to(self): :returns: ID of AuthNRequest this Response is in response to or None if it is not present :rtype: str """ - return self.document.get('InResponseTo') + return self.document.get("InResponseTo") def get_issuers(self): """ @@ -404,28 +338,22 @@ def get_issuers(self): """ issuers = set() - message_issuer_nodes = OneLogin_Saml2_XML.query(self.document, '/samlp:Response/saml:Issuer') + message_issuer_nodes = OneLogin_Saml2_XML.query(self.document, "/samlp:Response/saml:Issuer") if len(message_issuer_nodes) > 0: if len(message_issuer_nodes) == 1: issuer_value = OneLogin_Saml2_XML.element_text(message_issuer_nodes[0]) if issuer_value: issuers.add(issuer_value) else: - raise OneLogin_Saml2_ValidationError( - 'Issuer of the Response is multiple.', - OneLogin_Saml2_ValidationError.ISSUER_MULTIPLE_IN_RESPONSE - ) + raise OneLogin_Saml2_ValidationError("Issuer of the Response is multiple.", OneLogin_Saml2_ValidationError.ISSUER_MULTIPLE_IN_RESPONSE) - assertion_issuer_nodes = self.__query_assertion('/saml:Issuer') + assertion_issuer_nodes = self._query_assertion("/saml:Issuer") if len(assertion_issuer_nodes) == 1: issuer_value = OneLogin_Saml2_XML.element_text(assertion_issuer_nodes[0]) if issuer_value: issuers.add(issuer_value) else: - raise OneLogin_Saml2_ValidationError( - 'Issuer of the Assertion not found or multiple.', - OneLogin_Saml2_ValidationError.ISSUER_NOT_FOUND_IN_ASSERTION - ) + raise OneLogin_Saml2_ValidationError("Issuer of the Assertion not found or multiple.", OneLogin_Saml2_ValidationError.ISSUER_NOT_FOUND_IN_ASSERTION) return list(set(issuers)) @@ -439,43 +367,34 @@ def get_nameid_data(self): nameid = None nameid_data = {} - encrypted_id_data_nodes = self.__query_assertion('/saml:Subject/saml:EncryptedID/xenc:EncryptedData') + encrypted_id_data_nodes = self._query_assertion("/saml:Subject/saml:EncryptedID/xenc:EncryptedData") if encrypted_id_data_nodes: encrypted_data = encrypted_id_data_nodes[0] - key = self.__settings.get_sp_key() + key = self._settings.get_sp_key() nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key) else: - nameid_nodes = self.__query_assertion('/saml:Subject/saml:NameID') + nameid_nodes = self._query_assertion("/saml:Subject/saml:NameID") if nameid_nodes: nameid = nameid_nodes[0] - is_strict = self.__settings.is_strict() - want_nameid = self.__settings.get_security_data().get('wantNameId', True) + is_strict = self._settings.is_strict() + want_nameid = self._settings.get_security_data().get("wantNameId", True) if nameid is None: if is_strict and want_nameid: - raise OneLogin_Saml2_ValidationError( - 'NameID not found in the assertion of the Response', - OneLogin_Saml2_ValidationError.NO_NAMEID - ) + raise OneLogin_Saml2_ValidationError("NameID not found in the assertion of the Response", OneLogin_Saml2_ValidationError.NO_NAMEID) else: if is_strict and want_nameid and not OneLogin_Saml2_XML.element_text(nameid): - raise OneLogin_Saml2_ValidationError( - 'An empty NameID value found', - OneLogin_Saml2_ValidationError.EMPTY_NAMEID - ) + raise OneLogin_Saml2_ValidationError("An empty NameID value found", OneLogin_Saml2_ValidationError.EMPTY_NAMEID) - nameid_data = {'Value': OneLogin_Saml2_XML.element_text(nameid)} - for attr in ['Format', 'SPNameQualifier', 'NameQualifier']: + nameid_data = {"Value": OneLogin_Saml2_XML.element_text(nameid)} + for attr in ["Format", "SPNameQualifier", "NameQualifier"]: value = nameid.get(attr, None) if value: - if is_strict and attr == 'SPNameQualifier': - sp_data = self.__settings.get_sp_data() - sp_entity_id = sp_data.get('entityId', '') + if is_strict and attr == "SPNameQualifier": + sp_data = self._settings.get_sp_data() + sp_entity_id = sp_data.get("entityId", "") if sp_entity_id != value: - raise OneLogin_Saml2_ValidationError( - 'The SPNameQualifier value mistmatch the SP entityID value.', - OneLogin_Saml2_ValidationError.SP_NAME_QUALIFIER_NAME_MISMATCH - ) + raise OneLogin_Saml2_ValidationError("The SPNameQualifier value mistmatch the SP entityID value.", OneLogin_Saml2_ValidationError.SP_NAME_QUALIFIER_NAME_MISMATCH) nameid_data[attr] = value return nameid_data @@ -489,8 +408,8 @@ def get_nameid(self): """ nameid_value = None nameid_data = self.get_nameid_data() - if nameid_data and 'Value' in nameid_data.keys(): - nameid_value = nameid_data['Value'] + if nameid_data and "Value" in nameid_data.keys(): + nameid_value = nameid_data["Value"] return nameid_value def get_nameid_format(self): @@ -502,8 +421,8 @@ def get_nameid_format(self): """ nameid_format = None nameid_data = self.get_nameid_data() - if nameid_data and 'Format' in nameid_data.keys(): - nameid_format = nameid_data['Format'] + if nameid_data and "Format" in nameid_data.keys(): + nameid_format = nameid_data["Format"] return nameid_format def get_nameid_nq(self): @@ -515,8 +434,8 @@ def get_nameid_nq(self): """ nameid_nq = None nameid_data = self.get_nameid_data() - if nameid_data and 'NameQualifier' in nameid_data.keys(): - nameid_nq = nameid_data['NameQualifier'] + if nameid_data and "NameQualifier" in nameid_data.keys(): + nameid_nq = nameid_data["NameQualifier"] return nameid_nq def get_nameid_spnq(self): @@ -528,8 +447,8 @@ def get_nameid_spnq(self): """ nameid_spnq = None nameid_data = self.get_nameid_data() - if nameid_data and 'SPNameQualifier' in nameid_data.keys(): - nameid_spnq = nameid_data['SPNameQualifier'] + if nameid_data and "SPNameQualifier" in nameid_data.keys(): + nameid_spnq = nameid_data["SPNameQualifier"] return nameid_spnq def get_session_not_on_or_after(self): @@ -541,9 +460,9 @@ def get_session_not_on_or_after(self): :rtype: time|None """ not_on_or_after = None - authn_statement_nodes = self.__query_assertion('/saml:AuthnStatement[@SessionNotOnOrAfter]') + authn_statement_nodes = self._query_assertion("/saml:AuthnStatement[@SessionNotOnOrAfter]") if authn_statement_nodes: - not_on_or_after = OneLogin_Saml2_Utils.parse_SAML_to_time(authn_statement_nodes[0].get('SessionNotOnOrAfter')) + not_on_or_after = OneLogin_Saml2_Utils.parse_SAML_to_time(authn_statement_nodes[0].get("SessionNotOnOrAfter")) return not_on_or_after def get_assertion_not_on_or_after(self): @@ -563,9 +482,9 @@ def get_session_index(self): :rtype: string|None """ session_index = None - authn_statement_nodes = self.__query_assertion('/saml:AuthnStatement[@SessionIndex]') + authn_statement_nodes = self._query_assertion("/saml:AuthnStatement[@SessionIndex]") if authn_statement_nodes: - session_index = authn_statement_nodes[0].get('SessionIndex') + session_index = authn_statement_nodes[0].get("SessionIndex") return session_index def get_attributes(self): @@ -573,34 +492,40 @@ def get_attributes(self): Gets the Attributes from the AttributeStatement element. EncryptedAttributes are not supported """ + return self._get_attributes("Name") + + def get_friendlyname_attributes(self): + """ + Gets the Attributes from the AttributeStatement element indexed by FiendlyName. + EncryptedAttributes are not supported + """ + return self._get_attributes("FriendlyName") + + def _get_attributes(self, attr_name): + allow_duplicates = self._settings.get_security_data().get("allowRepeatAttributeName", False) attributes = {} - attribute_nodes = self.__query_assertion('/saml:AttributeStatement/saml:Attribute') + attribute_nodes = self._query_assertion("/saml:AttributeStatement/saml:Attribute") for attribute_node in attribute_nodes: - attr_name = attribute_node.get('Name') - if attr_name in attributes.keys(): - raise OneLogin_Saml2_ValidationError( - 'Found an Attribute element with duplicated Name', - OneLogin_Saml2_ValidationError.DUPLICATED_ATTRIBUTE_NAME_FOUND - ) - - values = [] - for attr in attribute_node.iterchildren('{%s}AttributeValue' % OneLogin_Saml2_Constants.NSMAP['saml']): - attr_text = OneLogin_Saml2_XML.element_text(attr) - if attr_text: - attr_text = attr_text.strip() + attr_key = attribute_node.get(attr_name) + if attr_key: + if not allow_duplicates and attr_key in attributes: + raise OneLogin_Saml2_ValidationError("Found an Attribute element with duplicated " + attr_name, OneLogin_Saml2_ValidationError.DUPLICATED_ATTRIBUTE_NAME_FOUND) + + values = [] + for attr in attribute_node.iterchildren("{%s}AttributeValue" % OneLogin_Saml2_Constants.NSMAP["saml"]): + attr_text = OneLogin_Saml2_XML.element_text(attr) if attr_text: - values.append(attr_text) - - # Parse any nested NameID children - for nameid in attr.iterchildren('{%s}NameID' % OneLogin_Saml2_Constants.NSMAP['saml']): - values.append({ - 'NameID': { - 'Format': nameid.get('Format'), - 'NameQualifier': nameid.get('NameQualifier'), - 'value': nameid.text - } - }) - attributes[attr_name] = values + attr_text = attr_text.strip() + if attr_text: + values.append(attr_text) + + # Parse any nested NameID children + for nameid in attr.iterchildren("{%s}NameID" % OneLogin_Saml2_Constants.NSMAP["saml"]): + values.append({"NameID": {"Format": nameid.get("Format"), "NameQualifier": nameid.get("NameQualifier"), "value": nameid.text}}) + if attr_key in attributes: + attributes[attr_key].extend(values) + else: + attributes[attr_key] = values return attributes def validate_num_assertions(self): @@ -610,13 +535,13 @@ def validate_num_assertions(self): :returns: True if only 1 assertion encrypted or not :rtype: bool """ - encrypted_assertion_nodes = OneLogin_Saml2_XML.query(self.document, '//saml:EncryptedAssertion') - assertion_nodes = OneLogin_Saml2_XML.query(self.document, '//saml:Assertion') + encrypted_assertion_nodes = OneLogin_Saml2_XML.query(self.document, "//saml:EncryptedAssertion") + assertion_nodes = OneLogin_Saml2_XML.query(self.document, "//saml:Assertion") valid = len(encrypted_assertion_nodes) + len(assertion_nodes) == 1 - if (self.encrypted): - assertion_nodes = OneLogin_Saml2_XML.query(self.decrypted_document, '//saml:Assertion') + if self.encrypted: + assertion_nodes = OneLogin_Saml2_XML.query(self.decrypted_document, "//saml:Assertion") valid = valid and len(assertion_nodes) == 1 return valid @@ -630,64 +555,63 @@ def process_signed_elements(self): :returns: The signed elements tag names :rtype: list """ - sign_nodes = self.__query('//ds:Signature') + sign_nodes = self._query("//ds:Signature") signed_elements = [] verified_seis = [] verified_ids = [] - response_tag = '{%s}Response' % OneLogin_Saml2_Constants.NS_SAMLP - assertion_tag = '{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML + response_tag = "{%s}Response" % OneLogin_Saml2_Constants.NS_SAMLP + assertion_tag = "{%s}Assertion" % OneLogin_Saml2_Constants.NS_SAML + + security = self._settings.get_security_data() + reject_deprecated_alg = security.get("rejectDeprecatedAlgorithm", False) for sign_node in sign_nodes: signed_element = sign_node.getparent().tag if signed_element != response_tag and signed_element != assertion_tag: - raise OneLogin_Saml2_ValidationError( - 'Invalid Signature Element %s SAML Response rejected' % signed_element, - OneLogin_Saml2_ValidationError.WRONG_SIGNED_ELEMENT - ) - - if not sign_node.getparent().get('ID'): - raise OneLogin_Saml2_ValidationError( - 'Signed Element must contain an ID. SAML Response rejected', - OneLogin_Saml2_ValidationError.ID_NOT_FOUND_IN_SIGNED_ELEMENT - ) - - id_value = sign_node.getparent().get('ID') + raise OneLogin_Saml2_ValidationError("Invalid Signature Element %s SAML Response rejected" % signed_element, OneLogin_Saml2_ValidationError.WRONG_SIGNED_ELEMENT) + + if not sign_node.getparent().get("ID"): + raise OneLogin_Saml2_ValidationError("Signed Element must contain an ID. SAML Response rejected", OneLogin_Saml2_ValidationError.ID_NOT_FOUND_IN_SIGNED_ELEMENT) + + id_value = sign_node.getparent().get("ID") if id_value in verified_ids: - raise OneLogin_Saml2_ValidationError( - 'Duplicated ID. SAML Response rejected', - OneLogin_Saml2_ValidationError.DUPLICATED_ID_IN_SIGNED_ELEMENTS - ) + raise OneLogin_Saml2_ValidationError("Duplicated ID. SAML Response rejected", OneLogin_Saml2_ValidationError.DUPLICATED_ID_IN_SIGNED_ELEMENTS) verified_ids.append(id_value) # Check that reference URI matches the parent ID and no duplicate References or IDs - ref = OneLogin_Saml2_XML.query(sign_node, './/ds:Reference') + ref = OneLogin_Saml2_XML.query(sign_node, ".//ds:Reference") if ref: ref = ref[0] - if ref.get('URI'): - sei = ref.get('URI')[1:] + if ref.get("URI"): + sei = ref.get("URI")[1:] if sei != id_value: - raise OneLogin_Saml2_ValidationError( - 'Found an invalid Signed Element. SAML Response rejected', - OneLogin_Saml2_ValidationError.INVALID_SIGNED_ELEMENT - ) + raise OneLogin_Saml2_ValidationError("Found an invalid Signed Element. SAML Response rejected", OneLogin_Saml2_ValidationError.INVALID_SIGNED_ELEMENT) if sei in verified_seis: - raise OneLogin_Saml2_ValidationError( - 'Duplicated Reference URI. SAML Response rejected', - OneLogin_Saml2_ValidationError.DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS - ) + raise OneLogin_Saml2_ValidationError("Duplicated Reference URI. SAML Response rejected", OneLogin_Saml2_ValidationError.DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS) verified_seis.append(sei) + # Check the signature and digest algorithm + if reject_deprecated_alg: + sig_method_node = OneLogin_Saml2_XML.query(sign_node, ".//ds:SignatureMethod") + if sig_method_node: + sig_method = sig_method_node[0].get("Algorithm") + if sig_method in OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS: + raise OneLogin_Saml2_ValidationError("Deprecated signature algorithm found: %s" % sig_method, OneLogin_Saml2_ValidationError.DEPRECATED_SIGNATURE_METHOD) + + dig_method_node = OneLogin_Saml2_XML.query(sign_node, ".//ds:DigestMethod") + if dig_method_node: + dig_method = dig_method_node[0].get("Algorithm") + if dig_method in OneLogin_Saml2_Constants.DEPRECATED_ALGORITHMS: + raise OneLogin_Saml2_ValidationError("Deprecated digest algorithm found: %s" % dig_method, OneLogin_Saml2_ValidationError.DEPRECATED_DIGEST_METHOD) + signed_elements.append(signed_element) if signed_elements: if not self.validate_signed_elements(signed_elements, raise_exceptions=True): - raise OneLogin_Saml2_ValidationError( - 'Found an unexpected Signature Element. SAML Response rejected', - OneLogin_Saml2_ValidationError.UNEXPECTED_SIGNED_ELEMENTS - ) + raise OneLogin_Saml2_ValidationError("Found an unexpected Signature Element. SAML Response rejected", OneLogin_Saml2_ValidationError.UNEXPECTED_SIGNED_ELEMENTS) return signed_elements @return_false_on_exception @@ -703,12 +627,14 @@ def validate_signed_elements(self, signed_elements): if len(signed_elements) > 2: return False - response_tag = '{%s}Response' % OneLogin_Saml2_Constants.NS_SAMLP - assertion_tag = '{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML + response_tag = "{%s}Response" % OneLogin_Saml2_Constants.NS_SAMLP + assertion_tag = "{%s}Assertion" % OneLogin_Saml2_Constants.NS_SAML - if (response_tag in signed_elements and signed_elements.count(response_tag) > 1) or \ - (assertion_tag in signed_elements and signed_elements.count(assertion_tag) > 1) or \ - (response_tag not in signed_elements and assertion_tag not in signed_elements): + if ( + (response_tag in signed_elements and signed_elements.count(response_tag) > 1) + or (assertion_tag in signed_elements and signed_elements.count(assertion_tag) > 1) + or (response_tag not in signed_elements and assertion_tag not in signed_elements) + ): return False # Check that the signed elements found here, are the ones that will be verified @@ -716,18 +642,12 @@ def validate_signed_elements(self, signed_elements): if response_tag in signed_elements: expected_signature_nodes = OneLogin_Saml2_XML.query(self.document, OneLogin_Saml2_Utils.RESPONSE_SIGNATURE_XPATH) if len(expected_signature_nodes) != 1: - raise OneLogin_Saml2_ValidationError( - 'Unexpected number of Response signatures found. SAML Response rejected.', - OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE - ) + raise OneLogin_Saml2_ValidationError("Unexpected number of Response signatures found. SAML Response rejected.", OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_RESPONSE) if assertion_tag in signed_elements: - expected_signature_nodes = self.__query(OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH) + expected_signature_nodes = self._query(OneLogin_Saml2_Utils.ASSERTION_SIGNATURE_XPATH) if len(expected_signature_nodes) != 1: - raise OneLogin_Saml2_ValidationError( - 'Unexpected number of Assertion signatures found. SAML Response rejected.', - OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION - ) + raise OneLogin_Saml2_ValidationError("Unexpected number of Assertion signatures found. SAML Response rejected.", OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES_IN_ASSERTION) return True @@ -739,24 +659,18 @@ def validate_timestamps(self): :returns: True if the condition is valid, False otherwise :rtype: bool """ - conditions_nodes = self.__query_assertion('/saml:Conditions') + conditions_nodes = self._query_assertion("/saml:Conditions") for conditions_node in conditions_nodes: - nb_attr = conditions_node.get('NotBefore') - nooa_attr = conditions_node.get('NotOnOrAfter') + nb_attr = conditions_node.get("NotBefore") + nooa_attr = conditions_node.get("NotOnOrAfter") if nb_attr and OneLogin_Saml2_Utils.parse_SAML_to_time(nb_attr) > OneLogin_Saml2_Utils.now() + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT: - raise OneLogin_Saml2_ValidationError( - 'Could not validate timestamp: not yet valid. Check system clock.', - OneLogin_Saml2_ValidationError.ASSERTION_TOO_EARLY - ) + raise OneLogin_Saml2_ValidationError("Could not validate timestamp: not yet valid. Check system clock.", OneLogin_Saml2_ValidationError.ASSERTION_TOO_EARLY) if nooa_attr and OneLogin_Saml2_Utils.parse_SAML_to_time(nooa_attr) + OneLogin_Saml2_Constants.ALLOWED_CLOCK_DRIFT <= OneLogin_Saml2_Utils.now(): - raise OneLogin_Saml2_ValidationError( - 'Could not validate timestamp: expired. Check system clock.', - OneLogin_Saml2_ValidationError.ASSERTION_EXPIRED - ) + raise OneLogin_Saml2_ValidationError("Could not validate timestamp: expired. Check system clock.", OneLogin_Saml2_ValidationError.ASSERTION_EXPIRED) return True - def __query_assertion(self, xpath_expr): + def _query_assertion(self, xpath_expr): """ Extracts nodes that match the query from the Assertion @@ -767,31 +681,31 @@ def __query_assertion(self, xpath_expr): :rtype: list """ - assertion_expr = '/saml:Assertion' - signature_expr = '/ds:Signature/ds:SignedInfo/ds:Reference' - signed_assertion_query = '/samlp:Response' + assertion_expr + signature_expr - assertion_reference_nodes = self.__query(signed_assertion_query) + assertion_expr = "/saml:Assertion" + signature_expr = "/ds:Signature/ds:SignedInfo/ds:Reference" + signed_assertion_query = "/samlp:Response" + assertion_expr + signature_expr + assertion_reference_nodes = self._query(signed_assertion_query) tagid = None if not assertion_reference_nodes: # Check if the message is signed - signed_message_query = '/samlp:Response' + signature_expr - message_reference_nodes = self.__query(signed_message_query) + signed_message_query = "/samlp:Response" + signature_expr + message_reference_nodes = self._query(signed_message_query) if message_reference_nodes: - message_id = message_reference_nodes[0].get('URI') + message_id = message_reference_nodes[0].get("URI") final_query = "/samlp:Response[@ID=$tagid]/" tagid = message_id[1:] else: final_query = "/samlp:Response" final_query += assertion_expr else: - assertion_id = assertion_reference_nodes[0].get('URI') - final_query = '/samlp:Response' + assertion_expr + "[@ID=$tagid]" + assertion_id = assertion_reference_nodes[0].get("URI") + final_query = "/samlp:Response" + assertion_expr + "[@ID=$tagid]" tagid = assertion_id[1:] final_query += xpath_expr - return self.__query(final_query, tagid) + return self._query(final_query, tagid) - def __query(self, query, tagid=None): + def _query(self, query, tagid=None): """ Extracts nodes that match the query from the Response @@ -810,7 +724,7 @@ def __query(self, query, tagid=None): document = self.document return OneLogin_Saml2_XML.query(document, query, None, tagid) - def __decrypt_assertion(self, xml): + def _decrypt_assertion(self, xml): """ Decrypts the Assertion @@ -820,44 +734,32 @@ def __decrypt_assertion(self, xml): :returns: Decrypted Assertion :rtype: Element """ - key = self.__settings.get_sp_key() - debug = self.__settings.is_debug_active() + key = self._settings.get_sp_key() + debug = self._settings.is_debug_active() if not key: - raise OneLogin_Saml2_Error( - 'No private key available to decrypt the assertion, check settings', - OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND - ) + raise OneLogin_Saml2_Error("No private key available to decrypt the assertion, check settings", OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND) - encrypted_assertion_nodes = OneLogin_Saml2_XML.query(xml, '/samlp:Response/saml:EncryptedAssertion') + encrypted_assertion_nodes = OneLogin_Saml2_XML.query(xml, "/samlp:Response/saml:EncryptedAssertion") if encrypted_assertion_nodes: - encrypted_data_nodes = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], '//saml:EncryptedAssertion/xenc:EncryptedData') + encrypted_data_nodes = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], "//saml:EncryptedAssertion/xenc:EncryptedData") if encrypted_data_nodes: - keyinfo = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], '//saml:EncryptedAssertion/xenc:EncryptedData/ds:KeyInfo') + keyinfo = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], "//saml:EncryptedAssertion/xenc:EncryptedData/ds:KeyInfo") if not keyinfo: - raise OneLogin_Saml2_ValidationError( - 'No KeyInfo present, invalid Assertion', - OneLogin_Saml2_ValidationError.KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA - ) + raise OneLogin_Saml2_ValidationError("No KeyInfo present, invalid Assertion", OneLogin_Saml2_ValidationError.KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA) keyinfo = keyinfo[0] children = keyinfo.getchildren() if not children: - raise OneLogin_Saml2_ValidationError( - 'KeyInfo has no children nodes, invalid Assertion', - OneLogin_Saml2_ValidationError.CHILDREN_NODE_NOT_FOUND_IN_KEYINFO - ) + raise OneLogin_Saml2_ValidationError("KeyInfo has no children nodes, invalid Assertion", OneLogin_Saml2_ValidationError.CHILDREN_NODE_NOT_FOUND_IN_KEYINFO) for child in children: - if 'RetrievalMethod' in child.tag: - if child.attrib['Type'] != 'http://www.w3.org/2001/04/xmlenc#EncryptedKey': - raise OneLogin_Saml2_ValidationError( - 'Unsupported Retrieval Method found', - OneLogin_Saml2_ValidationError.UNSUPPORTED_RETRIEVAL_METHOD - ) - uri = child.attrib['URI'] - if not uri.startswith('#'): + if "RetrievalMethod" in child.tag: + if child.attrib["Type"] != "http://www.w3.org/2001/04/xmlenc#EncryptedKey": + raise OneLogin_Saml2_ValidationError("Unsupported Retrieval Method found", OneLogin_Saml2_ValidationError.UNSUPPORTED_RETRIEVAL_METHOD) + uri = child.attrib["URI"] + if not uri.startswith("#"): break - uri = uri.split('#')[1] - encrypted_key = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], './xenc:EncryptedKey[@Id=$tagid]', None, uri) + uri = uri.split("#")[1] + encrypted_key = OneLogin_Saml2_XML.query(encrypted_assertion_nodes[0], "./xenc:EncryptedKey[@Id=$tagid]", None, uri) if encrypted_key: keyinfo.append(encrypted_key[0]) @@ -870,7 +772,7 @@ def get_error(self): """ After executing a validation process, if it fails this method returns the cause """ - return self.__error + return self._error def get_xml_document(self): """ @@ -889,7 +791,7 @@ def get_id(self): :returns: the ID of the response :rtype: string """ - return self.document.get('ID', None) + return self.document.get("ID", None) def get_assertion_id(self): """ @@ -897,8 +799,15 @@ def get_assertion_id(self): :rtype: string """ if not self.validate_num_assertions(): - raise OneLogin_Saml2_ValidationError( - 'SAML Response must contain 1 assertion', - OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS - ) - return self.__query_assertion('')[0].get('ID', None) + raise OneLogin_Saml2_ValidationError("SAML Response must contain 1 assertion", OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS) + return self._query_assertion("")[0].get("ID", None) + + def get_assertion_issue_instant(self): + """ + :returns: the IssueInstant of the assertion in the response + :rtype: unix/posix timestamp|None + """ + if not self.validate_num_assertions(): + raise OneLogin_Saml2_ValidationError("SAML Response must contain 1 assertion", OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_ASSERTIONS) + issue_instant = self._query_assertion("")[0].get("IssueInstant", None) + return OneLogin_Saml2_Utils.parse_SAML_to_time(issue_instant) diff --git a/src/onelogin/saml2/settings.py b/src/onelogin/saml2/settings.py index 003aa0ad..8a9e46cb 100644 --- a/src/onelogin/saml2/settings.py +++ b/src/onelogin/saml2/settings.py @@ -2,7 +2,7 @@ """ OneLogin_Saml2_Settings class -Copyright (c) 2010-2018 OneLogin, Inc. +Copyright (c) 2010-2021 OneLogin, Inc. MIT License Setting class of OneLogin's Python Toolkit. @@ -39,14 +39,25 @@ r'\[?[A-F0-9]*:[A-F0-9:]+\]?)' # ...or ipv6 r'(?::\d+)?' # optional port r'(?:/?|[/?]\S+)$', re.IGNORECASE) +url_regex_single_label_domain = re.compile( + r'^(?:[a-z0-9\.\-]*)://' # scheme is validated separately + r'(?:(?:[A-Z0-9_](?:[A-Z0-9-_]{0,61}[A-Z0-9_])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain... + r'(?:[A-Z0-9_](?:[A-Z0-9-_]{0,61}[A-Z0-9_]))|' # single-label-domain + r'localhost|' # localhost... + r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|' # ...or ipv4 + r'\[?[A-F0-9]*:[A-F0-9:]+\]?)' # ...or ipv6 + r'(?::\d+)?' # optional port + r'(?:/?|[/?]\S+)$', re.IGNORECASE) url_schemes = ['http', 'https', 'ftp', 'ftps'] -def validate_url(url): +def validate_url(url, allow_single_label_domain=False): """ Auxiliary method to validate an urllib :param url: An url to be validated :type url: string + :param allow_single_label_domain: In order to allow or not single label domain + :type url: bool :returns: True if the url is valid :rtype: bool """ @@ -54,8 +65,12 @@ def validate_url(url): scheme = url.split('://')[0].lower() if scheme not in url_schemes: return False - if not bool(url_regex.search(url)): - return False + if allow_single_label_domain: + if not bool(url_regex_single_label_domain.search(url)): + return False + else: + if not bool(url_regex.search(url)): + return False return True @@ -66,6 +81,8 @@ class OneLogin_Saml2_Settings(object): """ + metadata_class = OneLogin_Saml2_Metadata + def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False): """ Initializes the settings: @@ -81,37 +98,37 @@ def __init__(self, settings=None, custom_base_path=None, sp_validation_only=Fals :param sp_validation_only: Avoid the IdP validation :type sp_validation_only: boolean """ - self.__sp_validation_only = sp_validation_only - self.__paths = {} - self.__strict = False - self.__debug = False - self.__sp = {} - self.__idp = {} - self.__security = {} - self.__contacts = {} - self.__organization = {} - self.__errors = [] + self._sp_validation_only = sp_validation_only + self._paths = {} + self._strict = True + self._debug = False + self._sp = {} + self._idp = {} + self._security = {} + self._contacts = {} + self._organization = {} + self._errors = [] - self.__load_paths(base_path=custom_base_path) - self.__update_paths(settings) + self._load_paths(base_path=custom_base_path) + self._update_paths(settings) if settings is None: try: - valid = self.__load_settings_from_file() + valid = self._load_settings_from_file() except Exception as e: raise e if not valid: raise OneLogin_Saml2_Error( 'Invalid dict settings at the file: %s', OneLogin_Saml2_Error.SETTINGS_INVALID, - ','.join(self.__errors) + ','.join(self._errors) ) elif isinstance(settings, dict): - if not self.__load_settings_from_dict(settings): + if not self._load_settings_from_dict(settings): raise OneLogin_Saml2_Error( 'Invalid dict settings: %s', OneLogin_Saml2_Error.SETTINGS_INVALID, - ','.join(self.__errors) + ','.join(self._errors) ) else: raise OneLogin_Saml2_Error( @@ -120,14 +137,14 @@ def __init__(self, settings=None, custom_base_path=None, sp_validation_only=Fals ) self.format_idp_cert() - if 'x509certMulti' in self.__idp: + if 'x509certMulti' in self._idp: self.format_idp_cert_multi() self.format_sp_cert() - if 'x509certNew' in self.__sp: + if 'x509certNew' in self._sp: self.format_sp_cert_new() self.format_sp_key() - def __load_paths(self, base_path=None): + def _load_paths(self, base_path=None): """ Set the paths of the different folders """ @@ -135,14 +152,13 @@ def __load_paths(self, base_path=None): base_path = dirname(dirname(dirname(__file__))) if not base_path.endswith(sep): base_path += sep - self.__paths = { + self._paths = { 'base': base_path, 'cert': base_path + 'certs' + sep, - 'lib': base_path + 'lib' + sep, - 'extlib': base_path + 'extlib' + sep, + 'lib': dirname(__file__) + sep } - def __update_paths(self, settings): + def _update_paths(self, settings): """ Set custom paths if necessary """ @@ -152,7 +168,7 @@ def __update_paths(self, settings): if 'custom_base_path' in settings: base_path = settings['custom_base_path'] base_path = join(dirname(__file__), base_path) - self.__load_paths(base_path) + self._load_paths(base_path) def get_base_path(self): """ @@ -161,7 +177,7 @@ def get_base_path(self): :return: The base toolkit folder path :rtype: string """ - return self.__paths['base'] + return self._paths['base'] def get_cert_path(self): """ @@ -170,25 +186,40 @@ def get_cert_path(self): :return: The cert folder path :rtype: string """ - return self.__paths['cert'] + return self._paths['cert'] - def get_lib_path(self): + def set_cert_path(self, path): """ - Returns lib path + Set a new cert path + """ + self._paths['cert'] = path - :return: The library folder path - :rtype: string + def set_sp_cert_filename(self, filename): + """ + Set the filename of the SP certificate + """ + self._sp['cert_filename'] = filename + + def set_sp_key_filename(self, filename): + """ + Set the filename of the SP key + """ + self._sp['key_filename'] = filename + + def set_idp_cert_filename(self, filename): + """ + Set the filename of the idp certificate """ - return self.__paths['lib'] + self._idp['cert_filename'] = filename - def get_ext_lib_path(self): + def get_lib_path(self): """ - Returns external lib path + Returns lib path - :return: The external library folder path + :return: The library folder path :rtype: string """ - return self.__paths['extlib'] + return self._paths['lib'] def get_schemas_path(self): """ @@ -197,11 +228,11 @@ def get_schemas_path(self): :return: The schema folder path :rtype: string """ - return self.__paths['lib'] + 'schemas/' + return self._paths['lib'] + 'schemas/' - def __load_settings_from_dict(self, settings): + def _load_settings_from_dict(self, settings): """ - Loads settings info from a settings Dict + Loads settings info from a settings Dict, adds default values and validates the settings :param settings: SAML Toolkit Settings :type settings: dict @@ -209,24 +240,25 @@ def __load_settings_from_dict(self, settings): :returns: True if the settings info is valid :rtype: boolean """ + self._sp = settings.get('sp', {}) + self._idp = settings.get('idp', {}) + self._strict = settings.get('strict', True) + self._debug = settings.get('debug', False) + self._security = settings.get('security', {}) + self._contacts = settings.get('contactPerson', {}) + self._organization = settings.get('organization', {}) + self._add_default_values() + + self._errors = [] errors = self.check_settings(settings) + if len(errors) == 0: - self.__errors = [] - self.__sp = settings['sp'] - self.__idp = settings.get('idp', {}) - self.__strict = settings.get('strict', False) - self.__debug = settings.get('debug', False) - self.__security = settings.get('security', {}) - self.__contacts = settings.get('contactPerson', {}) - self.__organization = settings.get('organization', {}) - - self.__add_default_values() return True - self.__errors = errors + self._errors = errors return False - def __load_settings_from_file(self): + def _load_settings_from_file(self): """ Loads settings info from the settings json file @@ -252,65 +284,77 @@ def __load_settings_from_file(self): with open(advanced_filename, 'r') as json_data: settings.update(json.loads(json_data.read())) # Merge settings - return self.__load_settings_from_dict(settings) + return self._load_settings_from_dict(settings) - def __add_default_values(self): + def _add_default_values(self): """ Add default values if the settings info is not complete """ - self.__sp.setdefault('assertionConsumerService', {}) - self.__sp['assertionConsumerService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_POST) + self._sp.setdefault('assertionConsumerService', {}) + self._sp['assertionConsumerService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_POST) - self.__sp.setdefault('attributeConsumingService', {}) + self._sp.setdefault('attributeConsumingService', {}) - self.__sp.setdefault('singleLogoutService', {}) - self.__sp['singleLogoutService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT) + self._sp.setdefault('singleLogoutService', {}) + self._sp['singleLogoutService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT) - self.__idp.setdefault('singleLogoutService', {}) + self._idp.setdefault('singleLogoutService', {}) # Related to nameID - self.__sp.setdefault('NameIDFormat', OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED) - self.__security.setdefault('nameIdEncrypted', False) + self._sp.setdefault('NameIDFormat', OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED) + self._security.setdefault('nameIdEncrypted', False) # Metadata format - self.__security.setdefault('metadataValidUntil', None) # None means use default - self.__security.setdefault('metadataCacheDuration', None) # None means use default + self._security.setdefault('metadataValidUntil', None) # None means use default + self._security.setdefault('metadataCacheDuration', None) # None means use default # Sign provided - self.__security.setdefault('authnRequestsSigned', False) - self.__security.setdefault('logoutRequestSigned', False) - self.__security.setdefault('logoutResponseSigned', False) - self.__security.setdefault('signMetadata', False) + self._security.setdefault('authnRequestsSigned', False) + self._security.setdefault('logoutRequestSigned', False) + self._security.setdefault('logoutResponseSigned', False) + self._security.setdefault('signMetadata', False) # Sign expected - self.__security.setdefault('wantMessagesSigned', False) - self.__security.setdefault('wantAssertionsSigned', False) + self._security.setdefault('wantMessagesSigned', False) + self._security.setdefault('wantAssertionsSigned', False) # NameID element expected - self.__security.setdefault('wantNameId', True) + self._security.setdefault('wantNameId', True) # Encrypt expected - self.__security.setdefault('wantAssertionsEncrypted', False) - self.__security.setdefault('wantNameIdEncrypted', False) + self._security.setdefault('wantAssertionsEncrypted', False) + self._security.setdefault('wantNameIdEncrypted', False) # Signature Algorithm - self.__security.setdefault('signatureAlgorithm', OneLogin_Saml2_Constants.RSA_SHA1) + self._security.setdefault('signatureAlgorithm', OneLogin_Saml2_Constants.RSA_SHA256) # Digest Algorithm - self.__security.setdefault('digestAlgorithm', OneLogin_Saml2_Constants.SHA1) + self._security.setdefault('digestAlgorithm', OneLogin_Saml2_Constants.SHA256) + + # Reject Deprecated Algorithms + self._security.setdefault('rejectDeprecatedAlgorithm', False) # AttributeStatement required by default - self.__security.setdefault('wantAttributeStatement', True) + self._security.setdefault('wantAttributeStatement', True) + + # Disallow duplicate attribute names by default + self._security.setdefault('allowRepeatAttributeName', False) - self.__idp.setdefault('x509cert', '') - self.__idp.setdefault('certFingerprint', '') - self.__idp.setdefault('certFingerprintAlgorithm', 'sha1') + self._idp.setdefault('x509cert', '') + self._idp.setdefault('certFingerprint', '') + self._idp.setdefault('certFingerprintAlgorithm', 'sha1') - self.__sp.setdefault('x509cert', '') - self.__sp.setdefault('privateKey', '') + self._sp.setdefault('x509cert', '') + self._sp.setdefault('privateKey', '') - self.__security.setdefault('requestedAuthnContext', True) - self.__security.setdefault('failOnAuthnContextMismatch', False) + # Set the default filenames for the certificates and keys + self._idp.setdefault('cert_filename', 'idp.crt') + self._sp.setdefault('cert_filename', 'sp.crt') + self._sp.setdefault('key_filename', 'sp.key') + + self._security.setdefault('requestedAuthnContext', True) + self._security.setdefault('requestedAuthnContextComparison', 'exact') + self._security.setdefault('failOnAuthnContextMismatch', False) def check_settings(self, settings): """ @@ -328,7 +372,7 @@ def check_settings(self, settings): if not isinstance(settings, dict) or len(settings) == 0: errors.append('invalid_syntax') else: - if not self.__sp_validation_only: + if not self._sp_validation_only: errors += self.check_idp_settings(settings) sp_errors = self.check_sp_settings(settings) errors += sp_errors @@ -352,23 +396,24 @@ def check_idp_settings(self, settings): if not settings.get('idp'): errors.append('idp_not_found') else: + allow_single_domain_urls = self._get_allow_single_label_domain(settings) idp = settings['idp'] if not idp.get('entityId'): errors.append('idp_entityId_not_found') if not idp.get('singleSignOnService', {}).get('url'): errors.append('idp_sso_not_found') - elif not validate_url(idp['singleSignOnService']['url']): + elif not validate_url(idp['singleSignOnService']['url'], allow_single_domain_urls): errors.append('idp_sso_url_invalid') slo_url = idp.get('singleLogoutService', {}).get('url') - if slo_url and not validate_url(slo_url): + if slo_url and not validate_url(slo_url, allow_single_domain_urls): errors.append('idp_slo_url_invalid') if 'security' in settings: security = settings['security'] - exists_x509 = bool(idp.get('x509cert')) + exists_x509 = bool(self.get_idp_cert()) exists_fingerprint = bool(idp.get('certFingerprint')) exists_multix509sign = 'x509certMulti' in idp and \ @@ -383,7 +428,7 @@ def check_idp_settings(self, settings): nameid_enc = bool(security.get('nameIdEncrypted')) if (want_assert_sign or want_mes_signed) and \ - not(exists_x509 or exists_fingerprint or exists_multix509sign): + not (exists_x509 or exists_fingerprint or exists_multix509sign): errors.append('idp_cert_or_fingerprint_not_found_and_required') if nameid_enc and not (exists_x509 or exists_multix509enc): errors.append('idp_cert_not_found_and_required') @@ -406,9 +451,10 @@ def check_sp_settings(self, settings): if not settings.get('sp'): errors.append('sp_not_found') else: - # check_sp_certs uses self.__sp so I add it - old_sp = self.__sp - self.__sp = settings['sp'] + allow_single_domain_urls = self._get_allow_single_label_domain(settings) + # check_sp_certs uses self._sp so I add it + old_sp = self._sp + self._sp = settings['sp'] sp = settings['sp'] security = settings.get('security', {}) @@ -418,7 +464,7 @@ def check_sp_settings(self, settings): if not sp.get('assertionConsumerService', {}).get('url'): errors.append('sp_acs_not_found') - elif not validate_url(sp['assertionConsumerService']['url']): + elif not validate_url(sp['assertionConsumerService']['url'], allow_single_domain_urls): errors.append('sp_acs_url_invalid') if sp.get('attributeConsumingService'): @@ -447,7 +493,7 @@ def check_sp_settings(self, settings): errors.append('sp_attributeConsumingService_serviceDescription_type_invalid') slo_url = sp.get('singleLogoutService', {}).get('url') - if slo_url and not validate_url(slo_url): + if slo_url and not validate_url(slo_url, allow_single_domain_urls): errors.append('sp_sls_url_invalid') if 'signMetadata' in security and isinstance(security['signMetadata'], dict): @@ -489,9 +535,9 @@ def check_sp_settings(self, settings): ('url' not in organization or len(organization['url']) == 0): errors.append('organization_not_enought_data') break - # Restores the value that had the self.__sp + # Restores the value that had the self._sp if 'old_sp' in locals(): - self.__sp = old_sp + self._sp = old_sp return errors @@ -505,14 +551,46 @@ def check_sp_certs(self): cert = self.get_sp_cert() return key is not None and cert is not None + def get_idp_sso_url(self): + """ + Gets the IdP SSO URL. + + :returns: An URL, the SSO endpoint of the IdP + :rtype: string + """ + idp_data = self.get_idp_data() + return idp_data['singleSignOnService']['url'] + + def get_idp_slo_url(self): + """ + Gets the IdP SLO URL. + + :returns: An URL, the SLO endpoint of the IdP + :rtype: string + """ + idp_data = self.get_idp_data() + if 'url' in idp_data['singleLogoutService']: + return idp_data['singleLogoutService']['url'] + + def get_idp_slo_response_url(self): + """ + Gets the IdP SLO return URL for IdP-initiated logout. + + :returns: an URL, the SLO return endpoint of the IdP + :rtype: string + """ + idp_data = self.get_idp_data() + if 'url' in idp_data['singleLogoutService']: + return idp_data['singleLogoutService'].get('responseUrl', self.get_idp_slo_url()) + def get_sp_key(self): """ Returns the x509 private key of the SP. :returns: SP private key :rtype: string or None """ - key = self.__sp.get('privateKey') - key_file_name = self.__paths['cert'] + 'sp.key' + key = self._sp.get('privateKey') + key_file_name = self._paths['cert'] + self._sp['key_filename'] if not key and exists(key_file_name): with open(key_file_name) as f: @@ -526,8 +604,8 @@ def get_sp_cert(self): :returns: SP public cert :rtype: string or None """ - cert = self.__sp.get('x509cert') - cert_file_name = self.__paths['cert'] + 'sp.crt' + cert = self._sp.get('x509cert') + cert_file_name = self._paths['cert'] + self._sp['cert_filename'] if not cert and exists(cert_file_name): with open(cert_file_name) as f: @@ -542,8 +620,8 @@ def get_sp_cert_new(self): :returns: SP public cert new :rtype: string or None """ - cert = self.__sp.get('x509certNew') - cert_file_name = self.__paths['cert'] + 'sp_new.crt' + cert = self._sp.get('x509certNew') + cert_file_name = self._paths['cert'] + 'sp_new.crt' if not cert and exists(cert_file_name): with open(cert_file_name) as f: @@ -557,7 +635,12 @@ def get_idp_cert(self): :returns: IdP public cert :rtype: string """ - return self.__idp.get('x509cert') + cert = self._idp.get('x509cert') + cert_file_name = self.get_cert_path() + self._idp['cert_filename'] + if not cert and exists(cert_file_name): + with open(cert_file_name) as f: + cert = f.read() + return cert or None def get_idp_data(self): """ @@ -566,7 +649,7 @@ def get_idp_data(self): :returns: IdP info :rtype: dict """ - return self.__idp + return self._idp def get_sp_data(self): """ @@ -575,7 +658,7 @@ def get_sp_data(self): :returns: SP info :rtype: dict """ - return self.__sp + return self._sp def get_security_data(self): """ @@ -584,7 +667,7 @@ def get_security_data(self): :returns: Security info :rtype: dict """ - return self.__security + return self._security def get_contacts(self): """ @@ -593,7 +676,7 @@ def get_contacts(self): :returns: Contacts info :rtype: dict """ - return self.__contacts + return self._contacts def get_organization(self): """ @@ -602,7 +685,7 @@ def get_organization(self): :returns: Organization info :rtype: dict """ - return self.__organization + return self._organization def get_sp_metadata(self): """ @@ -610,25 +693,25 @@ def get_sp_metadata(self): :returns: SP metadata (xml) :rtype: string """ - metadata = OneLogin_Saml2_Metadata.builder( - self.__sp, self.__security['authnRequestsSigned'], - self.__security['wantAssertionsSigned'], - self.__security['metadataValidUntil'], - self.__security['metadataCacheDuration'], + metadata = self.metadata_class.builder( + self._sp, self._security['authnRequestsSigned'], + self._security['wantAssertionsSigned'], + self._security['metadataValidUntil'], + self._security['metadataCacheDuration'], self.get_contacts(), self.get_organization() ) - add_encryption = self.__security['wantNameIdEncrypted'] or self.__security['wantAssertionsEncrypted'] + add_encryption = self._security['wantNameIdEncrypted'] or self._security['wantAssertionsEncrypted'] cert_new = self.get_sp_cert_new() - metadata = OneLogin_Saml2_Metadata.add_x509_key_descriptors(metadata, cert_new, add_encryption) + metadata = self.metadata_class.add_x509_key_descriptors(metadata, cert_new, add_encryption) cert = self.get_sp_cert() - metadata = OneLogin_Saml2_Metadata.add_x509_key_descriptors(metadata, cert, add_encryption) + metadata = self.metadata_class.add_x509_key_descriptors(metadata, cert, add_encryption) # Sign metadata - if 'signMetadata' in self.__security and self.__security['signMetadata'] is not False: - if self.__security['signMetadata'] is True: + if 'signMetadata' in self._security and self._security['signMetadata'] is not False: + if self._security['signMetadata'] is True: # Use the SP's normal key to sign the metadata: if not cert: raise OneLogin_Saml2_Error( @@ -644,16 +727,16 @@ def get_sp_metadata(self): ) else: # Use a custom key to sign the metadata: - if ('keyFileName' not in self.__security['signMetadata'] or - 'certFileName' not in self.__security['signMetadata']): + if ('keyFileName' not in self._security['signMetadata'] or + 'certFileName' not in self._security['signMetadata']): raise OneLogin_Saml2_Error( 'Invalid Setting: signMetadata value of the sp is not valid', OneLogin_Saml2_Error.SETTINGS_INVALID_SYNTAX ) - key_file_name = self.__security['signMetadata']['keyFileName'] - cert_file_name = self.__security['signMetadata']['certFileName'] - key_metadata_file = self.__paths['cert'] + key_file_name - cert_metadata_file = self.__paths['cert'] + cert_file_name + key_file_name = self._security['signMetadata']['keyFileName'] + cert_file_name = self._security['signMetadata']['certFileName'] + key_metadata_file = self._paths['cert'] + key_file_name + cert_metadata_file = self._paths['cert'] + cert_file_name try: with open(key_metadata_file, 'r') as f_metadata_key: @@ -675,10 +758,10 @@ def get_sp_metadata(self): cert_metadata_file ) - signature_algorithm = self.__security['signatureAlgorithm'] - digest_algorithm = self.__security['digestAlgorithm'] + signature_algorithm = self._security['signatureAlgorithm'] + digest_algorithm = self._security['digestAlgorithm'] - metadata = OneLogin_Saml2_Metadata.sign_metadata(metadata, key_metadata, cert_metadata, signature_algorithm, digest_algorithm) + metadata = self.metadata_class.sign_metadata(metadata, key_metadata, cert_metadata, signature_algorithm, digest_algorithm) return metadata @@ -699,7 +782,7 @@ def validate_metadata(self, xml): raise Exception('Empty string supplied as input') errors = [] - root = OneLogin_Saml2_XML.validate_xml(xml, 'saml-schema-metadata-2.0.xsd', self.__debug) + root = OneLogin_Saml2_XML.validate_xml(xml, 'saml-schema-metadata-2.0.xsd', self._debug) if isinstance(root, str): errors.append(root) else: @@ -725,38 +808,38 @@ def format_idp_cert(self): """ Formats the IdP cert. """ - self.__idp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self.__idp['x509cert']) + self._idp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self._idp['x509cert']) def format_idp_cert_multi(self): """ Formats the Multple IdP certs. """ - if 'x509certMulti' in self.__idp: - if 'signing' in self.__idp['x509certMulti']: - for idx in range(len(self.__idp['x509certMulti']['signing'])): - self.__idp['x509certMulti']['signing'][idx] = OneLogin_Saml2_Utils.format_cert(self.__idp['x509certMulti']['signing'][idx]) + if 'x509certMulti' in self._idp: + if 'signing' in self._idp['x509certMulti']: + for idx in range(len(self._idp['x509certMulti']['signing'])): + self._idp['x509certMulti']['signing'][idx] = OneLogin_Saml2_Utils.format_cert(self._idp['x509certMulti']['signing'][idx]) - if 'encryption' in self.__idp['x509certMulti']: - for idx in range(len(self.__idp['x509certMulti']['encryption'])): - self.__idp['x509certMulti']['encryption'][idx] = OneLogin_Saml2_Utils.format_cert(self.__idp['x509certMulti']['encryption'][idx]) + if 'encryption' in self._idp['x509certMulti']: + for idx in range(len(self._idp['x509certMulti']['encryption'])): + self._idp['x509certMulti']['encryption'][idx] = OneLogin_Saml2_Utils.format_cert(self._idp['x509certMulti']['encryption'][idx]) def format_sp_cert(self): """ Formats the SP cert. """ - self.__sp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self.__sp['x509cert']) + self._sp['x509cert'] = OneLogin_Saml2_Utils.format_cert(self._sp['x509cert']) def format_sp_cert_new(self): """ Formats the SP cert. """ - self.__sp['x509certNew'] = OneLogin_Saml2_Utils.format_cert(self.__sp['x509certNew']) + self._sp['x509certNew'] = OneLogin_Saml2_Utils.format_cert(self._sp['x509certNew']) def format_sp_key(self): """ Formats the private key. """ - self.__sp['privateKey'] = OneLogin_Saml2_Utils.format_private_key(self.__sp['privateKey']) + self._sp['privateKey'] = OneLogin_Saml2_Utils.format_private_key(self._sp['privateKey']) def get_errors(self): """ @@ -765,7 +848,7 @@ def get_errors(self): :returns: Errors :rtype: list """ - return self.__errors + return self._errors def set_strict(self, value): """ @@ -776,7 +859,7 @@ def set_strict(self, value): """ assert isinstance(value, bool) - self.__strict = value + self._strict = value def is_strict(self): """ @@ -785,7 +868,7 @@ def is_strict(self): :returns: Strict parameter :rtype: boolean """ - return self.__strict + return self._strict def is_debug_active(self): """ @@ -794,4 +877,8 @@ def is_debug_active(self): :returns: Debug parameter :rtype: boolean """ - return self.__debug + return self._debug + + def _get_allow_single_label_domain(self, settings): + security = settings.get('security', {}) + return 'allowSingleLabelDomains' in security.keys() and security['allowSingleLabelDomains'] diff --git a/src/onelogin/saml2/utils.py b/src/onelogin/saml2/utils.py index 4647c230..40313dd6 100644 --- a/src/onelogin/saml2/utils.py +++ b/src/onelogin/saml2/utils.py @@ -2,17 +2,15 @@ """ OneLogin_Saml2_Utils class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Auxiliary class of OneLogin's Python Toolkit. +Auxiliary class of SAML Python Toolkit. """ import base64 +import warnings from copy import deepcopy -import calendar -from datetime import datetime +from datetime import datetime, timezone from hashlib import sha1, sha256, sha384, sha512 from isodate import parse_duration as duration_parser import re @@ -20,7 +18,6 @@ from functools import wraps from uuid import uuid4 from xml.dom.minidom import Element - import zlib import xmlsec @@ -31,8 +28,9 @@ try: - from urllib.parse import quote_plus # py3 + from urllib.parse import quote_plus, urlsplit, urlunsplit # py3 except ImportError: + from urlparse import urlsplit, urlunsplit from urllib import quote_plus # py2 @@ -42,15 +40,17 @@ def return_false_on_exception(func): raised by that function and return False. It may be overridden by passing a "raise_exceptions" keyword argument when calling the wrapped function. """ + @wraps(func) def exceptfalse(*args, **kwargs): - if not kwargs.pop('raise_exceptions', False): + if not kwargs.pop("raise_exceptions", False): try: return func(*args, **kwargs) except Exception: return False else: return func(*args, **kwargs) + return exceptfalse @@ -62,8 +62,12 @@ class OneLogin_Saml2_Utils(object): """ - RESPONSE_SIGNATURE_XPATH = '/samlp:Response/ds:Signature' - ASSERTION_SIGNATURE_XPATH = '/samlp:Response/saml:Assertion/ds:Signature' + RESPONSE_SIGNATURE_XPATH = "/samlp:Response/ds:Signature" + ASSERTION_SIGNATURE_XPATH = "/samlp:Response/saml:Assertion/ds:Signature" + + TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" + TIME_FORMAT_2 = "%Y-%m-%dT%H:%M:%S.%fZ" + TIME_FORMAT_WITH_FRAGMENT = re.compile(r"^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})(\.\d*)?Z?$") @staticmethod def escape_url(url, lowercase_urlencoding=False): @@ -137,13 +141,13 @@ def format_cert(cert, heads=True): :returns: Formatted cert :rtype: string """ - x509_cert = cert.replace('\x0D', '') - x509_cert = x509_cert.replace('\r', '') - x509_cert = x509_cert.replace('\n', '') + x509_cert = cert.replace("\x0D", "") + x509_cert = x509_cert.replace("\r", "") + x509_cert = x509_cert.replace("\n", "") if len(x509_cert) > 0: - x509_cert = x509_cert.replace('-----BEGIN CERTIFICATE-----', '') - x509_cert = x509_cert.replace('-----END CERTIFICATE-----', '') - x509_cert = x509_cert.replace(' ', '') + x509_cert = x509_cert.replace("-----BEGIN CERTIFICATE-----", "") + x509_cert = x509_cert.replace("-----END CERTIFICATE-----", "") + x509_cert = x509_cert.replace(" ", "") if heads: x509_cert = "-----BEGIN CERTIFICATE-----\n" + "\n".join(wrap(x509_cert, 64)) + "\n-----END CERTIFICATE-----\n" @@ -164,20 +168,20 @@ def format_private_key(key, heads=True): :returns: Formated private key :rtype: string """ - private_key = key.replace('\x0D', '') - private_key = private_key.replace('\r', '') - private_key = private_key.replace('\n', '') + private_key = key.replace("\x0D", "") + private_key = private_key.replace("\r", "") + private_key = private_key.replace("\n", "") if len(private_key) > 0: - if private_key.find('-----BEGIN PRIVATE KEY-----') != -1: - private_key = private_key.replace('-----BEGIN PRIVATE KEY-----', '') - private_key = private_key.replace('-----END PRIVATE KEY-----', '') - private_key = private_key.replace(' ', '') + if private_key.find("-----BEGIN PRIVATE KEY-----") != -1: + private_key = private_key.replace("-----BEGIN PRIVATE KEY-----", "") + private_key = private_key.replace("-----END PRIVATE KEY-----", "") + private_key = private_key.replace(" ", "") if heads: private_key = "-----BEGIN PRIVATE KEY-----\n" + "\n".join(wrap(private_key, 64)) + "\n-----END PRIVATE KEY-----\n" else: - private_key = private_key.replace('-----BEGIN RSA PRIVATE KEY-----', '') - private_key = private_key.replace('-----END RSA PRIVATE KEY-----', '') - private_key = private_key.replace(' ', '') + private_key = private_key.replace("-----BEGIN RSA PRIVATE KEY-----", "") + private_key = private_key.replace("-----END RSA PRIVATE KEY-----", "") + private_key = private_key.replace(" ", "") if heads: private_key = "-----BEGIN RSA PRIVATE KEY-----\n" + "\n".join(wrap(private_key, 64)) + "\n-----END RSA PRIVATE KEY-----\n" return private_key @@ -202,38 +206,35 @@ def redirect(url, parameters={}, request_data={}): assert isinstance(url, compat.str_type) assert isinstance(parameters, dict) - if url.startswith('/'): - url = '%s%s' % (OneLogin_Saml2_Utils.get_self_url_host(request_data), url) + if url.startswith("/"): + url = "%s%s" % (OneLogin_Saml2_Utils.get_self_url_host(request_data), url) # Verify that the URL is to a http or https site. - if re.search('^https?://', url) is None: - raise OneLogin_Saml2_Error( - 'Redirect to invalid URL: ' + url, - OneLogin_Saml2_Error.REDIRECT_INVALID_URL - ) + if re.search("^https?://", url, flags=re.IGNORECASE) is None: + raise OneLogin_Saml2_Error("Redirect to invalid URL: " + url, OneLogin_Saml2_Error.REDIRECT_INVALID_URL) # Add encoded parameters - if url.find('?') < 0: - param_prefix = '?' + if url.find("?") < 0: + param_prefix = "?" else: - param_prefix = '&' + param_prefix = "&" for name, value in parameters.items(): if value is None: param = OneLogin_Saml2_Utils.escape_url(name) elif isinstance(value, list): - param = '' + param = "" for val in value: - param += OneLogin_Saml2_Utils.escape_url(name) + '[]=' + OneLogin_Saml2_Utils.escape_url(val) + '&' + param += OneLogin_Saml2_Utils.escape_url(name) + "[]=" + OneLogin_Saml2_Utils.escape_url(val) + "&" if len(param) > 0: param = param[0:-1] else: - param = OneLogin_Saml2_Utils.escape_url(name) + '=' + OneLogin_Saml2_Utils.escape_url(value) + param = OneLogin_Saml2_Utils.escape_url(name) + "=" + OneLogin_Saml2_Utils.escape_url(value) if param: url += param_prefix + param - param_prefix = '&' + param_prefix = "&" return url @@ -250,27 +251,24 @@ def get_self_url_host(request_data): :rtype: string """ current_host = OneLogin_Saml2_Utils.get_self_host(request_data) - port = '' - if OneLogin_Saml2_Utils.is_https(request_data): - protocol = 'https' - else: - protocol = 'http' - - if 'server_port' in request_data and request_data['server_port'] is not None: - port_number = str(request_data['server_port']) - port = ':' + port_number + protocol = "https" if OneLogin_Saml2_Utils.is_https(request_data) else "http" - if protocol == 'http' and port_number == '80': - port = '' - elif protocol == 'https' and port_number == '443': - port = '' + if request_data.get("server_port") is not None: + warnings.warn( + "The server_port key in request data is deprecated. " "The http_host key should include a port, if required.", + category=DeprecationWarning, + ) + port_suffix = ":%s" % request_data["server_port"] + if not current_host.endswith(port_suffix): + if not ((protocol == "https" and port_suffix == ":443") or (protocol == "http" and port_suffix == ":80")): + current_host += port_suffix - return '%s://%s%s' % (protocol, current_host, port) + return "%s://%s" % (protocol, current_host) @staticmethod def get_self_host(request_data): """ - Returns the current host. + Returns the current host (which may include a port number part). :param request_data: The request as a dict :type: dict @@ -278,23 +276,12 @@ def get_self_host(request_data): :return: The current host :rtype: string """ - if 'http_host' in request_data: - current_host = request_data['http_host'] - elif 'server_name' in request_data: - current_host = request_data['server_name'] - else: - raise Exception('No hostname defined') - - if ':' in current_host: - current_host_data = current_host.split(':') - possible_port = current_host_data[-1] - try: - int(possible_port) - current_host = current_host_data[0] - except ValueError: - current_host = ':'.join(current_host_data) - - return current_host + if "http_host" in request_data: + return request_data["http_host"] + elif "server_name" in request_data: + warnings.warn("The server_name key in request data is undocumented & deprecated.", category=DeprecationWarning) + return request_data["server_name"] + raise Exception("No hostname defined") @staticmethod def is_https(request_data): @@ -307,8 +294,9 @@ def is_https(request_data): :return: False if https is not active :rtype: boolean """ - is_https = 'https' in request_data and request_data['https'] != 'off' - is_https = is_https or ('server_port' in request_data and str(request_data['server_port']) == '443') + is_https = "https" in request_data and request_data["https"] != "off" + # TODO: this use of server_port should be removed too + is_https = is_https or ("server_port" in request_data and str(request_data["server_port"]) == "443") return is_https @staticmethod @@ -323,15 +311,15 @@ def get_self_url_no_query(request_data): :rtype: string """ self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) - script_name = request_data['script_name'] + script_name = request_data["script_name"] if script_name: - if script_name[0] != '/': - script_name = '/' + script_name + if script_name[0] != "/": + script_name = "/" + script_name else: - script_name = '' + script_name = "" self_url_no_query = self_url_host + script_name - if 'path_info' in request_data: - self_url_no_query += request_data['path_info'] + if "path_info" in request_data: + self_url_no_query += request_data["path_info"] return self_url_no_query @@ -347,11 +335,11 @@ def get_self_routed_url_no_query(request_data): :rtype: string """ self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) - route = '' - if 'request_uri' in request_data and request_data['request_uri']: - route = request_data['request_uri'] - if 'query_string' in request_data and request_data['query_string']: - route = route.replace(request_data['query_string'], '') + route = "" + if "request_uri" in request_data and request_data["request_uri"]: + route = request_data["request_uri"] + if "query_string" in request_data and request_data["query_string"]: + route = route.replace(request_data["query_string"], "") return self_url_host + route @@ -368,11 +356,11 @@ def get_self_url(request_data): """ self_url_host = OneLogin_Saml2_Utils.get_self_url_host(request_data) - request_uri = '' - if 'request_uri' in request_data: - request_uri = request_data['request_uri'] - if not request_uri.startswith('/'): - match = re.search('^https?://[^/]*(/.*)', request_uri) + request_uri = "" + if "request_uri" in request_data: + request_uri = request_data["request_uri"] + if not request_uri.startswith("/"): + match = re.search("^https?://[^/]*(/.*)", request_uri) if match is not None: request_uri = match.groups()[0] @@ -386,7 +374,7 @@ def generate_unique_id(): :return: A unique string :rtype: string """ - return 'ONELOGIN_%s' % sha1(compat.to_bytes(uuid4().hex)).hexdigest() + return "ONELOGIN_%s" % sha1(compat.to_bytes(uuid4().hex)).hexdigest() @staticmethod def parse_time_to_SAML(time): @@ -400,8 +388,8 @@ def parse_time_to_SAML(time): :return: SAML2 timestamp. :rtype: string """ - data = datetime.utcfromtimestamp(float(time)) - return data.strftime('%Y-%m-%dT%H:%M:%SZ') + data = datetime.fromtimestamp(float(time), timezone.utc) + return data.strftime(OneLogin_Saml2_Utils.TIME_FORMAT) @staticmethod def parse_SAML_to_time(timestr): @@ -416,10 +404,17 @@ def parse_SAML_to_time(timestr): :rtype: int """ try: - data = datetime.strptime(timestr, '%Y-%m-%dT%H:%M:%SZ') + data = datetime.strptime(timestr, OneLogin_Saml2_Utils.TIME_FORMAT).replace(tzinfo=timezone.utc) except ValueError: - data = datetime.strptime(timestr, '%Y-%m-%dT%H:%M:%S.%fZ') - return calendar.timegm(data.utctimetuple()) + try: + data = datetime.strptime(timestr, OneLogin_Saml2_Utils.TIME_FORMAT_2).replace(tzinfo=timezone.utc) + except ValueError: + elem = OneLogin_Saml2_Utils.TIME_FORMAT_WITH_FRAGMENT.match(timestr) + if not elem: + raise Exception("time data %s does not match format %s" % (timestr, r"yyyy-mm-ddThh:mm:ss(\.s+)?Z")) + data = datetime.strptime(elem.groups()[0] + "Z", OneLogin_Saml2_Utils.TIME_FORMAT).replace(tzinfo=timezone.utc) + + return int(data.timestamp()) @staticmethod def now(): @@ -427,7 +422,7 @@ def now(): :return: unix timestamp of actual time. :rtype: int """ - return calendar.timegm(datetime.utcnow().utctimetuple()) + return int(datetime.now(timezone.utc).timestamp()) @staticmethod def parse_duration(duration, timestamp=None): @@ -449,10 +444,10 @@ def parse_duration(duration, timestamp=None): timedelta = duration_parser(duration) if timestamp is None: - data = datetime.utcnow() + timedelta + data = datetime.now(timezone.utc) + timedelta else: - data = datetime.utcfromtimestamp(timestamp) + timedelta - return calendar.timegm(data.utctimetuple()) + data = datetime.fromtimestamp(timestamp, timezone.utc) + timedelta + return int(data.timestamp()) @staticmethod def get_expire_time(cache_duration=None, valid_until=None): @@ -482,7 +477,7 @@ def get_expire_time(cache_duration=None, valid_until=None): expire_time = valid_until_time if expire_time is not None: - return '%d' % expire_time + return "%d" % expire_time return None @staticmethod @@ -495,7 +490,7 @@ def delete_local_session(callback=None): callback() @staticmethod - def calculate_x509_fingerprint(x509_cert, alg='sha1'): + def calculate_x509_fingerprint(x509_cert, alg="sha1"): """ Calculates the fingerprint of a formatted x509cert. @@ -510,21 +505,21 @@ def calculate_x509_fingerprint(x509_cert, alg='sha1'): """ assert isinstance(x509_cert, compat.str_type) - lines = x509_cert.split('\n') - data = '' + lines = x509_cert.split("\n") + data = "" inData = False for line in lines: # Remove '\r' from end of line if present. line = line.rstrip() if not inData: - if line == '-----BEGIN CERTIFICATE-----': + if line == "-----BEGIN CERTIFICATE-----": inData = True - elif line == '-----BEGIN PUBLIC KEY-----' or line == '-----BEGIN RSA PRIVATE KEY-----': + elif line == "-----BEGIN PUBLIC KEY-----" or line == "-----BEGIN RSA PRIVATE KEY-----": # This isn't an X509 certificate. return None else: - if line == '-----END CERTIFICATE-----': + if line == "-----END CERTIFICATE-----": break # Append the current line to the certificate data. @@ -535,11 +530,11 @@ def calculate_x509_fingerprint(x509_cert, alg='sha1'): decoded_data = base64.b64decode(compat.to_bytes(data)) - if alg == 'sha512': + if alg == "sha512": fingerprint = sha512(decoded_data) - elif alg == 'sha384': + elif alg == "sha384": fingerprint = sha384(decoded_data) - elif alg == 'sha256': + elif alg == "sha256": fingerprint = sha256(decoded_data) else: fingerprint = sha1(decoded_data) @@ -557,7 +552,7 @@ def format_finger_print(fingerprint): :returns: Formatted fingerprint :rtype: string """ - formatted_fingerprint = fingerprint.replace(':', '') + formatted_fingerprint = fingerprint.replace(":", "") return formatted_fingerprint.lower() @staticmethod @@ -588,13 +583,13 @@ def generate_name_id(value, sp_nq, sp_format=None, cert=None, debug=False, nq=No """ root = OneLogin_Saml2_XML.make_root("{%s}container" % OneLogin_Saml2_Constants.NS_SAML) - name_id = OneLogin_Saml2_XML.make_child(root, '{%s}NameID' % OneLogin_Saml2_Constants.NS_SAML) + name_id = OneLogin_Saml2_XML.make_child(root, "{%s}NameID" % OneLogin_Saml2_Constants.NS_SAML) if sp_nq is not None: - name_id.set('SPNameQualifier', sp_nq) + name_id.set("SPNameQualifier", sp_nq) if sp_format is not None: - name_id.set('Format', sp_format) + name_id.set("Format", sp_format) if nq is not None: - name_id.set('NameQualifier', nq) + name_id.set("NameQualifier", nq) name_id.text = value if cert is not None: @@ -605,8 +600,7 @@ def generate_name_id(value, sp_nq, sp_format=None, cert=None, debug=False, nq=No manager.add_key(xmlsec.Key.from_memory(cert, xmlsec.KeyFormat.CERT_PEM, None)) # Prepare for encryption - enc_data = xmlsec.template.encrypted_data_create( - root, xmlsec.Transform.AES128, type=xmlsec.EncryptionType.ELEMENT, ns="xenc") + enc_data = xmlsec.template.encrypted_data_create(root, xmlsec.Transform.AES128, type=xmlsec.EncryptionType.ELEMENT, ns="xenc") xmlsec.template.encrypted_data_ensure_cipher_value(enc_data) key_info = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig") @@ -617,7 +611,7 @@ def generate_name_id(value, sp_nq, sp_format=None, cert=None, debug=False, nq=No enc_ctx = xmlsec.EncryptionContext(manager) enc_ctx.key = xmlsec.Key.generate(xmlsec.KeyData.AES, 128, xmlsec.KeyDataType.SESSION) enc_data = enc_ctx.encrypt_xml(enc_data, name_id) - return '' + compat.to_string(OneLogin_Saml2_XML.to_string(enc_data)) + '' + return "" + compat.to_string(OneLogin_Saml2_XML.to_string(enc_data)) + "" else: return OneLogin_Saml2_XML.extract_tag_text(root, "saml:NameID") @@ -634,30 +628,24 @@ def get_status(dom): """ status = {} - status_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status') + status_entry = OneLogin_Saml2_XML.query(dom, "/samlp:Response/samlp:Status") if len(status_entry) != 1: - raise OneLogin_Saml2_ValidationError( - 'Missing Status on response', - OneLogin_Saml2_ValidationError.MISSING_STATUS - ) + raise OneLogin_Saml2_ValidationError("Missing Status on response", OneLogin_Saml2_ValidationError.MISSING_STATUS) - code_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status/samlp:StatusCode', status_entry[0]) + code_entry = OneLogin_Saml2_XML.query(dom, "/samlp:Response/samlp:Status/samlp:StatusCode", status_entry[0]) if len(code_entry) != 1: - raise OneLogin_Saml2_ValidationError( - 'Missing Status Code on response', - OneLogin_Saml2_ValidationError.MISSING_STATUS_CODE - ) + raise OneLogin_Saml2_ValidationError("Missing Status Code on response", OneLogin_Saml2_ValidationError.MISSING_STATUS_CODE) code = code_entry[0].values()[0] - status['code'] = code + status["code"] = code - status['msg'] = '' - message_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status/samlp:StatusMessage', status_entry[0]) + status["msg"] = "" + message_entry = OneLogin_Saml2_XML.query(dom, "/samlp:Response/samlp:Status/samlp:StatusMessage", status_entry[0]) if len(message_entry) == 0: - subcode_entry = OneLogin_Saml2_XML.query(dom, '/samlp:Response/samlp:Status/samlp:StatusCode/samlp:StatusCode', status_entry[0]) + subcode_entry = OneLogin_Saml2_XML.query(dom, "/samlp:Response/samlp:Status/samlp:StatusCode/samlp:StatusCode", status_entry[0]) if len(subcode_entry) == 1: - status['msg'] = subcode_entry[0].values()[0] + status["msg"] = subcode_entry[0].values()[0] elif len(message_entry) == 1: - status['msg'] = OneLogin_Saml2_XML.element_text(message_entry[0]) + status["msg"] = OneLogin_Saml2_XML.element_text(message_entry[0]) return status @@ -697,7 +685,7 @@ def decrypt_element(encrypted_data, key, debug=False, inplace=False): return enc_ctx.decrypt(encrypted_data) @staticmethod - def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1, digest_algorithm=OneLogin_Saml2_Constants.SHA1): + def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA256, digest_algorithm=OneLogin_Saml2_Constants.SHA256): """ Adds signature key and senders certificate to an element (Message or Assertion). @@ -723,8 +711,8 @@ def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constant :returns: Signed XML :rtype: string """ - if xml is None or xml == '': - raise Exception('Empty string supplied as input') + if xml is None or xml == "": + raise Exception("Empty string supplied as input") elem = OneLogin_Saml2_XML.to_etree(xml) @@ -733,33 +721,33 @@ def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constant OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1, OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256, OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384, - OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512 + OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512, } - sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA1) + sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA256) - signature = xmlsec.template.create(elem, xmlsec.Transform.EXCL_C14N, sign_algorithm_transform, ns='ds') + signature = xmlsec.template.create(elem, xmlsec.Transform.EXCL_C14N, sign_algorithm_transform, ns="ds") - issuer = OneLogin_Saml2_XML.query(elem, '//saml:Issuer') + issuer = OneLogin_Saml2_XML.query(elem, "//saml:Issuer") if len(issuer) > 0: issuer = issuer[0] issuer.addnext(signature) elem_to_sign = issuer.getparent() else: - entity_descriptor = OneLogin_Saml2_XML.query(elem, '//md:EntityDescriptor') + entity_descriptor = OneLogin_Saml2_XML.query(elem, "//md:EntityDescriptor") if len(entity_descriptor) > 0: elem.insert(0, signature) else: elem[0].insert(0, signature) elem_to_sign = elem - elem_id = elem_to_sign.get('ID', None) + elem_id = elem_to_sign.get("ID", None) if elem_id is not None: if elem_id: - elem_id = '#' + elem_id + elem_id = "#" + elem_id else: generated_id = generated_id = OneLogin_Saml2_Utils.generate_unique_id() - elem_id = '#' + generated_id - elem_to_sign.attrib['ID'] = generated_id + elem_id = "#" + generated_id + elem_to_sign.attrib["ID"] = generated_id xmlsec.enable_debug_trace(debug) xmlsec.tree.add_ids(elem_to_sign, ["ID"]) @@ -768,9 +756,9 @@ def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constant OneLogin_Saml2_Constants.SHA1: xmlsec.Transform.SHA1, OneLogin_Saml2_Constants.SHA256: xmlsec.Transform.SHA256, OneLogin_Saml2_Constants.SHA384: xmlsec.Transform.SHA384, - OneLogin_Saml2_Constants.SHA512: xmlsec.Transform.SHA512 + OneLogin_Saml2_Constants.SHA512: xmlsec.Transform.SHA512, } - digest_algorithm_transform = digest_algorithm_transform_map.get(digest_algorithm, xmlsec.Transform.SHA1) + digest_algorithm_transform = digest_algorithm_transform_map.get(digest_algorithm, xmlsec.Transform.SHA256) ref = xmlsec.template.add_reference(signature, digest_algorithm_transform, uri=elem_id) xmlsec.template.add_transform(ref, xmlsec.Transform.ENVELOPED) @@ -789,7 +777,7 @@ def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constant @staticmethod @return_false_on_exception - def validate_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False, xpath=None, multicerts=None): + def validate_sign(xml, cert=None, fingerprint=None, fingerprintalg="sha1", validatecert=False, debug=False, xpath=None, multicerts=None): """ Validates a signature (Message or Assertion). @@ -820,8 +808,8 @@ def validate_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', valid :param raise_exceptions: Whether to return false on failure or raise an exception :type raise_exceptions: Boolean """ - if xml is None or xml == '': - raise Exception('Empty string supplied as input') + if xml is None or xml == "": + raise Exception("Empty string supplied as input") elem = OneLogin_Saml2_XML.to_etree(xml) xmlsec.enable_debug_trace(debug) @@ -848,19 +836,13 @@ def validate_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', valid for cert in multicerts: if OneLogin_Saml2_Utils.validate_node_sign(signature_node, elem, cert, fingerprint, fingerprintalg, validatecert, False, raise_exceptions=False): return True - raise OneLogin_Saml2_ValidationError( - 'Signature validation failed. SAML Response rejected.', - OneLogin_Saml2_ValidationError.INVALID_SIGNATURE - ) + raise OneLogin_Saml2_ValidationError("Signature validation failed. SAML Response rejected.", OneLogin_Saml2_ValidationError.INVALID_SIGNATURE) else: - raise OneLogin_Saml2_ValidationError( - 'Expected exactly one signature node; got {}.'.format(len(signature_nodes)), - OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES - ) + raise OneLogin_Saml2_ValidationError("Expected exactly one signature node; got {}.".format(len(signature_nodes)), OneLogin_Saml2_ValidationError.WRONG_NUMBER_OF_SIGNATURES) @staticmethod @return_false_on_exception - def validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False): + def validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg="sha1", validatecert=False, debug=False): """ Validates a signature of a EntityDescriptor. @@ -885,33 +867,33 @@ def validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha :param raise_exceptions: Whether to return false on failure or raise an exception :type raise_exceptions: Boolean """ - if xml is None or xml == '': - raise Exception('Empty string supplied as input') + if xml is None or xml == "": + raise Exception("Empty string supplied as input") elem = OneLogin_Saml2_XML.to_etree(xml) xmlsec.enable_debug_trace(debug) xmlsec.tree.add_ids(elem, ["ID"]) - signature_nodes = OneLogin_Saml2_XML.query(elem, '/md:EntitiesDescriptor/ds:Signature') + signature_nodes = OneLogin_Saml2_XML.query(elem, "/md:EntitiesDescriptor/ds:Signature") if len(signature_nodes) == 0: - signature_nodes += OneLogin_Saml2_XML.query(elem, '/md:EntityDescriptor/ds:Signature') + signature_nodes += OneLogin_Saml2_XML.query(elem, "/md:EntityDescriptor/ds:Signature") if len(signature_nodes) == 0: - signature_nodes += OneLogin_Saml2_XML.query(elem, '/md:EntityDescriptor/md:SPSSODescriptor/ds:Signature') - signature_nodes += OneLogin_Saml2_XML.query(elem, '/md:EntityDescriptor/md:IDPSSODescriptor/ds:Signature') + signature_nodes += OneLogin_Saml2_XML.query(elem, "/md:EntityDescriptor/md:SPSSODescriptor/ds:Signature") + signature_nodes += OneLogin_Saml2_XML.query(elem, "/md:EntityDescriptor/md:IDPSSODescriptor/ds:Signature") if len(signature_nodes) > 0: for signature_node in signature_nodes: - # Raises expection if invalid + # Raises exception if invalid OneLogin_Saml2_Utils.validate_node_sign(signature_node, elem, cert, fingerprint, fingerprintalg, validatecert, debug, raise_exceptions=True) return True else: - raise Exception('Could not validate metadata signature: No signature nodes found.') + raise Exception("Could not validate metadata signature: No signature nodes found.") @staticmethod @return_false_on_exception - def validate_node_sign(signature_node, elem, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False): + def validate_node_sign(signature_node, elem, cert=None, fingerprint=None, fingerprintalg="sha1", validatecert=False, debug=False): """ Validates a signature node. @@ -939,8 +921,8 @@ def validate_node_sign(signature_node, elem, cert=None, fingerprint=None, finger :param raise_exceptions: Whether to return false on failure or raise an exception :type raise_exceptions: Boolean """ - if (cert is None or cert == '') and fingerprint: - x509_certificate_nodes = OneLogin_Saml2_XML.query(signature_node, '//ds:Signature/ds:KeyInfo/ds:X509Data/ds:X509Certificate') + if (cert is None or cert == "") and fingerprint: + x509_certificate_nodes = OneLogin_Saml2_XML.query(signature_node, "//ds:Signature/ds:KeyInfo/ds:X509Data/ds:X509Certificate") if len(x509_certificate_nodes) > 0: x509_certificate_node = x509_certificate_nodes[0] x509_cert_value = OneLogin_Saml2_XML.element_text(x509_certificate_node) @@ -949,17 +931,14 @@ def validate_node_sign(signature_node, elem, cert=None, fingerprint=None, finger if fingerprint == x509_fingerprint_value: cert = x509_cert_value_formatted - if cert is None or cert == '': - raise OneLogin_Saml2_Error( - 'Could not validate node signature: No certificate provided.', - OneLogin_Saml2_Error.CERT_NOT_FOUND - ) + if cert is None or cert == "": + raise OneLogin_Saml2_Error("Could not validate node signature: No certificate provided.", OneLogin_Saml2_Error.CERT_NOT_FOUND) # Check if Reference URI is empty - reference_elem = OneLogin_Saml2_XML.query(signature_node, '//ds:Reference') - if len(reference_elem) > 0: - if reference_elem[0].get('URI') == '': - reference_elem[0].set('URI', '#%s' % signature_node.getparent().get('ID')) + # reference_elem = OneLogin_Saml2_XML.query(signature_node, '//ds:Reference') + # if len(reference_elem) > 0: + # if reference_elem[0].get('URI') == '': + # reference_elem[0].set('URI', '#%s' % signature_node.getparent().get('ID')) if validatecert: manager = xmlsec.KeysManager() @@ -974,16 +953,12 @@ def validate_node_sign(signature_node, elem, cert=None, fingerprint=None, finger try: dsig_ctx.verify(signature_node) except Exception as err: - raise OneLogin_Saml2_ValidationError( - 'Signature validation failed. SAML Response rejected. %s', - OneLogin_Saml2_ValidationError.INVALID_SIGNATURE, - str(err) - ) + raise OneLogin_Saml2_ValidationError("Signature validation failed. SAML Response rejected. %s", OneLogin_Saml2_ValidationError.INVALID_SIGNATURE, str(err)) return True @staticmethod - def sign_binary(msg, key, algorithm=xmlsec.Transform.RSA_SHA1, debug=False): + def sign_binary(msg, key, algorithm=xmlsec.Transform.RSA_SHA256, debug=False): """ Sign binary message @@ -1001,7 +976,7 @@ def sign_binary(msg, key, algorithm=xmlsec.Transform.RSA_SHA1, debug=False): """ if isinstance(msg, str): - msg = msg.encode('utf8') + msg = msg.encode("utf8") xmlsec.enable_debug_trace(debug) dsig_ctx = xmlsec.SignatureContext() @@ -1009,7 +984,7 @@ def sign_binary(msg, key, algorithm=xmlsec.Transform.RSA_SHA1, debug=False): return dsig_ctx.sign_binary(compat.to_bytes(msg), algorithm) @staticmethod - def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_Saml2_Constants.RSA_SHA1, debug=False): + def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_Saml2_Constants.RSA_SHA256, debug=False): """ Validates signed binary data (Used to validate GET Signature). @@ -1039,15 +1014,34 @@ def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_ OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1, OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256, OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384, - OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512 + OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512, } - sign_algorithm_transform = sign_algorithm_transform_map.get(algorithm, xmlsec.Transform.RSA_SHA1) + sign_algorithm_transform = sign_algorithm_transform_map.get(algorithm, xmlsec.Transform.RSA_SHA256) - dsig_ctx.verify_binary(compat.to_bytes(signed_query), - sign_algorithm_transform, - compat.to_bytes(signature)) + dsig_ctx.verify_binary(compat.to_bytes(signed_query), sign_algorithm_transform, compat.to_bytes(signature)) return True except xmlsec.Error as e: if debug: print(e) return False + + @staticmethod + def normalize_url(url): + """ + Returns normalized URL for comparison. + This method converts the netloc to lowercase, as it should be case-insensitive (per RFC 4343, RFC 7617) + If standardization fails, the original URL is returned + Python documentation indicates that URL split also normalizes query strings if empty query fields are present + + :param url: URL + :type url: String + + :returns: A normalized URL, or the given URL string if parsing fails + :rtype: String + """ + try: + scheme, netloc, path, query, fragment = urlsplit(url) + normalized_url = urlunsplit((scheme.lower(), netloc.lower(), path, query, fragment)) + return normalized_url + except Exception: + return url diff --git a/src/onelogin/saml2/xml_templates.py b/src/onelogin/saml2/xml_templates.py index ec4f6260..2484d6f3 100644 --- a/src/onelogin/saml2/xml_templates.py +++ b/src/onelogin/saml2/xml_templates.py @@ -2,10 +2,8 @@ """ OneLogin_Saml2_Auth class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Main class of OneLogin's Python Toolkit. +Main class of SAML Python Toolkit. Initializes the SP SAML instance @@ -27,7 +25,7 @@ class OneLogin_Saml2_Templates(object): Version="2.0"%(provider_name)s%(force_authn_str)s%(is_passive_str)s IssueInstant="%(issue_instant)s" Destination="%(destination)s" - ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" + ProtocolBinding="%(acs_binding)s" AssertionConsumerServiceURL="%(assertion_url)s"%(attr_consuming_service_str)s> %(entity_id)s%(subject_str)s%(nameid_policy_str)s %(requested_authn_context_str)s diff --git a/src/onelogin/saml2/xml_utils.py b/src/onelogin/saml2/xml_utils.py index d966e615..a3c5dba9 100644 --- a/src/onelogin/saml2/xml_utils.py +++ b/src/onelogin/saml2/xml_utils.py @@ -2,18 +2,16 @@ """ OneLogin_Saml2_XML class -Copyright (c) 2010-2018 OneLogin, Inc. -MIT License -Auxiliary class of OneLogin's Python Toolkit. +Auxiliary class of SAML Python Toolkit. """ from os.path import join, dirname from lxml import etree -from defusedxml.lxml import tostring, fromstring from onelogin.saml2 import compat from onelogin.saml2.constants import OneLogin_Saml2_Constants +from onelogin.saml2.xmlparser import tostring, fromstring for prefix, url in OneLogin_Saml2_Constants.NSMAP.items(): @@ -21,7 +19,7 @@ class OneLogin_Saml2_XML(object): - _element_class = type(etree.Element('root')) + _element_class = type(etree.Element("root")) _parse_etree = staticmethod(fromstring) _schema_class = etree.XMLSchema _text_class = compat.text_types @@ -63,11 +61,11 @@ def to_etree(xml): if isinstance(xml, OneLogin_Saml2_XML._element_class): return xml if isinstance(xml, OneLogin_Saml2_XML._bytes_class): - return OneLogin_Saml2_XML._parse_etree(xml, forbid_dtd=True) + return OneLogin_Saml2_XML._parse_etree(xml, forbid_dtd=True, forbid_entities=True) if isinstance(xml, OneLogin_Saml2_XML._text_class): - return OneLogin_Saml2_XML._parse_etree(compat.to_bytes(xml), forbid_dtd=True) + return OneLogin_Saml2_XML._parse_etree(compat.to_bytes(xml), forbid_dtd=True, forbid_entities=True) - raise ValueError('unsupported type %r' % type(xml)) + raise ValueError("unsupported type %r" % type(xml)) @staticmethod def validate_xml(xml, schema, debug=False): @@ -89,18 +87,18 @@ def validate_xml(xml, schema, debug=False): except Exception as e: if debug: print(e) - return 'unloaded_xml' + return "unloaded_xml" - schema_file = join(dirname(__file__), 'schemas', schema) - with open(schema_file, 'r') as f_schema: + schema_file = join(dirname(__file__), "schemas", schema) + with open(schema_file, "r") as f_schema: xmlschema = OneLogin_Saml2_XML._schema_class(etree.parse(f_schema)) if not xmlschema.validate(xml): if debug: - print('Errors validating the metadata: ') + print("Errors validating the metadata: ") for error in xmlschema.error_log: print(error.message) - return 'invalid_xml' + return "invalid_xml" return xml @staticmethod @@ -146,11 +144,7 @@ def cleanup_namespaces(tree_or_element, top_nsmap=None, keep_ns_prefixes=None): :returns: An XML tree or element :rtype: etree.Element """ - all_prefixes_to_keep = [ - OneLogin_Saml2_Constants.NS_PREFIX_XS, - OneLogin_Saml2_Constants.NS_PREFIX_XSI, - OneLogin_Saml2_Constants.NS_PREFIX_XSD - ] + all_prefixes_to_keep = [OneLogin_Saml2_Constants.NS_PREFIX_XS, OneLogin_Saml2_Constants.NS_PREFIX_XSI, OneLogin_Saml2_Constants.NS_PREFIX_XSD] if keep_ns_prefixes: all_prefixes_to_keep = list(set(all_prefixes_to_keep.extend(keep_ns_prefixes))) @@ -172,5 +166,6 @@ def extract_tag_text(xml, tagname): @staticmethod def element_text(node): + # Double check, the LXML Parser already removes comments etree.strip_tags(node, etree.Comment) return node.text diff --git a/src/onelogin/saml2/xmlparser.py b/src/onelogin/saml2/xmlparser.py new file mode 100644 index 00000000..9210480e --- /dev/null +++ b/src/onelogin/saml2/xmlparser.py @@ -0,0 +1,173 @@ +# -*- coding: utf-8 -*- + +# Based on the lxml example from defusedxml +# DTDForbidden, EntitiesForbidden, NotSupportedError are clones of the classes defined at defusedxml +# +# Copyright (c) 2013 by Christian Heimes +# Licensed to PSF under a Contributor Agreement. +# See https://www.python.org/psf/license for licensing details. +"""lxml.etree protection""" + +from __future__ import print_function, absolute_import + +import threading + +from lxml import etree as _etree + +LXML3 = _etree.LXML_VERSION[0] >= 3 + +__origin__ = "lxml.etree" + +tostring = _etree.tostring + + +class DTDForbidden(ValueError): + """Document type definition is forbidden""" + + def __init__(self, name, sysid, pubid): + super(DTDForbidden, self).__init__() + self.name = name + self.sysid = sysid + self.pubid = pubid + + def __str__(self): + tpl = "DTDForbidden(name='{}', system_id={!r}, public_id={!r})" + return tpl.format(self.name, self.sysid, self.pubid) + + +class EntitiesForbidden(ValueError): + """Entity definition is forbidden""" + + def __init__(self, name, value, base, sysid, pubid, notation_name): + super(EntitiesForbidden, self).__init__() + self.name = name + self.value = value + self.base = base + self.sysid = sysid + self.pubid = pubid + self.notation_name = notation_name + + def __str__(self): + tpl = "EntitiesForbidden(name='{}', system_id={!r}, public_id={!r})" + return tpl.format(self.name, self.sysid, self.pubid) + + +class NotSupportedError(ValueError): + """The operation is not supported""" + + +class RestrictedElement(_etree.ElementBase): + """A restricted Element class that filters out instances of some classes""" + + __slots__ = () + blacklist = (_etree._Entity, _etree._ProcessingInstruction, _etree._Comment) + + def _filter(self, iterator): + blacklist = self.blacklist + for child in iterator: + if isinstance(child, blacklist): + continue + yield child + + def __iter__(self): + iterator = super(RestrictedElement, self).__iter__() + return self._filter(iterator) + + def iterchildren(self, tag=None, reversed=False): + iterator = super(RestrictedElement, self).iterchildren(tag=tag, reversed=reversed) + return self._filter(iterator) + + def iter(self, tag=None, *tags): + iterator = super(RestrictedElement, self).iter(tag=tag, *tags) + return self._filter(iterator) + + def iterdescendants(self, tag=None, *tags): + iterator = super(RestrictedElement, self).iterdescendants(tag=tag, *tags) + return self._filter(iterator) + + def itersiblings(self, tag=None, preceding=False): + iterator = super(RestrictedElement, self).itersiblings(tag=tag, preceding=preceding) + return self._filter(iterator) + + def getchildren(self): + iterator = super(RestrictedElement, self).__iter__() + return list(self._filter(iterator)) + + def getiterator(self, tag=None): + iterator = super(RestrictedElement, self).getiterator(tag) + return self._filter(iterator) + + +class GlobalParserTLS(threading.local): + """Thread local context for custom parser instances""" + + parser_config = {"resolve_entities": False, "remove_comments": True, "no_network": True, "remove_pis": True, "huge_tree": False} + + element_class = RestrictedElement + + def createDefaultParser(self): + parser = _etree.XMLParser(**self.parser_config) + element_class = self.element_class + if self.element_class is not None: + lookup = _etree.ElementDefaultClassLookup(element=element_class) + parser.set_element_class_lookup(lookup) + return parser + + def setDefaultParser(self, parser): + self._default_parser = parser + + def getDefaultParser(self): + parser = getattr(self, "_default_parser", None) + if parser is None: + parser = self.createDefaultParser() + self.setDefaultParser(parser) + return parser + + +_parser_tls = GlobalParserTLS() +getDefaultParser = _parser_tls.getDefaultParser + + +def check_docinfo(elementtree, forbid_dtd=False, forbid_entities=True): + """Check docinfo of an element tree for DTD and entity declarations + The check for entity declarations needs lxml 3 or newer. lxml 2.x does + not support dtd.iterentities(). + """ + docinfo = elementtree.docinfo + if docinfo.doctype: + if forbid_dtd: + raise DTDForbidden(docinfo.doctype, docinfo.system_url, docinfo.public_id) + if forbid_entities and not LXML3: + # lxml < 3 has no iterentities() + raise NotSupportedError("Unable to check for entity declarations " "in lxml 2.x") + + if forbid_entities: + for dtd in docinfo.internalDTD, docinfo.externalDTD: + if dtd is None: + continue + for entity in dtd.iterentities(): + raise EntitiesForbidden(entity.name, entity.content, None, None, None, None) + + +def parse(source, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True): + if parser is None: + parser = getDefaultParser() + elementtree = _etree.parse(source, parser, base_url=base_url) + check_docinfo(elementtree, forbid_dtd, forbid_entities) + return elementtree + + +def fromstring(text, parser=None, base_url=None, forbid_dtd=True, forbid_entities=True): + if parser is None: + parser = getDefaultParser() + rootelement = _etree.fromstring(text, parser, base_url=base_url) + elementtree = rootelement.getroottree() + check_docinfo(elementtree, forbid_dtd, forbid_entities) + return rootelement + + +XML = fromstring + + +def iterparse(*args, **kwargs): + raise NotSupportedError("iterparse not available") diff --git a/tests/coverage.rc b/tests/coverage.rc deleted file mode 100644 index 855ec7f9..00000000 --- a/tests/coverage.rc +++ /dev/null @@ -1,30 +0,0 @@ -[run] -branch = True - -omit = - -[paths] -source = src/onelogin/saml2 - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - - - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - if debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: - -ignore_errors = True diff --git a/tests/data/customPath/certs/Test_Root_CA.crt b/tests/data/customPath/certs/Test_Root_CA.crt new file mode 100644 index 00000000..52530954 --- /dev/null +++ b/tests/data/customPath/certs/Test_Root_CA.crt @@ -0,0 +1,16 @@ +----- Begin Certificate ----- +MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhM +CTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDg +YDVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqh +kiG9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0w +NzA4MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyB +Tb2xiZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBA +MTD2ZlaWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZ +XR0Lm5vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqK +xupQe0LONoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLC +n7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo0 +78dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVf +p86HObqY+e8BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFD +bStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJV +hTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo +-----END CERTIFICATE----- \ No newline at end of file diff --git a/tests/data/customPath/certs/idp.crt b/tests/data/customPath/certs/idp.crt new file mode 100644 index 00000000..483db3ce --- /dev/null +++ b/tests/data/customPath/certs/idp.crt @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC +Tk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD +VQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG +9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4 +MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi +ZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl +aWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO +NoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS +KOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d +1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8 +BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n +bK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar +Q4/67OZfHd7R+POBXhophSMv1ZOo +-----END CERTIFICATE----- \ No newline at end of file diff --git a/tests/data/logout_requests/invalids/invalid_issuer.xml b/tests/data/logout_requests/invalids/invalid_issuer.xml index e1edabde..4b7714d1 100644 --- a/tests/data/logout_requests/invalids/invalid_issuer.xml +++ b/tests/data/logout_requests/invalids/invalid_issuer.xml @@ -5,7 +5,7 @@ Version="2.0" IssueInstant="2013-12-10T04:39:31Z" Destination="http://stuff.com/endpoints/endpoints/sls.php" - NotOnOrAfter="2023-05-10T04:39:31Z" + NotOnOrAfter="2053-05-10T04:39:31Z" > https://example.hello.com/access/saml https://example.hello.com/access/saml diff --git a/tests/data/metadata/idp_metadata.xml b/tests/data/metadata/idp_metadata.xml index 146428c1..7c57cdf1 100644 --- a/tests/data/metadata/idp_metadata.xml +++ b/tests/data/metadata/idp_metadata.xml @@ -37,6 +37,6 @@ QOPR6cEwFZzP0tHTYbI839WgxX6hfhIUTUz6mLqq4+3P4BG3+1OXeVDg63y8Uh78 Support - support@onelogin.com + support@example.com - \ No newline at end of file + diff --git a/tests/data/metadata/idp_metadata_different_sign_and_encrypt_cert.xml b/tests/data/metadata/idp_metadata_different_sign_and_encrypt_cert.xml index df90353a..5736ff48 100644 --- a/tests/data/metadata/idp_metadata_different_sign_and_encrypt_cert.xml +++ b/tests/data/metadata/idp_metadata_different_sign_and_encrypt_cert.xml @@ -67,6 +67,6 @@ WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw== Support - support@onelogin.com + support@example.com - \ No newline at end of file + diff --git a/tests/data/metadata/idp_metadata_same_sign_and_encrypt_cert.xml b/tests/data/metadata/idp_metadata_same_sign_and_encrypt_cert.xml index e7fd250b..ae8d09e9 100644 --- a/tests/data/metadata/idp_metadata_same_sign_and_encrypt_cert.xml +++ b/tests/data/metadata/idp_metadata_same_sign_and_encrypt_cert.xml @@ -66,6 +66,6 @@ QOPR6cEwFZzP0tHTYbI839WgxX6hfhIUTUz6mLqq4+3P4BG3+1OXeVDg63y8Uh78 Support - support@onelogin.com + support@example.com - \ No newline at end of file + diff --git a/tests/data/metadata/idp_multiple_descriptors.xml b/tests/data/metadata/idp_multiple_descriptors.xml index a74f8e4a..863cbb8d 100644 --- a/tests/data/metadata/idp_multiple_descriptors.xml +++ b/tests/data/metadata/idp_multiple_descriptors.xml @@ -26,7 +26,7 @@ - + diff --git a/tests/data/responses/invalids/duplicated_attributes.xml.base64 b/tests/data/responses/invalids/duplicated_attributes.xml.base64 index a571b6d3..d4359ec9 100644 --- a/tests/data/responses/invalids/duplicated_attributes.xml.base64 +++ b/tests/data/responses/invalids/duplicated_attributes.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDQ0OTkyZWJiLTRiMzgtZTQzMi1kYjgyLTk5NTI0MTBkOWFhYiIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDMtMjFUMTM6NDI6MzFaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9uZXdvbmVsb2dpbi9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzE5MWMwM2U2OGQ3MWQ5Nzk2ZjVlMDdlNjI2MmNhNGFkODgzYTc0YjEiPjxzYW1sOklzc3Vlcj5odHRwczovL3BpdGJ1bGsubm8taXAub3JnL3NpbXBsZXNhbWwvc2FtbDIvaWRwL21ldGFkYXRhLnBocDwvc2FtbDpJc3N1ZXI+PGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+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GVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj50ZXN0PC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9InNuIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj53YWEyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/invalids/empty_destination.xml.base64 b/tests/data/responses/invalids/empty_destination.xml.base64 index 352988ce..74a9f5e5 100644 --- a/tests/data/responses/invalids/empty_destination.xml.base64 +++ b/tests/data/responses/invalids/empty_destination.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbn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dGlvbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dXNlcjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== diff --git a/tests/data/responses/invalids/empty_nameid.xml.base64 b/tests/data/responses/invalids/empty_nameid.xml.base64 index 72350d1f..35115f56 100644 --- a/tests/data/responses/invalids/empty_nameid.xml.base64 +++ b/tests/data/responses/invalids/empty_nameid.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDQ0MTM5Y2JkLWE2NTQtOWM1Mi00Njk3LTdjMDVkMzAyM2QyZiIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDItMTlUMDE6Mzc6MDFaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9uZXdvbmVsb2dpbi9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzVmZTlkNmU0OTliMmYwOTEzMjA2YWFiM2Y3MTkxNzI5MDQ5YmI4MDciPjxzYW1sOkl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nV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/invalids/encrypted_attrs.xml.base64 b/tests/data/responses/invalids/encrypted_attrs.xml.base64 index f452075c..a170970a 100644 --- a/tests/data/responses/invalids/encrypted_attrs.xml.base64 +++ b/tests/data/responses/invalids/encrypted_attrs.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+DQogIDxzYW1scDpTdGF0dXM+DQogICAgPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIvPg0KICA8L3NhbWxwOlN0YXR1cz4NCiAgPHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5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ICAgICAgICA8L2RzOktleUluZm8+DQogICAgICAgICAgICA8eGVuYzpDaXBoZXJEYXRhPg0KICAgICAgICAgICAgICA8eGVuYzpDaXBoZXJWYWx1ZT5aekN1NmF4R2dBWVpIVmY3N05YOGFwWktCL0dKRGV1VjZiRkJ5QlMwQUlnaVhrdkRVQW1MQ3BhYlRBV0JNK3l6MTlvbEE2cnJ5dU9mcjgyZXYyYnpQTlVSdm00U1l4YWh2dUw0UGlibjV3Smt5MEJsNTRWcW1jVStBcWowZEF2T2dxRzF5M1g0d085bjliUnNUdjY5MjFtMGVxUkFGcGg4a0s4TDloaXJLMUJ4WUJZajJSeUZDb0ZEUHhWWjV3eXJhM3E0cW1FNC9FTFFwRlA2bWZVOExYYjB1b1dKVWpHVWVsUzJBYTdiWmlzOHpFcHdvdjRDd3RsTmpsdFFpaDRtdjd0dENBZllxY1FJRnpCVEIrREFhMCtYZ2d4Q0xjZEIzK21RaVJjRUNCZndISEo3Z1JtbnVCRWdlV1QzQ0dLYTNOYjdHTVhPZnV4RktGNXBJZWhXZ28za2ROUUxhbG9yOFJWVzZJOFAvSThmUTMzRmUrTnNIVm5KM3p3U0EvL2E8L3hlbmM6Q2lwaGVyVmFsdWU+DQogICAgICAgICAgICA8L3hlbmM6Q2lwaGVyRGF0YT4NCiAgICAgICAgICA8L3hlbmM6RW5jcnlwdGVkRGF0YT4NCiAgICAgICAgPC9zYW1sOkVuY3J5cHRlZEF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/data/responses/invalids/invalid_audience.xml.base64 b/tests/data/responses/invalids/invalid_audience.xml.base64 index a2575836..80f30e51 100644 --- a/tests/data/responses/invalids/invalid_audience.xml.base64 +++ b/tests/data/responses/invalids/invalid_audience.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj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FtZXM6dGM6U0FNTDoyLjA6YWM6Y2xhc3NlczpQYXNzd29yZDwvc2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZj4NCiAgICAgIDwvc2FtbDpBdXRobkNvbnRleHQ+DQogICAgPC9zYW1sOkF1dGhuU3RhdGVtZW50Pg0KICAgIDxzYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJtYWlsIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/invalids/invalid_issuer_assertion.xml.base64 b/tests/data/responses/invalids/invalid_issuer_assertion.xml.base64 index 07748ece..426ea5c2 100644 --- a/tests/data/responses/invalids/invalid_issuer_assertion.xml.base64 +++ b/tests/data/responses/invalids/invalid_issuer_assertion.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEt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1haWwiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPg0KICAgICAgICA8c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5zb21lb25lQGV4YW1wbGUuY29tPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/data/responses/invalids/invalid_issuer_message.xml.base64 b/tests/data/responses/invalids/invalid_issuer_message.xml.base64 index f1f49fe5..0c06a25e 100644 --- a/tests/data/responses/invalids/invalid_issuer_message.xml.base64 +++ b/tests/data/responses/invalids/invalid_issuer_message.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaW52YWxpZC5pc3Nlci5leGFtcGxlLmNvbS88L3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QogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg0KICA= \ No newline at end of file diff --git a/tests/data/responses/invalids/invalid_sessionindex.xml.base64 b/tests/data/responses/invalids/invalid_sessionindex.xml.base64 index cc5a581c..f2e4c4c6 100644 --- a/tests/data/responses/invalids/invalid_sessionindex.xml.base64 +++ b/tests/data/responses/invalids/invalid_sessionindex.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+DQogIDxzYW1scDpTdGF0dXM+DQogICAgPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIvPg0KICA8L3NhbWxwOlN0YXR1cz4NCiAgPHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnhzaT0iaHR0cDovL3d3dy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3RyaWN0aW9uPg0KICAgIDwvc2FtbDpDb25kaXRpb25zPg0KICAgIDxzYW1sOkF1dGhuU3RhdGVtZW50IEF1dGhuSW5zdGFudD0iMjAxMS0wNi0xN1QxNDo1NDowN1oiIFNlc3Npb25Ob3RPbk9yQWZ0ZXI9IjIwMTMtMDYtMTdUMjI6NTQ6MTRaIiBTZXNzaW9uSW5kZXg9Il81MWJlMzc5NjVmZWI1NTc5ZDgwMzE0MTA3NjkzNmRjMmU5ZDFkOThlYmYiPg0KICAgICAgPHNhbWw6QXV0aG5Db250ZXh0Pg0KICAgICAgICA8c2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZj51cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YWM6Y2xhc3NlczpQYXNzd29yZDwvc2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZj4NCiAgICAgIDwvc2FtbDpBdXRobkNvbnRleHQ+DQogICAgPC9zYW1sOkF1dGhuU3RhdGVtZW50Pg0KICAgIDxzYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJtYWlsIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/tests/data/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 b/tests/data/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 index 2ce545f8..b6a4e2eb 100644 --- a/tests/data/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 +++ b/tests/data/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+DQogIDxzYW1scDpTdGF0dXM+DQogICAgPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIvPg0KICA8L3NhbWxwOlN0YXR1cz4NCiAgPHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgSUQ9InBmeDc4NDE5OTFjLWM3M2YtNDAzNS1lMmVlLWMxNzBjMGUxZDNlNCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjI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BdXRobkNvbnRleHQ+DQogICAgICAgIDxzYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkPC9zYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPg0KICAgICAgPC9zYW1sOkF1dGhuQ29udGV4dD4NCiAgICA8L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+DQogICAgPHNhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICAgICAgPHNhbWw6QXR0cmlidXRlIE5hbWU9Im1haWwiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPg0KICAgICAgICA8c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5zb21lb25lQGV4YW1wbGUuY29tPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/data/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 b/tests/data/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 index ff6d371c..5d1f8bc1 100644 --- a/tests/data/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 +++ b/tests/data/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMz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pg0KICAgIDxzYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJtYWlsIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 b/tests/data/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 index 6d4b70aa..4f922132 100644 --- a/tests/data/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 +++ b/tests/data/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTd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5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/tests/data/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 b/tests/data/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 index 1bf1d25a..30c55eb2 100644 --- a/tests/data/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 +++ b/tests/data/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+DQogIDxzYW1scDpTdGF0dXM+DQogICAgPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdG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statement.xml.base64 b/tests/data/responses/invalids/no_authnstatement.xml.base64 index d116b7b5..64239d42 100644 --- a/tests/data/responses/invalids/no_authnstatement.xml.base64 +++ b/tests/data/responses/invalids/no_authnstatement.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGRmNWRiN2JiLTYwZDgtMWZhNi00OTBhLWFjMWMyZThjYWFhMiIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDItMTlUMDE6Mzc6MDFaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9uZXdvbmVsb2dpbi9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzVmZTlkNmU0OTliMmYwOTEzMjA2YWFiM2Y3MTkxNzI5MDQ5YmI4MDciPjxzYW1sOklzc3Vlcj5odHRwczovL3BpdGJ1bGsubm8taXAub3JnL3NpbXBsZXNhbWwvc2FtbDIvaWRwL21ldGFkYXRhLnBocDwvc2FtbDpJc3N1ZXI+PGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+DQogIDxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIi8+DQogICAgPGRzOlNpZ25hdHVyZU1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNyc2Etc2hhMSIvPg0KIC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0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+TWFydGluMjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJlZHVQZXJzb25BZmZpbGlhdGlvbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dXNlcjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== diff --git a/tests/data/responses/invalids/no_nameid.xml.base64 b/tests/data/responses/invalids/no_nameid.xml.base64 index 3c2b6d9b..db8879b2 100644 --- a/tests/data/responses/invalids/no_nameid.xml.base64 +++ b/tests/data/responses/invalids/no_nameid.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1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end of file diff --git a/tests/data/responses/invalids/no_saml2.xml.base64 b/tests/data/responses/invalids/no_saml2.xml.base64 index 3e86c702..383d0d40 100644 --- a/tests/data/responses/invalids/no_saml2.xml.base64 +++ b/tests/data/responses/invalids/no_saml2.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8UmVzcG9uc2UgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6MS4wOmFzc2VydGlvbiINCiAgICB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6MS4wOnByb3RvY29sIiB4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIg0KICAgIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIElzc3VlSW5zdGFudD0iMjAwOC0xMi0xMFQxNDoxMjoxNC44MTdaIg0KICAgIE1ham9yVmVyc2lvbj0iMSIgTWlub3JWZXJzaW9uPSIxIiBSZWNpcGllbnQ9Imh0dHBzOi8vZWlnZXIuaWFkLnZ0LmVkdS9kYXQvaG9tZS5kbyINCiAgICBSZXNwb25zZUlEPSJfNWM5NGI1NDMxYzU0MDM2NWU1YTcwYjI4NzRiNzU5OTYiPg0KICAgICAgPFN0YXR1cz4NCiAgICAgICAgPFN0YXR1c0NvZGUgVmFsdWU9InNhbWxwOlN1Y2Nlc3MiPg0KICAgICAgICA8L1N0YXR1c0NvZGU+DQogICAgICA8L1N0YXR1cz4NCiAgICAgIDxBc3NlcnRpb24geG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMDphc3NlcnRpb24iIEFzc2VydGlvbklEPSJfZTVjMjNmZjdhMzg4OWUxMmZhMDE4MDJhNDczMzE2NTMiDQogICAgICBJc3N1ZUluc3R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A8L0F0dHJpYnV0ZT4NCiAgICAgICAgICA8QXR0cmlidXRlIEF0dHJpYnV0ZU5hbWU9ImFjY291bnRTdGF0ZSIgQXR0cmlidXRlTmFtZXNwYWNlPSJodHRwOi8vd3d3LmphLXNpZy5vcmcvcHJvZHVjdHMvY2FzLyI+DQogICAgICAgICAgICA8QXR0cmlidXRlVmFsdWU+QUNUSVZFPC9BdHRyaWJ1dGVWYWx1ZT4NCiAgICAgICAgICA8L0F0dHJpYnV0ZT4NCiAgICAgICAgPC9BdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICAgIDxBdXRoZW50aWNhdGlvblN0YXRlbWVudCBBdXRoZW50aWNhdGlvbkluc3RhbnQ9IjIwMDgtMTItMTBUMTQ6MTI6MTQuNzQxWiINCiAgICAgICAgQXV0aGVudGljYXRpb25NZXRob2Q9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMDphbTpwYXNzd29yZCI+DQogICAgICAgICAgPFN1YmplY3Q+DQogICAgICAgICAgICA8TmFtZUlkZW50aWZpZXI+am9obnE8L05hbWVJZGVudGlmaWVyPg0KICAgICAgICAgICAgPFN1YmplY3RDb25maXJtYXRpb24+DQogICAgICAgICAgICAgIDxDb25maXJtYXRpb25NZXRob2Q+DQogICAgICAgICAgICAgICAgdXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6MS4wOmNtOmFydGlmYWN0DQogICAgICAgICAgICAgIDwvQ29uZmlybWF0aW9uTWV0aG9kPg0KICAgICAgICAgICAgPC9TdWJqZWN0Q29uZmlybWF0aW9uPg0KICAgICAgICAgIDwvU3ViamVjdD4NCiAgICAgICAgPC9BdXRoZW50aWNhdGlvblN0YXRlbWVudD4NCiAgICAgIDwvQXNzZXJ0aW9uPg0KICAgIDwvUmVzcG9uc2U+ diff --git a/tests/data/responses/invalids/no_signature.xml.base64 b/tests/data/responses/invalids/no_signature.xml.base64 index bed73c5c..76dfc435 100644 --- a/tests/data/responses/invalids/no_signature.xml.base64 +++ b/tests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vbnNlVG89Ik9ORUxPR0lOXzVmZTlkNmU0OTliMmYwOTEzMjA2YWFiM2Y3MTkxNzI5MDQ5YmI4MDciLz48L3NhbWw6U3ViamVjdENvbmZpcm1hdGlvbj48L3NhbWw6U3ViamVjdD48c2FtbDpDb25kaXRpb25zIE5vdEJlZm9yZT0iMjAxNC0wMi0xOVQwMTozNjozMVoiIE5vdE9uT3JBZnRlcj0iMjk5My0wOC0yM1QwNjo1NzowMVoiPjxzYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PHNhbWw6QXVkaWVuY2U+aHR0cHM6Ly9leGFtcGxlLmNvbS9uZXdvbmVsb2dpbi9kZW1vMS9tZXRhZGF0YS5waHA8L3NhbWw6QXVkaWVuY2U+PC9zYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PC9zYW1sOkNvbmRpdGlvbnM+PHNhbWw6QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDE0LTAyLTE5VDAxOjM3OjAxWiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjk5My0wMi0xOVQwOTozNzowMVoiIFNlc3Npb25JbmRleD0iXzYyNzNkNzdiOGNkZTBjMzMzZWM3OWQyMmE5ZmEwMDAzYjlmZTJkNzVjYiI+PHNhbWw6QXV0aG5Db250ZXh0PjxzYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkPC9zYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPjwvc2FtbDpBdXRobkNvbnRleHQ+PC9zYW1sOkF1dGhuU3RhdGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= diff --git a/tests/data/responses/invalids/no_status.xml.base64 b/tests/data/responses/invalids/no_status.xml.base64 index 4f5905e9..fffb8592 100644 --- a/tests/data/responses/invalids/no_status.xml.base64 +++ b/tests/data/responses/invalids/no_status.xml.base64 @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BdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0idWlkIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj5kZW1vPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJhbm90aGVyX3ZhbHVlIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj52YWx1ZTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/invalids/no_status_code.xml.base64 b/tests/data/responses/invalids/no_status_code.xml.base64 index 94c439b2..e62333cd 100644 --- a/tests/data/responses/invalids/no_status_code.xml.base64 +++ b/tests/data/responses/invalids/no_status_code.xml.base64 @@ -1 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoy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OnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnR5cGU9InhzOnN0cmluZyI+ZGVtbzwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0iYW5vdGhlcl92YWx1ZSI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnR5cGU9InhzOnN0cmluZyI+dmFsdWU8L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== diff --git a/tests/data/responses/invalids/no_subjectconfirmation_data.xml.base64 b/tests/data/responses/invalids/no_subjectconfirmation_data.xml.base64 index 3c92f561..bc28d907 100644 --- a/tests/data/responses/invalids/no_subjectconfirmation_data.xml.base64 +++ b/tests/data/responses/invalids/no_subjectconfirmation_data.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLT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aWVuY2U+DQogICAgICA8L3NhbWw6QXVkaWVuY2VSZXN0cmljdGlvbj4NCiAgICA8L3NhbWw6Q29uZGl0aW9ucz4NCiAgICA8c2FtbDpBdXRoblN0YXRlbWVudCBBdXRobkluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MDdaIiBTZXNzaW9uTm90T25PckFmdGVyPSIyMDk5LTA2LTE3VDIyOjU0OjE0WiIgU2Vzc2lvbkluZGV4PSJfNTFiZTM3OTY1ZmViNTU3OWQ4MDMxNDEwNzY5MzZkYzJlOWQxZDk4ZWJmIj4NCiAgICAgIDxzYW1sOkF1dGhuQ29udGV4dD4NCiAgICAgICAgPHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+DQogICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgIDwvc2FtbDpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0ibWFpbCIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnNvbWVvbmVAZXhhbXBsZS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/tests/data/responses/invalids/no_subjectconfirmation_method.xml.base64 b/tests/data/responses/invalids/no_subjectconfirmation_method.xml.base64 index 07ce153a..37b69370 100644 --- a/tests/data/responses/invalids/no_subjectconfirmation_method.xml.base64 +++ b/tests/data/responses/invalids/no_subjectconfirmation_method.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+DQogIDxzYW1scDpTdGF0dXM+DQogICAgPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIvPg0KICA8L3NhbWxwOlN0YXR1cz4NCiAgPHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgSUQ9InBmeDc4NDE5OTFjLWM3M2YtNDAzNS1lMmVlLWMxNzBjMGUxZDNlNCIgVmVyc2lvbj0iMi4wIiB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MDk5LTA2LTE3VDIyOjU0OjE0WiIgU2Vzc2lvbkluZGV4PSJfNTFiZTM3OTY1ZmViNTU3OWQ4MDMxNDEwNzY5MzZkYzJlOWQxZDk4ZWJmIj4NCiAgICAgIDxzYW1sOkF1dGhuQ29udGV4dD4NCiAgICAgICAgPHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+DQogICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgIDwvc2FtbDpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0ibWFpbCIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnNvbWVvbmVAZXhhbXBsZS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/tests/data/responses/invalids/not_before_failed.xml.base64 b/tests/data/responses/invalids/not_before_failed.xml.base64 index 6c15a076..8a2ffd3d 100644 --- a/tests/data/responses/invalids/not_before_failed.xml.base64 +++ b/tests/data/responses/invalids/not_before_failed.xml.base64 @@ -1 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2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ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/tests/data/responses/invalids/response_encrypted_attrs.xml.base64 b/tests/data/responses/invalids/response_encrypted_attrs.xml.base64 index 32449899..ad6392c5 100644 --- a/tests/data/responses/invalids/response_encrypted_attrs.xml.base64 +++ b/tests/data/responses/invalids/response_encrypted_attrs.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6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MzRmUrTnNIVm5KM3p3U0EvL2E8L3hlbmM6Q2lwaGVyVmFsdWU+DQogICAgICAgICAgICA8L3hlbmM6Q2lwaGVyRGF0YT4NCiAgICAgICAgICA8L3hlbmM6RW5jcnlwdGVkRGF0YT4NCiAgICAgICAgPC9zYW1sOkVuY3J5cHRlZEF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/data/responses/invalids/signature_wrapping_attack2.xml.base64 b/tests/data/responses/invalids/signature_wrapping_attack2.xml.base64 new file mode 100644 index 00000000..408b2f77 --- /dev/null +++ b/tests/data/responses/invalids/signature_wrapping_attack2.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxuczA6UmVzcG9uc2UgeG1sbnM6bnMwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOm5zMT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6bnMyPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiBEZXN0aW5hdGlvbj0iaHR0cDovL2xpbmdvbi5jYXRhbG9naXguc2U6ODA4Ny8iIElEPSJpZC12cU9RNzJKQ3BwWGFCV25CRSIgSW5SZXNwb25zZVRvPSJpZDEyIiBJc3N1ZUluc3RhbnQ9IjIwMTktMTItMjBUMTI6MTU6MTZaIiBWZXJzaW9uPSIyLjAiPjxuczE6SXNzdWVyIEZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6ZW50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LjQuMTIiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6dXJpIj48bnMxOkF0dHJpYnV0ZVZhbHVlIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeHNpOnR5cGU9InhzOnN0cmluZyI+c2hvcnRzdG9wPC9uczE6QXR0cmlidXRlVmFsdWU+PC9uczE6QXR0cmlidXRlPjwvbnMxOkF0dHJpYnV0ZVN0YXRlbWVudD48L25zMTpBc3NlcnRpb24+DQo8L1hTV19BVFRBQ0s+DQo8L25zMDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/data/responses/invalids/signed_assertion_response.xml.base64 b/tests/data/responses/invalids/signed_assertion_response.xml.base64 index b183e68c..736ea793 100644 --- a/tests/data/responses/invalids/signed_assertion_response.xml.base64 +++ b/tests/data/responses/invalids/signed_assertion_response.xml.base64 @@ -1 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIERlc3RpbmF0aW9uPSJodHRwczovL3BpdGJ1bGsubm8taXAub3JnL25ld29uZWxvZ2luL2RlbW8xL2luZGV4LnBocD9hY3MiIElEPSJwZnhkYjRkOWVmZS1kMGFkLTAwODYtY2U4OC1jMjg4Njg3Y2FjNjEiIEluUmVzcG9uc2VUbz0iT05FTE9HSU5fNjEyYmJmOWIxNjQ1Mjk0YWEwYjQ2MzdiMWJjNWYzOWRlOGI3OWNlYiIgSXNzdWVJbnN0YW50PSIyMDE0LTAzLTMxVDAwOjM3OjE2WiIgVmVyc2lvbj0iMi4wIj48c2FtbDpJc3N1ZXI+aHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9zaW1wbGVzYW1sL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OGE0ZGEiIFNlc3Npb25Ob3RPbk9yQWZ0ZXI9IjI5OTMtMDMtMzFUMDg6Mzc6MTZaIj48c2FtbDpBdXRobkNvbnRleHQ+PHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9zYW1sOkF1dGhuQ29udGV4dD48L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== diff --git a/tests/data/responses/no_audience.xml.base64 b/tests/data/responses/no_audience.xml.base64 index 6ac34337..25550e3b 100644 --- a/tests/data/responses/no_audience.xml.base64 +++ b/tests/data/responses/no_audience.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+DQogIDxzYW1scDpTdGF0dXM+DQogICAgPHNhbWxwOlN0YX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WQ4MDMxNDEwNzY5MzZkYzJlOWQxZDk4ZWJmIj4NCiAgICAgIDxzYW1sOkF1dGhuQ29udGV4dD4NCiAgICAgICAgPHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+DQogICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgIDwvc2FtbDpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0ibWFpbCIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnNvbWVvbmVAZXhhbXBsZS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/tests/data/responses/pretty_signed_message_response.xml b/tests/data/responses/pretty_signed_message_response.xml index 7dcb65ee..8ac3541e 100644 --- a/tests/data/responses/pretty_signed_message_response.xml +++ b/tests/data/responses/pretty_signed_message_response.xml @@ -1,9 +1,9 @@ - + https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php - 1dQFiYU0o2OF7c/RVV8Gpgb4u3I=wRgBXOq/FiLZc2mureTC/j6zY709OikJ5HeUSruHTdYjEg9aZy1RbxlKIYEIfXpnX7NBoKxfAMm+O0fsrqOjgcYxTVkqZjOr71qiXNbtwjeA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o/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo @@ -13,15 +13,15 @@ _b98f98bb1ab512ced653b58baaff543448daed535d - + - + https://pitbulk.no-ip.org/newonelogin/demo1/metadata.php - + urn:oasis:names:tc:SAML:2.0:ac:classes:Password diff --git a/tests/data/responses/response1_with_duplicate_attributes.xml.base64 b/tests/data/responses/response1_with_duplicate_attributes.xml.base64 new file mode 100644 index 00000000..de113c3c --- /dev/null +++ b/tests/data/responses/response1_with_duplicate_attributes.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTI5MDExNzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDEwLTExLTE4VDIxOjU3OjM3WiIgRGVzdGluYXRpb249IntyZWNpcGllbnR9Ij48c2FtbHA6U3RhdHVzPjxzYW1scDpTdGF0dXNDb2RlIFZhbHVlPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6c3RhdHVzOlN1Y2Nlc3MiLz48L3NhbWxwOlN0YXR1cz48c2FtbDpBc3NlcnRpb24geG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiBWZXJzaW9uPSIyLjAiIElEPSJwZng4ZmZiMzk4My1jYmY2LTkyYTEtZjJjNC02MTlhZTFiZTFjODYiIElzc3VlSW5zdGFudD0iMjAxMC0xMS0xOFQyMTo1NzozN1oiPjxzYW1sOklzc3Vlcj5odHRwczovL2FwcC5vbmVsb2dpbi5jb20vc2FtbC9tZXRhZGF0YS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p4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhzaTp0eXBlPSJ4czpzdHJpbmciPm5hbWUyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/tests/data/responses/response1_with_friendlyname.xml.base64 b/tests/data/responses/response1_with_friendlyname.xml.base64 new file mode 100644 index 00000000..a17c3941 --- /dev/null +++ b/tests/data/responses/response1_with_friendlyname.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTI5MDExNzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDEwLTExLTE4VDIxOjU3OjM3WiIgRGVzdGluYXRpb249IntyZWNpcGllbnR9Ij4NCiAgPHNhbWxwOlN0YXR1cz4NCiAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+PC9zYW1scDpTdGF0dXM+DQogIDxzYW1sOkFzc2VydGlvbiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIFZlcnNpb249IjIuMCIgSUQ9InBmeDh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GVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0iYW5vdGhlcl92YWx1ZSI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnR5cGU9InhzOnN0cmluZyI+dmFsdWU8L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/tests/data/responses/response_with_nested_nameid_values.xml.base64 b/tests/data/responses/response_with_nested_nameid_values.xml.base64 index 3092c3cf..3b99e137 100644 --- a/tests/data/responses/response_with_nested_nameid_values.xml.base64 +++ b/tests/data/responses/response_with_nested_nameid_values.xml.base64 @@ -1,71 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDph -c3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9j -b2wiIElEPSJHT1NBTUxSMTI5MDExNzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50 -PSIyMDEwLTExLTE4VDIxOjU3OjM3WiIgRGVzdGluYXRpb249IntyZWNpcGllbnR9Ij4KICA8c2Ft -bHA6U3RhdHVzPgogICAgPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0 -YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyI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YSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnR5cGU9InhzOnN0cmluZyI+ZGVtbzwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0iYW5vdGhlcl92YWx1ZSIgRnJpZW5kbHlOYW1lPSJhbm90aGVyX2ZyaWVuZGx5X3ZhbHVlIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj4NCiAgICAgICAgICAgIDxzYW1sOk5hbWVJRCBGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpuYW1laWQtZm9ybWF0OnBlcnNpc3RlbnQiIE5hbWVRdWFsaWZpZXI9Imh0dHBzOi8vaWRwSUQiIFNQTmFtZVF1YWxpZmllcj0iaHR0cHM6Ly9zcElEIj52YWx1ZTwvc2FtbDpOYW1lSUQ+DQogICAgICAgIDwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/tests/data/responses/response_without_assertion_reference_uri.xml.base64 b/tests/data/responses/response_without_assertion_reference_uri.xml.base64 new file mode 100644 index 00000000..8c4dab5d --- /dev/null +++ b/tests/data/responses/response_without_assertion_reference_uri.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvb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dHJpYnV0ZVN0YXRlbWVudD4KICAgICAgPEF0dHJpYnV0ZSBOYW1lPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9lbWFpbGFkZHJlc3MiPgogICAgICAgIDxBdHRyaWJ1dGVWYWx1ZT5zYW1sQHVzZXIuY29tPC9BdHRyaWJ1dGVWYWx1ZT4KICAgICAgPC9BdHRyaWJ1dGU+CiAgICA8L0F0dHJpYnV0ZVN0YXRlbWVudD4KICAgIDxBdXRoblN0YXRlbWVudCBBdXRobkluc3RhbnQ9IjIwMTUtMDEtMDJUMjI6NDg6NDhaIiBTZXNzaW9uSW5kZXg9Il83MDBhYzMyMC03NGZmLTAxMzItNWIxNC00OGUwZWIxNGExYzciPgogICAgICA8QXV0aG5Db250ZXh0PgogICAgICAgIDxBdXRobkNvbnRleHRDbGFzc1JlZj51cm46ZmVkZXJhdGlvbjphdXRoZW50aWNhdGlvbjp3aW5kb3dzPC9BdXRobkNvbnRleHRDbGFzc1JlZj4KICAgICAgPC9BdXRobkNvbnRleHQ+CiAgICA8L0F1dGhuU3RhdGVtZW50PgogIDwvQXNzZXJ0aW9uPgo8L3NhbWxwOlJlc3BvbnNlPgo= diff --git a/tests/data/responses/response_without_reference_uri.xml.base64 b/tests/data/responses/response_without_reference_uri.xml.base64 index 7ceecf01..d830db01 100644 --- a/tests/data/responses/response_without_reference_uri.xml.base64 +++ b/tests/data/responses/response_without_reference_uri.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgSUQ9InBmeGQ1OTQzNDdkLTQ5NWYtYjhkMS0wZWUyLTQxY2ZkYTE0ZGQzNSIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTUtMDEtMDJUMjI6NDg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cm46ZmVkZXJhdGlvbjphdXRoZW50aWNhdGlvbjp3aW5kb3dzPC9BdXRobkNvbnRleHRDbGFzc1JlZj4KICAgICAgPC9BdXRobkNvbnRleHQ+CiAgICA8L0F1dGhuU3RhdGVtZW50PgogIDwvQXNzZXJ0aW9uPgo8L3NhbWxwOlJlc3BvbnNlPgo= diff --git a/tests/data/responses/signed_assertion_response.xml.base64 b/tests/data/responses/signed_assertion_response.xml.base64 index 80e214a3..ff563b49 100644 --- a/tests/data/responses/signed_assertion_response.xml.base64 +++ b/tests/data/responses/signed_assertion_response.xml.base64 @@ -1 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfMmUwZjNlOGE3YzUxZGUyNjcxNjczNDE0YWE3ZDVhNjkyNDdmNmQ2NjI1IiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNC0wMy0zMVQwMDozNzoxNloiIERlc3RpbmF0aW9uPSJodHRwczovL3BpdGJ1bGsubm8taXAub3JnL25ld29uZWxvZ2luL2RlbW8xL2luZGV4LnBocD9hY3MiIEluUmVzcG9uc2VUbz0iT05FTE9HSU5fNjEyYmJmOWIxNjQ1Mjk0YWEwYjQ2MzdiMWJjNWYzOWRlOGI3OWNlYiI+PHNhbWw6SXNzdWVyPmh0dHBzOi8vcGl0YnVsay5uby1pcC5vcmcvc2ltcGxlc2FtbC9zYW1sMi9pZHAvbWV0YWRhdGEucGhwPC9zYW1sOklzc3Vlcj48c2FtbHA6U3RhdHVzPjxzYW1scDpTdGF0dXNDb2RlIFZhbHVlPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6c3RhdHVzOlN1Y2Nlc3MiLz48L3NhbWxwOlN0YXR1cz48c2FtbDpBc3Nlcn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dHlwZT0ieHM6c3RyaW5nIj53YWEyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/signed_message_response.xml.base64 b/tests/data/responses/signed_message_response.xml.base64 index 492348a4..09951908 100644 --- a/tests/data/responses/signed_message_response.xml.base64 +++ b/tests/data/responses/signed_message_response.xml.base64 @@ -1 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJwZnhjM2QyYjU0Mi0wZjdlLTg3NjctOGU4Ny01YjBkYzY5MTMzNzUiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTAzLTIxVDEzOjQxOjA5WiIgRGVzdGluYXRpb249Imh0dHBzOi8vcGl0YnVsay5uby1pcC5vcmcvbmV3b25lbG9naW4vZGVtbzEvaW5kZXgucGhwP2FjcyIgSW5SZXNwb25zZVRvPSJPTkVM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VGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnRlc3Q8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0ic24iIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPndhYTI8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0iZWR1UGVyc29uQWZmaWxpYXRpb24iIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnVzZXI8L3NhbWw6QXR0cmlidXRlVmFsdWU+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+YWRtaW48L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= diff --git a/tests/data/responses/unsigned_response.xml.base64 b/tests/data/responses/unsigned_response.xml.base64 index 66892b53..18abcf23 100644 --- a/tests/data/responses/unsigned_response.xml.base64 +++ b/tests/data/responses/unsigned_response.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbH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DoyLjA6YWM6Y2xhc3NlczpQYXNzd29yZDwvc2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZj4NCiAgICAgIDwvc2FtbDpBdXRobkNvbnRleHQ+DQogICAgPC9zYW1sOkF1dGhuU3RhdGVtZW50Pg0KICAgIDxzYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJtYWlsIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/tests/data/responses/unsigned_response_with_miliseconds.xm.base64 b/tests/data/responses/unsigned_response_with_miliseconds.xm.base64 index 76522b7e..1722cbf9 100644 --- a/tests/data/responses/unsigned_response_with_miliseconds.xm.base64 +++ b/tests/data/responses/unsigned_response_with_miliseconds.xm.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGMzMmFlZDY3LTgyMGYtNDI5Ni0wYzIwLTIwNWExMGRkNTc4NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6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0dHJpYnV0ZSBOYW1lPSJtYWlsIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/tests/data/responses/valid_encrypted_assertion_encrypted_nameid.xml.base64 b/tests/data/responses/valid_encrypted_assertion_encrypted_nameid.xml.base64 index 83431af3..33eaf12d 100644 --- a/tests/data/responses/valid_encrypted_assertion_encrypted_nameid.xml.base64 +++ b/tests/data/responses/valid_encrypted_assertion_encrypted_nameid.xml.base64 @@ -1 +1 @@ -PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfYzIzZjAwODk2NmZmMjcxMGI5ZDQ3NjA4NDIyNDRkZGM4MTE2NzY2NjkyIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNC0wOS0yMlQxNjozMzoxNVoiIERlc3RpbmF0aW9uPSJodHRwOi8vcHl0b29sa2l0LmNvbTo4MDAwLz9hY3MiIEluUmVzcG9uc2VUbz0iT05FTE9HSU5fOTlmYjdiOWQ4OTYzNDdmY2UxMjEyZDE5MjRkNDQ3M2I1NDcyZjJhOSI+PHNhbWw6SXNzdWVyPmh0dHBzOi8vcGl0YnVsay5uby1pcC5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HRFdYK284c1lGanZpaEFSeWtqR3JSUlAvc1ZsWDBSK0pnb0VTWmpyRjk2QzVhNkxxWmVITTVkUDdqWmtWeDRaZnVmbis0Qnp4dlVHczJuZkk1aXdESGtyZz08L3hlbmM6Q2lwaGVyVmFsdWU+DQogICA8L3hlbmM6Q2lwaGVyRGF0YT4NCjwveGVuYzpFbmNyeXB0ZWREYXRhPjwvc2FtbDpFbmNyeXB0ZWRBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/data/responses/valid_response_without_inresponseto.xml.base64 b/tests/data/responses/valid_response_without_inresponseto.xml.base64 index 120a6c3c..64fcaba0 100644 --- a/tests/data/responses/valid_response_without_inresponseto.xml.base64 +++ b/tests/data/responses/valid_response_without_inresponseto.xml.base64 @@ -1 +1 @@ -PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxzYW1scDpSZXNwb25zZSB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpzYW1sPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIiBJRD0icGZ4MDVmM2NlMTAtMTYxNS1mM2VhLWE5ODgtNjBlMzgwYjMyOTlmIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNC0wMi0xOVQwMTozNzowMVoiIERlc3RpbmF0aW9uPSJodHRwczovL3BpdGJ1bGsubm8taXAub3JnL25ld29uZWxvZ2luL2RlbW8xL2luZGV4LnBocD9hY3MiPgogIDxzYW1sOklzc3Vlcj5odHRwczovL3BpdGJ1bGsubm8taXAub3JnL3NpbXBsZXNhbWwvc2FtbDIvaWRwL21ldGFkYXRhLnBocDwvc2FtbDpJc3N1ZXI+CiAgPGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+CiAgICA8ZHM6U2lnbmVkSW5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QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/tests/pylint.rc b/tests/pylint.rc deleted file mode 100644 index e5dd9bb9..00000000 --- a/tests/pylint.rc +++ /dev/null @@ -1,75 +0,0 @@ -[MASTER] -profile=no -persistent=yes -ignore= -cache-size=500 - -[REPORTS] -output-format=text -files-output=no -reports=yes - -[BASIC] -no-docstring-rgx=__.*__|_.* -class-rgx=[A-Z_][a-zA-Z0-9_]+$ -function-rgx=[a-zA_][a-zA-Z0-9_]{2,70}$ -method-rgx=[a-z_][a-zA-Z0-9_]{2,70}$ -const-rgx=(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*)|(__.*__)|register|urlpatterns)$ -good-names=_,i,j,k,e,qs,pk,setUp,tearDown,el,ns,fd,js,nb,na,sp,SAML_SINGLE_LOGOUT_NOT_SUPPORTED,SAML_SINGLE_LOGOUT_NOT_SUPPORTED,NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME -docstring-min-length=1 - -disable=E0611,W0703,W0511,W1401,F0401,W0102,E1103,W0212,I0011 - -[TYPECHECK] - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus extisting member attributes cannot be deduced by static analysis -ignored-modules= - -# List of classes names for which member attributes should not be checked -# (useful for classes with attributes dynamically set). -ignored-classes=SQLObject,WSGIRequest - -# When zope mode is activated, add a predefined set of Zope acquired attributes -# to generated-members. -zope=no - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E0201 when accessed. -generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context,views,save - -# List of method names used to declare (i.e. assign) instance attributes -defining-attr-methods=__init__,__new__,setUp - -[VARIABLES] -init-import=no -dummy-variables-rgx=_|dummy - -[SIMILARITIES] -min-similarity-lines=6 -ignore-comments=yes -ignore-docstrings=yes -[MISCELLANEOUS] -notes=FIXME,XXX,TODO - -[FORMAT] -max-line-length=200 -max-module-lines=1200 -indent-string=' ' -indent-after-paren=4 - -[DESIGN] -max-args=10 -max-locals=40 -max-returns=6 -max-branches=50 -max-statements=120 -max-parents=10 -max-attributes=10 -min-public-methods=0 -max-public-methods=100 diff --git a/tests/settings/settings10.json b/tests/settings/settings10.json new file mode 100644 index 00000000..f118b4d0 --- /dev/null +++ b/tests/settings/settings10.json @@ -0,0 +1,46 @@ +{ + "strict": false, + "debug": false, + "sp": { + "entityId": "http://stuff.com/endpoints/metadata.php", + "assertionConsumerService": { + "url": "http://stuff.com/endpoints/endpoints/acs.php" + }, + "singleLogoutService": { + "url": "http://stuff.com/endpoints/endpoints/sls.php" + }, + "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" + }, + "idp": { + "entityId": "http://idp.example.com/", + "singleSignOnService": { + "url": "http://idp.example.com/SSOService.php" + }, + "singleLogoutService": { + "url": "http://idp.example.com/SingleLogoutService.php" + }, + "x509cert": "MIICbDCCAdWgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBTMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRgwFgYDVQQDDA9pZHAuZXhhbXBsZS5jb20wHhcNMTQwOTIzMTIyNDA4WhcNNDIwMjA4MTIyNDA4WjBTMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRgwFgYDVQQDDA9pZHAuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOWA+YHU7cvPOrBOfxCscsYTJB+kH3MaA9BFrSHFS+KcR6cw7oPSktIJxUgvDpQbtfNcOkE/tuOPBDoech7AXfvH6d7Bw7xtW8PPJ2mB5Hn/HGW2roYhxmfh3tR5SdwN6i4ERVF8eLkvwCHsNQyK2Ref0DAJvpBNZMHCpS24916/AgMBAAGjUDBOMB0GA1UdDgQWBBQ77/qVeiigfhYDITplCNtJKZTM8DAfBgNVHSMEGDAWgBQ77/qVeiigfhYDITplCNtJKZTM8DAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBDQUAA4GBAJO2j/1uO80E5C2PM6Fk9mzerrbkxl7AZ/mvlbOn+sNZE+VZ1AntYuG8ekbJpJtG1YfRfc7EA9mEtqvv4dhv7zBy4nK49OR+KpIBjItWB5kYvrqMLKBa32sMbgqqUqeF1ENXKjpvLSuPdfGJZA3dNa/+Dyb8GGqWe707zLyc5F8m" + }, + "security": { + "authnRequestsSigned": false, + "wantAssertionsSigned": false, + "signMetadata": false + }, + "contactPerson": { + "technical": { + "givenName": "technical_name", + "emailAddress": "technical@example.com" + }, + "support": { + "givenName": "support_name", + "emailAddress": "support@example.com" + } + }, + "organization": { + "en-US": { + "name": "sp_test", + "displayname": "SP test", + "url": "http://sp.example.com" + } + } +} diff --git a/tests/settings/settings11.json b/tests/settings/settings11.json new file mode 100644 index 00000000..a039b32d --- /dev/null +++ b/tests/settings/settings11.json @@ -0,0 +1,48 @@ +{ + "strict": false, + "debug": false, + "custom_base_path": "../../../tests/data/customPath/", + "sp": { + "entityId": "http://stuff.com/endpoints/metadata.php", + "assertionConsumerService": { + "url": "http://stuff.com/endpoints/endpoints/acs.php" + }, + "singleLogoutService": { + "url": "http://stuff.com/endpoints/endpoints/sls.php" + }, + "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" + }, + "idp": { + "entityId": "http://idp.example.com/", + "singleSignOnService": { + "url": "http://idp.example.com/SSOService.php" + }, + "singleLogoutService": { + "url": "http://idp.example.com/SingleLogoutService.php" + }, + "x509cert": "MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMCTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYDVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xiZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2ZlaWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo" + }, + "security": { + "authnRequestsSigned": false, + "wantAssertionsSigned": false, + "signMetadata": false, + "allowRepeatAttributeName": true + }, + "contactPerson": { + "technical": { + "givenName": "technical_name", + "emailAddress": "technical@example.com" + }, + "support": { + "givenName": "support_name", + "emailAddress": "support@example.com" + } + }, + "organization": { + "en-US": { + "name": "sp_test", + "displayname": "SP test", + "url": "http://sp.example.com" + } + } +} diff --git a/tests/settings/settings9.json b/tests/settings/settings9.json new file mode 100644 index 00000000..351c5c95 --- /dev/null +++ b/tests/settings/settings9.json @@ -0,0 +1,46 @@ +{ + "strict": false, + "debug": false, + "custom_base_path": "../../../tests/data/customPath/", + "sp": { + "entityId": "http://stuff.com/endpoints/metadata.php", + "assertionConsumerService": { + "url": "http://stuff.com/endpoints/endpoints/acs.php" + }, + "singleLogoutService": { + "url": "http://stuff.com/endpoints/endpoints/sls.php" + }, + "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" + }, + "idp": { + "entityId": "http://idp.example.com/", + "singleSignOnService": { + "url": "http://idp.example.com/SSOService.php" + }, + "singleLogoutService": { + "url": "http://idp.example.com/SingleLogoutService.php" + } + }, + "security": { + "authnRequestsSigned": false, + "wantAssertionsSigned": false, + "signMetadata": false + }, + "contactPerson": { + "technical": { + "givenName": "technical_name", + "emailAddress": "technical@example.com" + }, + "support": { + "givenName": "support_name", + "emailAddress": "support@example.com" + } + }, + "organization": { + "en-US": { + "name": "sp_test", + "displayname": "SP test", + "url": "http://sp.example.com" + } + } +} diff --git a/tests/src/OneLogin/saml2_tests/auth_test.py b/tests/src/OneLogin/saml2_tests/auth_test.py index c7c391c7..455b2d28 100644 --- a/tests/src/OneLogin/saml2_tests/auth_test.py +++ b/tests/src/OneLogin/saml2_tests/auth_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License from base64 import b64decode, b64encode import json @@ -22,36 +20,32 @@ class OneLogin_Saml2_Auth_Test(unittest.TestCase): - data_path = join(dirname(dirname(dirname(dirname(__file__)))), 'data') - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + data_path = join(dirname(dirname(dirname(dirname(__file__)))), "data") + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") # assertRaisesRegexp deprecated on python3 def assertRaisesRegex(self, exception, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRaisesRegex'): + if hasattr(unittest.TestCase, "assertRaisesRegex"): return super(OneLogin_Saml2_Auth_Test, self).assertRaisesRegex(exception, regexp, msg=msg) else: return self.assertRaisesRegexp(exception, regexp) - def loadSettingsJSON(self, name='settings1.json'): + def loadSettingsJSON(self, name="settings1.json"): filename = join(self.settings_path, name) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content def get_request(self): - return { - 'http_host': 'example.com', - 'script_name': '/index.html', - 'get_data': {} - } + return {"http_host": "example.com", "script_name": "/index.html", "get_data": {}} def testGetSettings(self): """ @@ -74,7 +68,7 @@ def testGetSSOurl(self): settings_info = self.loadSettingsJSON() auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertEqual(auth.get_sso_url(), sso_url) def testGetSLOurl(self): @@ -84,9 +78,24 @@ def testGetSLOurl(self): settings_info = self.loadSettingsJSON() auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertEqual(auth.get_slo_url(), slo_url) + def testGetSLOresponseUrl(self): + """ + Tests the get_slo_response_url method of the OneLogin_Saml2_Auth class + """ + settings_info = self.loadSettingsJSON() + settings_info["idp"]["singleLogoutService"]["responseUrl"] = "http://idp.example.com/SingleLogoutReturn.php" + auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) + slo_url = settings_info["idp"]["singleLogoutService"]["responseUrl"] + self.assertEqual(auth.get_slo_response_url(), slo_url) + # test that the function falls back to the url setting if responseUrl is not set + settings_info["idp"]["singleLogoutService"].pop("responseUrl") + auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) + slo_url = settings_info["idp"]["singleLogoutService"]["url"] + self.assertEqual(auth.get_slo_response_url(), slo_url) + def testGetSessionIndex(self): """ Tests the get_session_index method of the OneLogin_Saml2_Auth class @@ -96,16 +105,14 @@ def testGetSessionIndex(self): self.assertIsNone(auth.get_session_index()) request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth2 = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) self.assertIsNone(auth2.get_session_index()) auth2.process_response() - self.assertEqual('_6273d77b8cde0c333ec79d22a9fa0003b9fe2d75cb', auth2.get_session_index()) + self.assertEqual("_6273d77b8cde0c333ec79d22a9fa0003b9fe2d75cb", auth2.get_session_index()) def testGetSessionExpiration(self): """ @@ -116,11 +123,9 @@ def testGetSessionExpiration(self): self.assertIsNone(auth.get_session_expiration()) request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth2 = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) self.assertIsNone(auth2.get_session_expiration()) @@ -133,15 +138,13 @@ def testGetLastErrorReason(self): Case Invalid Response """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_response() - self.assertEqual(auth.get_last_error_reason(), 'Signature validation failed. SAML Response rejected') + self.assertEqual(auth.get_last_error_reason(), "Signature validation failed. SAML Response rejected") def testProcessNoResponse(self): """ @@ -149,9 +152,9 @@ def testProcessNoResponse(self): Case No Response, An exception is throw """ auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=self.loadSettingsJSON()) - with self.assertRaisesRegex(OneLogin_Saml2_Error, 'SAML Response not found'): + with self.assertRaisesRegex(OneLogin_Saml2_Error, "SAML Response not found"): auth.process_response() - self.assertEqual(auth.get_errors(), ['invalid_binding']) + self.assertEqual(auth.get_errors(), ["invalid_binding"]) def testProcessResponseInvalid(self): """ @@ -161,19 +164,17 @@ def testProcessResponseInvalid(self): the error array is not empty, contains 'invalid_response """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_response() self.assertFalse(auth.is_authenticated()) self.assertEqual(len(auth.get_attributes()), 0) self.assertEqual(auth.get_nameid(), None) - self.assertEqual(auth.get_attribute('uid'), None) - self.assertEqual(auth.get_errors(), ['invalid_response']) + self.assertEqual(auth.get_attribute("uid"), None) + self.assertEqual(auth.get_errors(), ["invalid_response"]) def testProcessResponseInvalidRequestId(self): """ @@ -181,27 +182,25 @@ def testProcessResponseInvalidRequestId(self): Case Invalid Response, Invalid requestID """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'unsigned_response.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) plain_message = compat.to_string(b64decode(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': compat.to_string(b64encode(compat.to_bytes(plain_message))) - } + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": compat.to_string(b64encode(compat.to_bytes(plain_message)))} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) - request_id = 'invalid' + request_id = "invalid" auth.process_response(request_id) - self.assertEqual('No Signature found. SAML Response rejected', auth.get_last_error_reason()) + self.assertEqual("No Signature found. SAML Response rejected", auth.get_last_error_reason()) auth.set_strict(True) auth.process_response(request_id) - self.assertEqual(auth.get_errors(), ['invalid_response']) - self.assertEqual('The InResponseTo of the Response: _57bcbf70-7b1f-012e-c821-782bcb13bb38, does not match the ID of the AuthNRequest sent by the SP: invalid', auth.get_last_error_reason()) + self.assertEqual(auth.get_errors(), ["invalid_response"]) + self.assertEqual("The InResponseTo of the Response: _57bcbf70-7b1f-012e-c821-782bcb13bb38, does not match the ID of the AuthNRequest sent by the SP: invalid", auth.get_last_error_reason()) - valid_request_id = '_57bcbf70-7b1f-012e-c821-782bcb13bb38' + valid_request_id = "_57bcbf70-7b1f-012e-c821-782bcb13bb38" auth.process_response(valid_request_id) - self.assertEqual('No Signature found. SAML Response rejected', auth.get_last_error_reason()) + self.assertEqual("No Signature found. SAML Response rejected", auth.get_last_error_reason()) def testProcessResponseValid(self): """ @@ -211,22 +210,22 @@ def testProcessResponseValid(self): the error array is empty """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_response() self.assertTrue(auth.is_authenticated()) self.assertEqual(len(auth.get_errors()), 0) - self.assertEqual('492882615acf31c8096b627245d76ae53036c090', auth.get_nameid()) + self.assertEqual("492882615acf31c8096b627245d76ae53036c090", auth.get_nameid()) attributes = auth.get_attributes() self.assertNotEqual(len(attributes), 0) - self.assertEqual(auth.get_attribute('mail'), attributes['mail']) + self.assertEqual(auth.get_attribute("mail"), attributes["mail"]) + friendlyname_attributes = auth.get_friendlyname_attributes() + self.assertEqual(len(friendlyname_attributes), 0) session_index = auth.get_session_index() - self.assertEqual('_6273d77b8cde0c333ec79d22a9fa0003b9fe2d75cb', session_index) + self.assertEqual("_6273d77b8cde0c333ec79d22a9fa0003b9fe2d75cb", session_index) self.assertEqual("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", auth.get_nameid_format()) self.assertIsNone(auth.get_nameid_nq()) self.assertEqual("http://stuff.com/endpoints/metadata.php", auth.get_nameid_spnq()) @@ -239,8 +238,8 @@ def testRedirectTo(self): Case redirect without url parameter """ request_data = self.get_request() - relay_state = 'http://sp.example.com' - request_data['get_data']['RelayState'] = relay_state + relay_state = "http://sp.example.com" + request_data["get_data"]["RelayState"] = relay_state auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) target_url = auth.redirect_to() self.assertEqual(target_url, relay_state) @@ -253,9 +252,9 @@ def testRedirectTowithUrl(self): Case redirect with url parameter """ request_data = self.get_request() - relay_state = 'http://sp.example.com' - url_2 = 'http://sp2.example.com' - request_data['get_data']['RelayState'] = relay_state + relay_state = "http://sp.example.com" + url_2 = "http://sp2.example.com" + request_data["get_data"]["RelayState"] = relay_state auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) target_url = auth.redirect_to(url_2) self.assertEqual(target_url, url_2) @@ -266,9 +265,9 @@ def testProcessNoSLO(self): Case No Message, An exception is throw """ auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=self.loadSettingsJSON()) - with self.assertRaisesRegex(OneLogin_Saml2_Error, 'SAML LogoutRequest/LogoutResponse not found'): + with self.assertRaisesRegex(OneLogin_Saml2_Error, "SAML LogoutRequest/LogoutResponse not found"): auth.process_slo(True) - self.assertEqual(auth.get_errors(), ['invalid_binding']) + self.assertEqual(auth.get_errors(), ["invalid_binding"]) def testProcessSLOResponseInvalid(self): """ @@ -276,8 +275,8 @@ def testProcessSLOResponseInvalid(self): Case Invalid Logout Response """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) - request_data['get_data']['SAMLResponse'] = message + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) + request_data["get_data"]["SAMLResponse"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_slo(True) @@ -286,7 +285,7 @@ def testProcessSLOResponseInvalid(self): auth.set_strict(True) auth.process_slo(True) # The Destination fails - self.assertEqual(auth.get_errors(), ['invalid_logout_response']) + self.assertEqual(auth.get_errors(), ["invalid_logout_response"]) auth.set_strict(False) auth.process_slo(True) @@ -295,21 +294,21 @@ def testProcessSLOResponseInvalid(self): def testProcessSLOResponseNoSucess(self): """ Tests the process_slo method of the OneLogin_Saml2_Auth class - Case Logout Response not sucess + Case Logout Response not success """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_responses', 'invalids', 'status_code_responder.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "invalids", "status_code_responder.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLResponse'] = message + request_data["get_data"]["SAMLResponse"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.set_strict(True) auth.process_slo(True) - self.assertEqual(auth.get_errors(), ['logout_not_success']) + self.assertEqual(auth.get_errors(), ["logout_not_success"]) def testProcessSLOResponseRequestId(self): """ @@ -317,21 +316,21 @@ def testProcessSLOResponseRequestId(self): Case Logout Response with valid and invalid Request ID """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLResponse'] = message + request_data["get_data"]["SAMLResponse"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) - request_id = 'wrongID' + request_id = "wrongID" auth.set_strict(True) auth.process_slo(True, request_id) - self.assertEqual(auth.get_errors(), ['invalid_logout_response']) + self.assertEqual(auth.get_errors(), ["invalid_logout_response"]) - request_id = 'ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e' + request_id = "ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e" auth.process_slo(True, request_id) self.assertEqual(len(auth.get_errors()), 0) @@ -341,13 +340,13 @@ def testProcessSLOResponseValid(self): Case Valid Logout Response """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLResponse'] = message + request_data["get_data"]["SAMLResponse"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) # FIXME @@ -371,7 +370,7 @@ def testProcessSLOResponseValidDeletingSession(self): Case Valid Logout Response, validating deleting the local session """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) # FIXME # if (!isset($_SESSION)) { @@ -382,9 +381,9 @@ def testProcessSLOResponseValidDeletingSession(self): # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLResponse'] = message + request_data["get_data"]["SAMLResponse"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.set_strict(True) @@ -402,29 +401,29 @@ def testProcessSLORequestInvalidValid(self): """ settings_info = self.loadSettingsJSON() request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64')) - request_data['get_data']['SAMLRequest'] = message + message = self.file_contents(join(self.data_path, "logout_requests", "logout_request_deflated.xml.base64")) + request_data["get_data"]["SAMLRequest"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_info) target_url = auth.process_slo(True) parsed_query = parse_qs(urlparse(target_url)[4]) self.assertEqual(len(auth.get_errors()), 0) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLResponse', parsed_query) + self.assertIn("SAMLResponse", parsed_query) # self.assertNotIn('RelayState', parsed_query) auth.set_strict(True) auth.process_slo(True) # Fail due destination missmatch - self.assertEqual(auth.get_errors(), ['invalid_logout_request']) + self.assertEqual(auth.get_errors(), ["invalid_logout_request"]) auth.set_strict(False) target_url_2 = auth.process_slo(True) parsed_query_2 = parse_qs(urlparse(target_url_2)[4]) self.assertEqual(len(auth.get_errors()), 0) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url_2) - self.assertIn('SAMLResponse', parsed_query_2) + self.assertIn("SAMLResponse", parsed_query_2) # self.assertNotIn('RelayState', parsed_query_2) def testProcessSLORequestNotOnOrAfterFailed(self): @@ -433,18 +432,18 @@ def testProcessSLORequestNotOnOrAfterFailed(self): Case Logout Request NotOnOrAfter failed """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_requests', 'invalids', 'not_after_failed.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_requests", "invalids", "not_after_failed.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLRequest'] = message + request_data["get_data"]["SAMLRequest"] = message auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.set_strict(True) auth.process_slo(True) - self.assertEqual(auth.get_errors(), ['invalid_logout_request']) + self.assertEqual(auth.get_errors(), ["invalid_logout_request"]) def testProcessSLORequestDeletingSession(self): """ @@ -454,13 +453,13 @@ def testProcessSLORequestDeletingSession(self): """ settings_info = self.loadSettingsJSON() request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_requests", "logout_request_deflated.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLRequest'] = message + request_data["get_data"]["SAMLRequest"] = message # FIXME # if (!isset($_SESSION)) { # $_SESSION = array(); @@ -471,9 +470,9 @@ def testProcessSLORequestDeletingSession(self): auth.set_strict(True) target_url = auth.process_slo(True) parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLResponse', parsed_query) + self.assertIn("SAMLResponse", parsed_query) # self.assertNotIn('RelayState', parsed_query) # FIXME // Session is not alive @@ -485,9 +484,9 @@ def testProcessSLORequestDeletingSession(self): target_url_2 = auth.process_slo(True) target_url_2 = auth.process_slo(True) parsed_query_2 = parse_qs(urlparse(target_url_2)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url_2) - self.assertIn('SAMLResponse', parsed_query_2) + self.assertIn("SAMLResponse", parsed_query_2) # self.assertNotIn('RelayState', parsed_query_2) # FIXME // Session is alive @@ -502,24 +501,24 @@ def testProcessSLORequestRelayState(self): """ settings_info = self.loadSettingsJSON() request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_requests", "logout_request_deflated.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLRequest'] = message - request_data['get_data']['RelayState'] = 'http://relaystate.com' + request_data["get_data"]["SAMLRequest"] = message + request_data["get_data"]["RelayState"] = "http://relaystate.com" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_info) auth.set_strict(True) target_url = auth.process_slo(False) parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLResponse', parsed_query) - self.assertIn('RelayState', parsed_query) - self.assertIn('http://relaystate.com', parsed_query['RelayState']) + self.assertIn("SAMLResponse", parsed_query) + self.assertIn("RelayState", parsed_query) + self.assertIn("http://relaystate.com", parsed_query["RelayState"]) def testProcessSLORequestSignedResponse(self): """ @@ -528,29 +527,29 @@ def testProcessSLORequestSignedResponse(self): a signed LogoutResponse is created and a redirection executed """ settings_info = self.loadSettingsJSON() - settings_info['security']['logoutResponseSigned'] = True + settings_info["security"]["logoutResponseSigned"] = True request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_requests", "logout_request_deflated.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_data['get_data']['SAMLRequest'] = message - request_data['get_data']['RelayState'] = 'http://relaystate.com' + request_data["get_data"]["SAMLRequest"] = message + request_data["get_data"]["RelayState"] = "http://relaystate.com" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_info) auth.set_strict(True) target_url = auth.process_slo(False) parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLResponse', parsed_query) - self.assertIn('RelayState', parsed_query) - self.assertIn('SigAlg', parsed_query) - self.assertIn('Signature', parsed_query) - self.assertIn('http://relaystate.com', parsed_query['RelayState']) - self.assertIn(OneLogin_Saml2_Constants.RSA_SHA1, parsed_query['SigAlg']) + self.assertIn("SAMLResponse", parsed_query) + self.assertIn("RelayState", parsed_query) + self.assertIn("SigAlg", parsed_query) + self.assertIn("Signature", parsed_query) + self.assertIn("http://relaystate.com", parsed_query["RelayState"]) + self.assertIn(OneLogin_Saml2_Constants.RSA_SHA256, parsed_query["SigAlg"]) def testLogin(self): """ @@ -563,12 +562,12 @@ def testLogin(self): target_url = auth.login() parsed_query = parse_qs(urlparse(target_url)[4]) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertIn(sso_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - self.assertIn('RelayState', parsed_query) + self.assertIn("SAMLRequest", parsed_query) + self.assertIn("RelayState", parsed_query) hostname = OneLogin_Saml2_Utils.get_self_host(request_data) - self.assertIn(u'http://%s/index.html' % hostname, parsed_query['RelayState']) + self.assertIn("http://%s/index.html" % hostname, parsed_query["RelayState"]) def testLoginWithRelayState(self): """ @@ -578,15 +577,15 @@ def testLoginWithRelayState(self): """ settings_info = self.loadSettingsJSON() auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - relay_state = 'http://sp.example.com' + relay_state = "http://sp.example.com" target_url = auth.login(relay_state) parsed_query = parse_qs(urlparse(target_url)[4]) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertIn(sso_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - self.assertIn('RelayState', parsed_query) - self.assertIn(relay_state, parsed_query['RelayState']) + self.assertIn("SAMLRequest", parsed_query) + self.assertIn("RelayState", parsed_query) + self.assertIn(relay_state, parsed_query["RelayState"]) def testLoginSigned(self): """ @@ -594,20 +593,20 @@ def testLoginSigned(self): Case Login signed. An AuthnRequest signed is built an redirect executed """ settings_info = self.loadSettingsJSON() - settings_info['security']['authnRequestsSigned'] = True + settings_info["security"]["authnRequestsSigned"] = True auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - return_to = u'http://example.com/returnto' + return_to = "http://example.com/returnto" target_url = auth.login(return_to) parsed_query = parse_qs(urlparse(target_url)[4]) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertIn(sso_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - self.assertIn('RelayState', parsed_query) - self.assertIn('SigAlg', parsed_query) - self.assertIn('Signature', parsed_query) - self.assertIn(return_to, parsed_query['RelayState']) - self.assertIn(OneLogin_Saml2_Constants.RSA_SHA1, parsed_query['SigAlg']) + self.assertIn("SAMLRequest", parsed_query) + self.assertIn("RelayState", parsed_query) + self.assertIn("SigAlg", parsed_query) + self.assertIn("Signature", parsed_query) + self.assertIn(return_to, parsed_query["RelayState"]) + self.assertIn(OneLogin_Saml2_Constants.RSA_SHA256, parsed_query["SigAlg"]) def testLoginForceAuthN(self): """ @@ -615,31 +614,31 @@ def testLoginForceAuthN(self): Case AuthN Request is built with ForceAuthn and redirect executed """ settings_info = self.loadSettingsJSON() - return_to = u'http://example.com/returnto' + return_to = "http://example.com/returnto" auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url = auth.login(return_to) parsed_query = parse_qs(urlparse(target_url)[4]) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertIn(sso_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query['SAMLRequest'][0])) + self.assertIn("SAMLRequest", parsed_query) + request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query["SAMLRequest"][0])) self.assertNotIn('ForceAuthn="true"', request) auth_2 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url_2 = auth_2.login(return_to, False, False) parsed_query_2 = parse_qs(urlparse(target_url_2)[4]) self.assertIn(sso_url, target_url_2) - self.assertIn('SAMLRequest', parsed_query_2) - request_2 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_2['SAMLRequest'][0])) + self.assertIn("SAMLRequest", parsed_query_2) + request_2 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_2["SAMLRequest"][0])) self.assertNotIn('ForceAuthn="true"', request_2) auth_3 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url_3 = auth_3.login(return_to, True, False) parsed_query_3 = parse_qs(urlparse(target_url_3)[4]) self.assertIn(sso_url, target_url_3) - self.assertIn('SAMLRequest', parsed_query_3) - request_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_3['SAMLRequest'][0])) + self.assertIn("SAMLRequest", parsed_query_3) + request_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_3["SAMLRequest"][0])) self.assertIn('ForceAuthn="true"', request_3) def testLoginIsPassive(self): @@ -648,32 +647,32 @@ def testLoginIsPassive(self): Case AuthN Request is built with IsPassive and redirect executed """ settings_info = self.loadSettingsJSON() - return_to = u'http://example.com/returnto' - settings_info['idp']['singleSignOnService']['url'] + return_to = "http://example.com/returnto" + settings_info["idp"]["singleSignOnService"]["url"] auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url = auth.login(return_to) parsed_query = parse_qs(urlparse(target_url)[4]) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertIn(sso_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query['SAMLRequest'][0])) + self.assertIn("SAMLRequest", parsed_query) + request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query["SAMLRequest"][0])) self.assertNotIn('IsPassive="true"', request) auth_2 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url_2 = auth_2.login(return_to, False, False) parsed_query_2 = parse_qs(urlparse(target_url_2)[4]) self.assertIn(sso_url, target_url_2) - self.assertIn('SAMLRequest', parsed_query_2) - request_2 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_2['SAMLRequest'][0])) + self.assertIn("SAMLRequest", parsed_query_2) + request_2 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_2["SAMLRequest"][0])) self.assertNotIn('IsPassive="true"', request_2) auth_3 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url_3 = auth_3.login(return_to, False, True) parsed_query_3 = parse_qs(urlparse(target_url_3)[4]) self.assertIn(sso_url, target_url_3) - self.assertIn('SAMLRequest', parsed_query_3) - request_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_3['SAMLRequest'][0])) + self.assertIn("SAMLRequest", parsed_query_3) + request_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_3["SAMLRequest"][0])) self.assertIn('IsPassive="true"', request_3) def testLoginSetNameIDPolicy(self): @@ -682,33 +681,33 @@ def testLoginSetNameIDPolicy(self): Case AuthN Request is built with and without NameIDPolicy """ settings_info = self.loadSettingsJSON() - return_to = u'http://example.com/returnto' - settings_info['idp']['singleSignOnService']['url'] + return_to = "http://example.com/returnto" + settings_info["idp"]["singleSignOnService"]["url"] auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) target_url = auth.login(return_to) parsed_query = parse_qs(urlparse(target_url)[4]) - sso_url = settings_info['idp']['singleSignOnService']['url'] + sso_url = settings_info["idp"]["singleSignOnService"]["url"] self.assertIn(sso_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query['SAMLRequest'][0])) - self.assertIn('', request) - self.assertNotIn('", request) + self.assertNotIn("', request_2) + self.assertIn("SAMLRequest", parsed_query_2) + request_2 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_2["SAMLRequest"][0])) + self.assertIn("", request_2) self.assertIn('Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">testuser@example.com', request_2) self.assertIn('', request_2) - settings_info['sp']['NameIDFormat'] = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' + settings_info["sp"]["NameIDFormat"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" auth_3 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - target_url_3 = auth_3.login(return_to, name_id_value_req='testuser@example.com') + target_url_3 = auth_3.login(return_to, name_id_value_req="testuser@example.com") parsed_query_3 = parse_qs(urlparse(target_url_3)[4]) self.assertIn(sso_url, target_url_3) - self.assertIn('SAMLRequest', parsed_query_3) - request_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_3['SAMLRequest'][0])) - self.assertIn('', request_3) + self.assertIn("SAMLRequest", parsed_query_3) + request_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query_3["SAMLRequest"][0])) + self.assertIn("", request_3) self.assertIn('Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">testuser@example.com', request_3) self.assertIn('', request_3) @@ -762,12 +761,12 @@ def testLogout(self): target_url = auth.logout() parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - self.assertIn('RelayState', parsed_query) + self.assertIn("SAMLRequest", parsed_query) + self.assertIn("RelayState", parsed_query) hostname = OneLogin_Saml2_Utils.get_self_host(request_data) - self.assertIn(u'http://%s/index.html' % hostname, parsed_query['RelayState']) + self.assertIn("http://%s/index.html" % hostname, parsed_query["RelayState"]) def testLogoutWithRelayState(self): """ @@ -777,15 +776,15 @@ def testLogoutWithRelayState(self): """ settings_info = self.loadSettingsJSON() auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - relay_state = 'http://sp.example.com' + relay_state = "http://sp.example.com" target_url = auth.logout(relay_state) parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - self.assertIn('RelayState', parsed_query) - self.assertIn(relay_state, parsed_query['RelayState']) + self.assertIn("SAMLRequest", parsed_query) + self.assertIn("RelayState", parsed_query) + self.assertIn(relay_state, parsed_query["RelayState"]) def testLogoutSigned(self): """ @@ -794,20 +793,20 @@ def testLogoutSigned(self): the assertion is built and redirect executed """ settings_info = self.loadSettingsJSON() - settings_info['security']['logoutRequestSigned'] = True + settings_info["security"]["logoutRequestSigned"] = True auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) - return_to = u'http://example.com/returnto' + return_to = "http://example.com/returnto" target_url = auth.logout(return_to) parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLRequest', parsed_query) - self.assertIn('RelayState', parsed_query) - self.assertIn('SigAlg', parsed_query) - self.assertIn('Signature', parsed_query) - self.assertIn(return_to, parsed_query['RelayState']) - self.assertIn(OneLogin_Saml2_Constants.RSA_SHA1, parsed_query['SigAlg']) + self.assertIn("SAMLRequest", parsed_query) + self.assertIn("RelayState", parsed_query) + self.assertIn("SigAlg", parsed_query) + self.assertIn("Signature", parsed_query) + self.assertIn(return_to, parsed_query["RelayState"]) + self.assertIn(OneLogin_Saml2_Constants.RSA_SHA256, parsed_query["SigAlg"]) def testLogoutNoSLO(self): """ @@ -815,11 +814,11 @@ def testLogoutNoSLO(self): Case IdP no SLO endpoint. """ settings_info = self.loadSettingsJSON() - del settings_info['idp']['singleLogoutService'] + del settings_info["idp"]["singleLogoutService"] auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) # The Header of the redirect produces an Exception - with self.assertRaisesRegex(OneLogin_Saml2_Error, 'The IdP does not support Single Log Out'): - auth.logout('http://example.com/returnto') + with self.assertRaisesRegex(OneLogin_Saml2_Error, "The IdP does not support Single Log Out"): + auth.logout("http://example.com/returnto") def testLogoutNameIDandSessionIndex(self): """ @@ -830,15 +829,15 @@ def testLogoutNameIDandSessionIndex(self): request_data = self.get_request() auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_info) - name_id = 'name_id_example' - session_index = 'session_index_example' + name_id = "name_id_example" + session_index = "session_index_example" target_url = auth.logout(name_id=name_id, session_index=session_index) parsed_query = parse_qs(urlparse(target_url)[4]) - slo_url = settings_info['idp']['singleLogoutService']['url'] + slo_url = settings_info["idp"]["singleLogoutService"]["url"] self.assertIn(slo_url, target_url) - self.assertIn('SAMLRequest', parsed_query) + self.assertIn("SAMLRequest", parsed_query) - logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query['SAMLRequest'][0]) + logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query["SAMLRequest"][0]) name_id_from_request = OneLogin_Saml2_Logout_Request.get_nameid(logout_request) sessions_index_in_request = OneLogin_Saml2_Logout_Request.get_session_indexes(logout_request) self.assertIn(session_index, sessions_index_in_request) @@ -850,11 +849,9 @@ def testLogoutNameID(self): Case nameID loaded after process SAML Response """ request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_response() @@ -863,8 +860,8 @@ def testLogoutNameID(self): target_url = auth.logout() parsed_query = parse_qs(urlparse(target_url)[4]) - self.assertIn('SAMLRequest', parsed_query) - logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query['SAMLRequest'][0]) + self.assertIn("SAMLRequest", parsed_query) + logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query["SAMLRequest"][0]) name_id_from_request = OneLogin_Saml2_Logout_Request.get_nameid(logout_request) name_id_format_from_request = OneLogin_Saml2_Logout_Request.get_nameid_format(logout_request) @@ -875,8 +872,8 @@ def testLogoutNameID(self): new_name_id_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" target_url_2 = auth.logout(name_id=new_name_id, name_id_format=new_name_id_format) parsed_query = parse_qs(urlparse(target_url_2)[4]) - self.assertIn('SAMLRequest', parsed_query) - logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query['SAMLRequest'][0]) + self.assertIn("SAMLRequest", parsed_query) + logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(parsed_query["SAMLRequest"][0]) name_id_from_request = OneLogin_Saml2_Logout_Request.get_nameid(logout_request) name_id_format_from_request = OneLogin_Saml2_Logout_Request.get_nameid_format(logout_request) @@ -888,7 +885,7 @@ def testSetStrict(self): Tests the set_strict method of the OneLogin_Saml2_Auth """ settings_info = self.loadSettingsJSON() - settings_info['strict'] = False + settings_info["strict"] = False auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info) settings = auth.get_settings() @@ -902,26 +899,22 @@ def testSetStrict(self): settings = auth.get_settings() self.assertFalse(settings.is_strict()) - self.assertRaises(AssertionError, auth.set_strict, '42') + self.assertRaises(AssertionError, auth.set_strict, "42") def testIsAuthenticated(self): """ Tests the is_authenticated method of the OneLogin_Saml2_Auth """ request_data = self.get_request() - del request_data['get_data'] - message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + del request_data["get_data"] + message = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_response() self.assertFalse(auth.is_authenticated()) - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=self.loadSettingsJSON()) auth.process_response() self.assertTrue(auth.is_authenticated()) @@ -932,30 +925,24 @@ def testGetNameId(self): """ settings = self.loadSettingsJSON() request_data = self.get_request() - del request_data['get_data'] - message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + del request_data["get_data"] + message = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() self.assertFalse(auth.is_authenticated()) self.assertEqual(auth.get_nameid(), None) - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() self.assertTrue(auth.is_authenticated()) self.assertEqual("492882615acf31c8096b627245d76ae53036c090", auth.get_nameid()) - settings_2 = self.loadSettingsJSON('settings2.json') - message = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion2.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + settings_2 = self.loadSettingsJSON("settings2.json") + message = self.file_contents(join(self.data_path, "responses", "signed_message_encrypted_assertion2.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_2) auth.process_response() self.assertTrue(auth.is_authenticated()) @@ -967,30 +954,24 @@ def testGetNameIdFormat(self): """ settings = self.loadSettingsJSON() request_data = self.get_request() - del request_data['get_data'] - message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + del request_data["get_data"] + message = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() self.assertFalse(auth.is_authenticated()) self.assertEqual(auth.get_nameid_format(), None) - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() self.assertTrue(auth.is_authenticated()) self.assertEqual("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", auth.get_nameid_format()) - settings_2 = self.loadSettingsJSON('settings2.json') - message = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion2.xml.base64')) - request_data['post_data'] = { - 'SAMLResponse': message - } + settings_2 = self.loadSettingsJSON("settings2.json") + message = self.file_contents(join(self.data_path, "responses", "signed_message_encrypted_assertion2.xml.base64")) + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_2) auth.process_response() self.assertTrue(auth.is_authenticated()) @@ -1001,11 +982,9 @@ def testGetNameIdNameQualifier(self): Tests the get_nameid_nq method of the OneLogin_Saml2_Auth """ settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response_with_namequalifier.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "valid_response_with_namequalifier.xml.base64")) request_data = self.get_request() - request_data['post_data'] = { - 'SAMLResponse': message - } + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) self.assertIsNone(auth.get_nameid_nq()) auth.process_response() @@ -1017,11 +996,9 @@ def testGetNameIdNameQualifier2(self): Tests the get_nameid_nq method of the OneLogin_Saml2_Auth """ settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) request_data = self.get_request() - request_data['post_data'] = { - 'SAMLResponse': message - } + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) self.assertIsNone(auth.get_nameid_nq()) auth.process_response() @@ -1033,11 +1010,9 @@ def testGetNameIdSPNameQualifier(self): Tests the get_nameid_spnq method of the OneLogin_Saml2_Auth """ settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response_with_namequalifier.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "valid_response_with_namequalifier.xml.base64")) request_data = self.get_request() - request_data['post_data'] = { - 'SAMLResponse': message - } + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) self.assertIsNone(auth.get_nameid_spnq()) auth.process_response() @@ -1049,11 +1024,9 @@ def testGetNameIdSPNameQualifier2(self): Tests the get_nameid_spnq method of the OneLogin_Saml2_Auth """ settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) request_data = self.get_request() - request_data['post_data'] = { - 'SAMLResponse': message - } + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) self.assertIsNone(auth.get_nameid_spnq()) auth.process_response() @@ -1065,17 +1038,17 @@ def testBuildRequestSignature(self): Tests the build_request_signature method of the OneLogin_Saml2_Auth """ settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64')) - relay_state = 'http://relaystate.com' + message = self.file_contents(join(self.data_path, "logout_requests", "logout_request_deflated.xml.base64")) + relay_state = "http://relaystate.com" parameters = {"SAMLRequest": message, "RelayState": relay_state} auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings) auth.add_request_signature(parameters) - valid_signature = 'Pb1EXAX5TyipSJ1SndEKZstLQTsT+1D00IZAhEepBM+OkAZQSToivu3njgJu47HZiZAqgXZFgloBuuWE/+GdcSsRYEMkEkiSDWTpUr25zKYLJDSg6GNo6iAHsKSuFt46Z54Xe/keYxYP03Hdy97EwuuSjBzzgRc5tmpV+KC7+a0=' + valid_signature = "CqdIlbO6GieeJFV+PYqyqz1QVJunQXdZZl+ZyIby9O3/eMJM0XHi+TWReRrpgNxKkbmmvx5fp/t7mphbLiVYNMgGINEaaa/OfoaGwU9GM5YCVULA2t7qZBel1yrIXGMxijJizB7UPR2ZMo4G+Wdhx1zbmbB0GYM0A27w6YCe/+k=" self.assertEqual(valid_signature, parameters["Signature"]) - settings['sp']['privateKey'] = '' - settings['custom_base_path'] = u'invalid/path/' + settings["sp"]["privateKey"] = "" + settings["custom_base_path"] = "invalid/path/" auth2 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings) with self.assertRaisesRegex(OneLogin_Saml2_Error, "Trying to sign the SAMLRequest but can't load the SP private key"): auth2.add_request_signature(parameters) @@ -1085,18 +1058,18 @@ def testBuildResponseSignature(self): Tests the build_response_signature method of the OneLogin_Saml2_Auth """ settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) - relay_state = 'http://relaystate.com' + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) + relay_state = "http://relaystate.com" auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings) - parameters = {"SAMLResponse": message, 'RelayState': relay_state} + parameters = {"SAMLResponse": message, "RelayState": relay_state} auth.add_response_signature(parameters) - valid_signature = 'IcyWLRX6Dz3wHBfpcUaNLVDMGM3uo6z2Z11Gjq0/APPJaHboKGljffsgMVAGBml497yckq+eYKmmz+jpURV9yTj2sF9qfD6CwX2dEzSzMdRzB40X7pWyHgEJGIhs6BhaOt5oXEk4T+h3AczERqpVYFpL00yo7FNtyQkhZFpHFhM=' - self.assertEqual(valid_signature, parameters['Signature']) + valid_signature = "fFGaOuO/2+ch/xlwU5o7iS6R+v2quWchLAtiDyQTxStFQZKY1NsBs/eYIin2Meq7oTl1Ks6tpT6JshH5OwhPh/08K7M2oa6FIKb99cjg+jIJ/WwpuJ5h9SH0XXP8y3RLhCxLIomHDsBOGQK8WvOlXFUg+9nvOaEMNi6raUWrGhA=" + self.assertEqual(valid_signature, parameters["Signature"]) - settings['sp']['privateKey'] = '' - settings['custom_base_path'] = u'invalid/path/' + settings["sp"]["privateKey"] = "" + settings["custom_base_path"] = "invalid/path/" auth2 = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings) with self.assertRaisesRegex(OneLogin_Saml2_Error, "Trying to sign the SAMLResponse but can't load the SP private key"): auth2.add_response_signature(parameters) @@ -1105,186 +1078,231 @@ def testIsInValidLogoutResponseSign(self): """ Tests the is_valid method of the OneLogin_Saml2_LogoutResponse """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) settings.set_strict(False) - request_data['get_data'] = { - 'SAMLResponse': 'fZJva8IwEMa/Ssl7TZrW/gnqGHMMwSlM8cXeyLU9NaxNQi9lfvxVZczB5ptwSe733MPdjQma2qmFPdjOvyE5awiDU1MbUpevCetaoyyQJmWgQVK+VOvH14WSQ6Fca70tbc1ukPsEEGHrtTUsmM8mbDfKUhnFci8gliGINI/yXIAAiYnsw6JIRgWWAKlkwRZb6skJ64V6nKjDuSEPxvdPIowHIhpIsQkTFaYqSt9ZMEPy2oC/UEfvHSnOnfZFV38MjR1oN7TtgRv8tAZre9CGV9jYkGtT4Wnoju6Bauprme/ebOyErZbPi9XLfLnDoohwhHGc5WVSVhjCKM6rBMpYQpWJrIizfZ4IZNPxuTPqYrmd/m+EdONqPOfy8yG5rhxv0EMFHs52xvxWaHyd3tqD7+j37clWGGyh7vD+POiSrdZdWSIR49NrhR9R/teGTL8A', - 'RelayState': 'https://pitbulk.no-ip.org/newonelogin/demo1/index.php', - 'SigAlg': 'http://www.w3.org/2000/09/xmldsig#rsa-sha1', - 'Signature': 'vfWbbc47PkP3ejx4bjKsRX7lo9Ml1WRoE5J5owF/0mnyKHfSY6XbhO1wwjBV5vWdrUVX+xp6slHyAf4YoAsXFS0qhan6txDiZY4Oec6yE+l10iZbzvie06I4GPak4QrQ4gAyXOSzwCrRmJu4gnpeUxZ6IqKtdrKfAYRAcVfNKGA=' + request_data["get_data"] = { + "SAMLResponse": "fZJva8IwEMa/Ssl7TZrW/gnqGHMMwSlM8cXeyLU9NaxNQi9lfvxVZczB5ptwSe733MPdjQma2qmFPdjOvyE5awiDU1MbUpevCetaoyyQJmWgQVK+VOvH14WSQ6Fca70tbc1ukPsEEGHrtTUsmM8mbDfKUhnFci8gliGINI/yXIAAiYnsw6JIRgWWAKlkwRZb6skJ64V6nKjDuSEPxvdPIowHIhpIsQkTFaYqSt9ZMEPy2oC/UEfvHSnOnfZFV38MjR1oN7TtgRv8tAZre9CGV9jYkGtT4Wnoju6Bauprme/ebOyErZbPi9XLfLnDoohwhHGc5WVSVhjCKM6rBMpYQpWJrIizfZ4IZNPxuTPqYrmd/m+EdONqPOfy8yG5rhxv0EMFHs52xvxWaHyd3tqD7+j37clWGGyh7vD+POiSrdZdWSIR49NrhR9R/teGTL8A", + "RelayState": "https://pitbulk.no-ip.org/newonelogin/demo1/index.php", + "SigAlg": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", + "Signature": "vfWbbc47PkP3ejx4bjKsRX7lo9Ml1WRoE5J5owF/0mnyKHfSY6XbhO1wwjBV5vWdrUVX+xp6slHyAf4YoAsXFS0qhan6txDiZY4Oec6yE+l10iZbzvie06I4GPak4QrQ4gAyXOSzwCrRmJu4gnpeUxZ6IqKtdrKfAYRAcVfNKGA=", } auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() self.assertEqual([], auth.get_errors()) - relay_state = request_data['get_data']['RelayState'] - del request_data['get_data']['RelayState'] + relay_state = request_data["get_data"]["RelayState"] + del request_data["get_data"]["RelayState"] auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() self.assertIn("invalid_logout_response_signature", auth.get_errors()) - request_data['get_data']['RelayState'] = relay_state + request_data["get_data"]["RelayState"] = relay_state settings.set_strict(True) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_response', auth.get_errors()) + self.assertIn("invalid_logout_response", auth.get_errors()) settings.set_strict(False) - old_signature = request_data['get_data']['Signature'] - request_data['get_data']['Signature'] = 'vfWbbc47PkP3ejx4bjKsRX7lo9Ml1WRoE5J5owF/0mnyKHfSY6XbhO1wwjBV5vWdrUVX+xp6slHyAf4YoAsXFS0qhan6txDiZY4Oec6yE+l10iZbzvie06I4GPak4QrQ4gAyXOSzwCrRmJu4gnpeUxZ6IqKtdrKfAYRAcVf3333=' + old_signature = request_data["get_data"]["Signature"] + request_data["get_data"][ + "Signature" + ] = "vfWbbc47PkP3ejx4bjKsRX7lo9Ml1WRoE5J5owF/0mnyKHfSY6XbhO1wwjBV5vWdrUVX+xp6slHyAf4YoAsXFS0qhan6txDiZY4Oec6yE+l10iZbzvie06I4GPak4QrQ4gAyXOSzwCrRmJu4gnpeUxZ6IqKtdrKfAYRAcVf3333=" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_response_signature', auth.get_errors()) + self.assertIn("invalid_logout_response_signature", auth.get_errors()) - request_data['get_data']['Signature'] = old_signature - old_signature_algorithm = request_data['get_data']['SigAlg'] - del request_data['get_data']['SigAlg'] + request_data["get_data"]["Signature"] = old_signature + old_signature_algorithm = request_data["get_data"]["SigAlg"] + del request_data["get_data"]["SigAlg"] auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() self.assertEqual([], auth.get_errors()) - request_data['get_data']['RelayState'] = 'http://example.com/relaystate' + request_data["get_data"]["RelayState"] = "http://example.com/relaystate" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_response_signature', auth.get_errors()) + self.assertIn("invalid_logout_response_signature", auth.get_errors()) settings.set_strict(True) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message_6 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(request_data['get_data']['SAMLResponse'])) - plain_message_6 = plain_message_6.replace('https://pitbulk.no-ip.org/newonelogin/demo1/index.php?sls', current_url) - plain_message_6 = plain_message_6.replace('https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php', 'http://idp.example.com/') - request_data['get_data']['SAMLResponse'] = compat.to_string(OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message_6)) + plain_message_6 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(request_data["get_data"]["SAMLResponse"])) + plain_message_6 = plain_message_6.replace("https://pitbulk.no-ip.org/newonelogin/demo1/index.php?sls", current_url) + plain_message_6 = plain_message_6.replace("https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php", "http://idp.example.com/") + request_data["get_data"]["SAMLResponse"] = compat.to_string(OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message_6)) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_response_signature', auth.get_errors()) + self.assertIn("invalid_logout_response_signature", auth.get_errors()) settings.set_strict(False) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_response_signature', auth.get_errors()) + self.assertIn("invalid_logout_response_signature", auth.get_errors()) - request_data['get_data']['SigAlg'] = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1' + request_data["get_data"]["SigAlg"] = "http://www.w3.org/2000/09/xmldsig#dsa-sha1" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_response_signature', auth.get_errors()) + self.assertIn("invalid_logout_response_signature", auth.get_errors()) settings_info = self.loadSettingsJSON() - settings_info['strict'] = True - settings_info['security']['wantMessagesSigned'] = True + settings_info["strict"] = True + settings_info["security"]["wantMessagesSigned"] = True settings = OneLogin_Saml2_Settings(settings_info) - request_data['get_data']['SigAlg'] = old_signature_algorithm - old_signature = request_data['get_data']['Signature'] - del request_data['get_data']['Signature'] - request_data['get_data']['SAMLResponse'] = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message_6) + request_data["get_data"]["SigAlg"] = old_signature_algorithm + old_signature = request_data["get_data"]["Signature"] + del request_data["get_data"]["Signature"] + request_data["get_data"]["SAMLResponse"] = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message_6) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('Signature validation failed. Logout Response rejected', auth.get_errors()) + self.assertIn("Signature validation failed. Logout Response rejected", auth.get_errors()) - request_data['get_data']['Signature'] = old_signature - settings_info['idp']['certFingerprint'] = 'afe71c28ef740bc87425be13a2263d37971da1f9' - del settings_info['idp']['x509cert'] + request_data["get_data"]["Signature"] = old_signature + settings_info["idp"]["certFingerprint"] = "afe71c28ef740bc87425be13a2263d37971da1f9" + del settings_info["idp"]["x509cert"] settings_2 = OneLogin_Saml2_Settings(settings_info) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_2) auth.process_slo() - self.assertIn('Signature validation failed. Logout Response rejected', auth.get_errors()) + self.assertIn("Signature validation failed. Logout Response rejected", auth.get_errors()) + + def testIsInValidLogoutResponseSignatureRejectingDeprecatedAlgorithm(self): + """ + Tests the process_slo method of the OneLogin_Saml2_Auth + """ + request_data = { + "http_host": "example.com", + "script_name": "index.html", + "get_data": { + "SAMLResponse": "fZHbasJAEIZfJey9ZrNZc1gSodRSBKtQxYveyGQz1kCyu2Q24OM3jS21UHo3p++f4Z+CoGud2th3O/hXJGcNYXDtWkNqapVs6I2yQA0pAx2S8lrtH142Ssy5cr31VtuW3SH/E0CEvW+sYcF6VbLTIktFLMWZgxQR8DSP85wDB4GJGMOqShYVaoBUsOCIPY1kyUahEScacG3Ig/FjiUdyxuOZ4IcoUVGq4vSNBSsk3xjwE3Xx3qkwJD+cz3NtuxBN7WxjPN1F1NLcXdwob77tONiS7bZPm93zenvCqopxgVJmuU50jREsZF4noKWAOuNZJbNznnBky+LTDDVd2S+/dje1m+MVOtfidEER3g8Vt2fsPfiBfmePtsbgCO2A/9tL07TaD1ojEQuXtw0/ouFfD19+AA==", + "RelayState": "http://stuff.com/endpoints/endpoints/index.php", + "SigAlg": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", + "Signature": "OV9c4R0COSjN69fAKCpV7Uj/yx6/KFxvbluVCzdK3UuortpNMpgHFF2wYNlMSG9GcYGk6p3I8nB7Z+1TQchMWZOlO/StjAqgtZhtpiwPcWryNuq8vm/6hnJ3zMDhHTS7F8KG4qkCXmJ9sQD3Y31UNcuygBwIbNakvhDT5Qo9Nsw=", + }, + } + settings_info = self.loadSettingsJSON("settings8.json") + settings_info["security"]["rejectDeprecatedAlgorithm"] = True + settings = OneLogin_Saml2_Settings(settings_info) + auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) + auth.process_slo() + self.assertIn("Signature validation failed. Logout Response rejected", auth.get_errors()) + self.assertEqual("Deprecated signature algorithm found: http://www.w3.org/2000/09/xmldsig#rsa-sha1", auth.get_last_error_reason()) def testIsValidLogoutRequestSign(self): """ - Tests the is_valid method of the OneLogin_Saml2_LogoutRequest + Tests the process_slo method of the OneLogin_Saml2_Auth """ request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': { - 'SAMLRequest': 'lVLBitswEP0Vo7tjeWzJtki8LIRCYLvbNksPewmyPc6K2pJqyXQ/v1LSQlroQi/DMJr33rwZbZ2cJysezNms/gt+X9H55G2etBOXlx1ZFy2MdMoJLWd0wvfieP/xQcCGCrsYb3ozkRvI+wjpHC5eGU2Sw35HTg3lA8hqZFwWFcMKsStpxbEsxoLXeQN9OdY1VAgk+YqLC8gdCUQB7tyKB+281D6UaF6mtEiBPudcABcMXkiyD26Ulv6CevXeOpFlVvlunb5ttEmV3ZjlnGn8YTRO5qx0NuBs8kzpAd829tXeucmR5NH4J/203I8el6gFRUqbFPJnyEV51Wq30by4TLW0/9ZyarYTxt4sBsjUYLMZvRykl1Fxm90SXVkfwx4P++T4KSafVzmpUcVJ/sfSrQZJPphllv79W8WKGtLx0ir8IrVTqD1pT2MH3QAMSs4KTvui71jeFFiwirOmprwPkYW063+5uRq4urHiiC4e8hCX3J5wqAEGaPpw9XB5JmkBdeDqSlkz6CmUXdl0Qae5kv2F/1384wu3PwE=', - 'RelayState': '_1037fbc88ec82ce8e770b2bed1119747bb812a07e6', - 'SigAlg': 'http://www.w3.org/2000/09/xmldsig#rsa-sha1', - 'Signature': 'XCwCyI5cs7WhiJlB5ktSlWxSBxv+6q2xT3c8L7dLV6NQG9LHWhN7gf8qNsahSXfCzA0Ey9dp5BQ0EdRvAk2DIzKmJY6e3hvAIEp1zglHNjzkgcQmZCcrkK9Czi2Y1WkjOwR/WgUTUWsGJAVqVvlRZuS3zk3nxMrLH6f7toyvuJc=' - } + "http_host": "example.com", + "script_name": "index.html", + "get_data": { + "SAMLRequest": "lVLBitswEP0Vo7tjeWzJtki8LIRCYLvbNksPewmyPc6K2pJqyXQ/v1LSQlroQi/DMJr33rwZbZ2cJysezNms/gt+X9H55G2etBOXlx1ZFy2MdMoJLWd0wvfieP/xQcCGCrsYb3ozkRvI+wjpHC5eGU2Sw35HTg3lA8hqZFwWFcMKsStpxbEsxoLXeQN9OdY1VAgk+YqLC8gdCUQB7tyKB+281D6UaF6mtEiBPudcABcMXkiyD26Ulv6CevXeOpFlVvlunb5ttEmV3ZjlnGn8YTRO5qx0NuBs8kzpAd829tXeucmR5NH4J/203I8el6gFRUqbFPJnyEV51Wq30by4TLW0/9ZyarYTxt4sBsjUYLMZvRykl1Fxm90SXVkfwx4P++T4KSafVzmpUcVJ/sfSrQZJPphllv79W8WKGtLx0ir8IrVTqD1pT2MH3QAMSs4KTvui71jeFFiwirOmprwPkYW063+5uRq4urHiiC4e8hCX3J5wqAEGaPpw9XB5JmkBdeDqSlkz6CmUXdl0Qae5kv2F/1384wu3PwE=", + "RelayState": "_1037fbc88ec82ce8e770b2bed1119747bb812a07e6", + "SigAlg": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", + "Signature": "XCwCyI5cs7WhiJlB5ktSlWxSBxv+6q2xT3c8L7dLV6NQG9LHWhN7gf8qNsahSXfCzA0Ey9dp5BQ0EdRvAk2DIzKmJY6e3hvAIEp1zglHNjzkgcQmZCcrkK9Czi2Y1WkjOwR/WgUTUWsGJAVqVvlRZuS3zk3nxMrLH6f7toyvuJc=", + }, } settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(request_data['get_data']['SAMLRequest'])) + request = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(request_data["get_data"]["SAMLRequest"])) settings.set_strict(False) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() self.assertEqual([], auth.get_errors()) - relay_state = request_data['get_data']['RelayState'] - del request_data['get_data']['RelayState'] + relay_state = request_data["get_data"]["RelayState"] + del request_data["get_data"]["RelayState"] auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_request_signature', auth.get_errors()) + self.assertIn("invalid_logout_request_signature", auth.get_errors()) - request_data['get_data']['RelayState'] = relay_state + request_data["get_data"]["RelayState"] = relay_state settings.set_strict(True) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_request', auth.get_errors()) + self.assertIn("invalid_logout_request", auth.get_errors()) settings.set_strict(False) - old_signature = request_data['get_data']['Signature'] - request_data['get_data']['Signature'] = 'vfWbbc47PkP3ejx4bjKsRX7lo9Ml1WRoE5J5owF/0mnyKHfSY6XbhO1wwjBV5vWdrUVX+xp6slHyAf4YoAsXFS0qhan6txDiZY4Oec6yE+l10iZbzvie06I4GPak4QrQ4gAyXOSzwCrRmJu4gnpeUxZ6IqKtdrKfAYRAcVf3333=' + old_signature = request_data["get_data"]["Signature"] + request_data["get_data"][ + "Signature" + ] = "vfWbbc47PkP3ejx4bjKsRX7lo9Ml1WRoE5J5owF/0mnyKHfSY6XbhO1wwjBV5vWdrUVX+xp6slHyAf4YoAsXFS0qhan6txDiZY4Oec6yE+l10iZbzvie06I4GPak4QrQ4gAyXOSzwCrRmJu4gnpeUxZ6IqKtdrKfAYRAcVf3333=" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_request_signature', auth.get_errors()) + self.assertIn("invalid_logout_request_signature", auth.get_errors()) - request_data['get_data']['Signature'] = old_signature - old_signature_algorithm = request_data['get_data']['SigAlg'] - del request_data['get_data']['SigAlg'] + request_data["get_data"]["Signature"] = old_signature + old_signature_algorithm = request_data["get_data"]["SigAlg"] + del request_data["get_data"]["SigAlg"] auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() self.assertEqual([], auth.get_errors()) settings.set_strict(True) - request_2 = request.replace('https://pitbulk.no-ip.org/newonelogin/demo1/index.php?sls', current_url) - request_2 = request_2.replace('https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php', 'http://idp.example.com/') - request_data['get_data']['SAMLRequest'] = OneLogin_Saml2_Utils.deflate_and_base64_encode(request_2) + request_2 = request.replace("https://pitbulk.no-ip.org/newonelogin/demo1/index.php?sls", current_url) + request_2 = request_2.replace("https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php", "http://idp.example.com/") + request_data["get_data"]["SAMLRequest"] = OneLogin_Saml2_Utils.deflate_and_base64_encode(request_2) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_request_signature', auth.get_errors()) + self.assertIn("invalid_logout_request_signature", auth.get_errors()) settings.set_strict(False) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_request_signature', auth.get_errors()) + self.assertIn("invalid_logout_request_signature", auth.get_errors()) - request_data['get_data']['SigAlg'] = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1' + request_data["get_data"]["SigAlg"] = "http://www.w3.org/2000/09/xmldsig#dsa-sha1" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('invalid_logout_request_signature', auth.get_errors()) + self.assertIn("invalid_logout_request_signature", auth.get_errors()) settings_info = self.loadSettingsJSON() - settings_info['strict'] = True - settings_info['security']['wantMessagesSigned'] = True + settings_info["strict"] = True + settings_info["security"]["wantMessagesSigned"] = True settings = OneLogin_Saml2_Settings(settings_info) - request_data['get_data']['SigAlg'] = old_signature_algorithm - old_signature = request_data['get_data']['Signature'] - del request_data['get_data']['Signature'] + request_data["get_data"]["SigAlg"] = old_signature_algorithm + old_signature = request_data["get_data"]["Signature"] + del request_data["get_data"]["Signature"] auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_slo() - self.assertIn('Signature validation failed. Logout Request rejected', auth.get_errors()) + self.assertIn("Signature validation failed. Logout Request rejected", auth.get_errors()) - request_data['get_data']['Signature'] = old_signature - settings_info['idp']['certFingerprint'] = 'afe71c28ef740bc87425be13a2263d37971da1f9' - del settings_info['idp']['x509cert'] + request_data["get_data"]["Signature"] = old_signature + settings_info["idp"]["certFingerprint"] = "afe71c28ef740bc87425be13a2263d37971da1f9" + del settings_info["idp"]["x509cert"] settings_2 = OneLogin_Saml2_Settings(settings_info) auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_2) auth.process_slo() - self.assertIn('Signature validation failed. Logout Request rejected', auth.get_errors()) + self.assertIn("Signature validation failed. Logout Request rejected", auth.get_errors()) + + def testIsInValidLogoutRequestSignatureRejectingDeprecatedAlgorithm(self): + """ + Tests the process_slo method of the OneLogin_Saml2_Auth + """ + request_data = { + "http_host": "example.com", + "script_name": "index.html", + "get_data": { + "SAMLRequest": "fZJNa+MwEIb/itHdiTz6sC0SQyEsBPoB27KHXoIsj7cGW3IlGfLzV7G7kN1DL2KYmeedmRcdgp7GWT26326JP/FzwRCz6zTaoNbKkSzeKqfDEJTVEwYVjXp9eHpUsKNq9i4640Zyh3xP6BDQx8FZkp1PR3KpqexAl72QmpUCS8SW01IiZz2TVVGD4X1VQYlAsl/oQyKPJAklPIQFzzZEbWNK0YLnlOVA3wqpQCoB7yQ7pWsGq+NKfcQ4q/0+xKXvd8ZNe7Td7AYbw10UxrCbP2aSPbv4Yl/8Qx/R3+SB5bTOoXiDQvFNvjnc7lXrIr75kh+6eYdXPc0jrkMO+/umjXhOtpxP2Q/nJx2/9+uWGbq8X1tV9NqGAW0kzaVvoe1AAJeCSWqYaUVRM2SilKKuqDTpFSlszdcK29RthVm9YriZebYdXpsLdhVAB7VJzif3haYMqqTVcl0JMBR4y+s2zak3sf/4v8l/vlHzBw==", + "RelayState": "_1037fbc88ec82ce8e770b2bed1119747bb812a07e6", + "SigAlg": "http://www.w3.org/2000/09/xmldsig#rsa-sha1", + "Signature": "Ouxo9BV6zmq4yrgamT9EbSKy/UmvSxGS8z26lIMgKOEP4LFR/N23RftdANmo4HafrzSfA0YTXwhKDqbOByS0j+Ql8OdQOes7vGioSjo5qq/Bi+5i6jXwQfphnfcHAQiJL4gYVIifkhhHRWpvYeiysF1Y9J02me0izwazFmoRXr4=", + }, + } + settings_info = self.loadSettingsJSON("settings8.json") + settings_info = self.loadSettingsJSON("settings8.json") + settings_info["security"]["rejectDeprecatedAlgorithm"] = True + settings = OneLogin_Saml2_Settings(settings_info) + auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) + auth.process_slo() + self.assertIn("Signature validation failed. Logout Request rejected", auth.get_errors()) + self.assertEqual("Deprecated signature algorithm found: http://www.w3.org/2000/09/xmldsig#rsa-sha1", auth.get_last_error_reason()) def testGetLastRequestID(self): settings_info = self.loadSettingsJSON() @@ -1303,138 +1321,139 @@ def testGetLastRequestID(self): def testGetLastSAMLResponse(self): settings = self.loadSettingsJSON() - message = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64')) - message_wrapper = {'post_data': {'SAMLResponse': message}} + message = self.file_contents(join(self.data_path, "responses", "signed_message_response.xml.base64")) + message_wrapper = {"post_data": {"SAMLResponse": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_response() - expected_message = self.file_contents(join(self.data_path, 'responses', 'pretty_signed_message_response.xml')) + expected_message = self.file_contents(join(self.data_path, "responses", "pretty_signed_message_response.xml")) self.assertEqual(auth.get_last_response_xml(True), expected_message) # with encrypted assertion - message = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) - message_wrapper = {'post_data': {'SAMLResponse': message}} + message = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) + message_wrapper = {"post_data": {"SAMLResponse": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_response() - decrypted_response = self.file_contents(join(self.data_path, 'responses', 'decrypted_valid_encrypted_assertion.xml')) + decrypted_response = self.file_contents(join(self.data_path, "responses", "decrypted_valid_encrypted_assertion.xml")) self.assertEqual(auth.get_last_response_xml(False), decrypted_response) - pretty_decrypted_response = self.file_contents(join(self.data_path, 'responses', 'pretty_decrypted_valid_encrypted_assertion.xml')) + pretty_decrypted_response = self.file_contents(join(self.data_path, "responses", "pretty_decrypted_valid_encrypted_assertion.xml")) self.assertEqual(auth.get_last_response_xml(True), pretty_decrypted_response) def testGetLastAuthnRequest(self): settings = self.loadSettingsJSON() - auth = OneLogin_Saml2_Auth({'http_host': 'localhost', 'script_name': 'thing'}, old_settings=settings) + auth = OneLogin_Saml2_Auth({"http_host": "localhost", "script_name": "thing"}, old_settings=settings) auth.login() expectedFragment = ( ' Destination="http://idp.example.com/SSOService.php"\n' ' ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"\n' ' AssertionConsumerServiceURL="http://stuff.com/endpoints/endpoints/acs.php">\n' - ' http://stuff.com/endpoints/metadata.php\n' - ' http://stuff.com/endpoints/metadata.php\n" + " \n' ' \n' - ' urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport\n' - ' \n' + " urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport\n" + " \n" ) self.assertIn(expectedFragment, auth.get_last_request_xml()) def testGetLastAuthnContexts(self): settings = self.loadSettingsJSON() request_data = self.get_request() - message = self.file_contents( - join(self.data_path, 'responses', 'valid_response.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() - self.assertEqual(auth.get_last_authn_contexts(), ['urn:oasis:names:tc:SAML:2.0:ac:classes:Password']) + self.assertEqual(auth.get_last_authn_contexts(), ["urn:oasis:names:tc:SAML:2.0:ac:classes:Password"]) def testGetLastLogoutRequest(self): settings = self.loadSettingsJSON() - auth = OneLogin_Saml2_Auth({'http_host': 'localhost', 'script_name': 'thing'}, old_settings=settings) + auth = OneLogin_Saml2_Auth({"http_host": "localhost", "script_name": "thing"}, old_settings=settings) auth.logout() expectedFragment = ( ' Destination="http://idp.example.com/SingleLogoutService.php">\n' - ' http://stuff.com/endpoints/metadata.php\n' + " http://stuff.com/endpoints/metadata.php\n" ' http://idp.example.com/\n' - ' \n' + " \n" ) self.assertIn(expectedFragment, auth.get_last_request_xml()) - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(request) - message_wrapper = {'get_data': {'SAMLRequest': message}} + message_wrapper = {"get_data": {"SAMLRequest": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_slo() self.assertEqual(request, auth.get_last_request_xml()) def testGetLastLogoutResponse(self): settings = self.loadSettingsJSON() - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(request) - message_wrapper = {'get_data': {'SAMLRequest': message}} + message_wrapper = {"get_data": {"SAMLRequest": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_slo() expectedFragment = ( ' Destination="http://idp.example.com/SingleLogoutService.php"\n' ' InResponseTo="ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e">\n' - ' http://stuff.com/endpoints/metadata.php\n' - ' \n' + " http://stuff.com/endpoints/metadata.php\n" + " \n" ' \n' - ' \n' - '' + " \n" + "" ) self.assertIn(expectedFragment, auth.get_last_response_xml()) - response = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response.xml')) + response = self.file_contents(join(self.data_path, "logout_responses", "logout_response.xml")) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(response) - message_wrapper = {'get_data': {'SAMLResponse': message}} + message_wrapper = {"get_data": {"SAMLResponse": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_slo() self.assertEqual(response, auth.get_last_response_xml()) def testGetInfoFromLastResponseReceived(self): """ - Tests the get_last_message_id, get_last_assertion_id and get_last_assertion_not_on_or_after + Tests the get_last_response_in_response_to, get_last_message_id, get_last_assertion_id, get_last_assertion_not_on_or_after and get_last_assertion_issue_instant of the OneLogin_Saml2_Auth class """ settings = self.loadSettingsJSON() request_data = self.get_request() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - del request_data['get_data'] - request_data['post_data'] = { - 'SAMLResponse': message - } + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + del request_data["get_data"] + request_data["post_data"] = {"SAMLResponse": message} auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() - self.assertEqual(auth.get_last_message_id(), 'pfx42be40bf-39c3-77f0-c6ae-8bf2e23a1a2e') - self.assertEqual(auth.get_last_assertion_id(), 'pfx57dfda60-b211-4cda-0f63-6d5deb69e5bb') + self.assertEqual(auth.get_last_response_in_response_to(), "ONELOGIN_5fe9d6e499b2f0913206aab3f7191729049bb807") + self.assertEqual(auth.get_last_message_id(), "pfx42be40bf-39c3-77f0-c6ae-8bf2e23a1a2e") + self.assertEqual(auth.get_last_assertion_id(), "pfx57dfda60-b211-4cda-0f63-6d5deb69e5bb") self.assertIsNone(auth.get_last_assertion_not_on_or_after()) + self.assertEqual(auth.get_last_assertion_issue_instant(), 1392773821) # NotOnOrAfter is only calculated with strict = true # If invalid, response id and assertion id are not obtained - settings['strict'] = True + settings["strict"] = True auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() self.assertNotEqual(len(auth.get_errors()), 0) + self.assertIsNone(auth.get_last_response_in_response_to()) self.assertIsNone(auth.get_last_message_id()) self.assertIsNone(auth.get_last_assertion_id()) self.assertIsNone(auth.get_last_assertion_not_on_or_after()) + self.assertIsNone(auth.get_last_assertion_issue_instant()) - request_data['https'] = 'on' - request_data['http_host'] = 'pitbulk.no-ip.org' - request_data['script_name'] = '/newonelogin/demo1/index.php?acs' + request_data["https"] = "on" + request_data["http_host"] = "pitbulk.no-ip.org" + request_data["script_name"] = "/newonelogin/demo1/index.php?acs" auth = OneLogin_Saml2_Auth(request_data, old_settings=settings) auth.process_response() self.assertEqual(len(auth.get_errors()), 0) - self.assertEqual(auth.get_last_message_id(), 'pfx42be40bf-39c3-77f0-c6ae-8bf2e23a1a2e') - self.assertEqual(auth.get_last_assertion_id(), 'pfx57dfda60-b211-4cda-0f63-6d5deb69e5bb') + self.assertEqual(auth.get_last_response_in_response_to(), "ONELOGIN_5fe9d6e499b2f0913206aab3f7191729049bb807") + self.assertEqual(auth.get_last_message_id(), "pfx42be40bf-39c3-77f0-c6ae-8bf2e23a1a2e") + self.assertEqual(auth.get_last_assertion_id(), "pfx57dfda60-b211-4cda-0f63-6d5deb69e5bb") self.assertEqual(auth.get_last_assertion_not_on_or_after(), 2671081021) + self.assertEqual(auth.get_last_assertion_issue_instant(), 1392773821) def testGetIdFromLogoutRequest(self): """ @@ -1442,12 +1461,12 @@ def testGetIdFromLogoutRequest(self): Case Valid Logout request """ settings = self.loadSettingsJSON() - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(request) - message_wrapper = {'get_data': {'SAMLRequest': message}} + message_wrapper = {"get_data": {"SAMLRequest": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_slo() - self.assertIn(auth.get_last_message_id(), 'ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e') + self.assertIn(auth.get_last_message_id(), "ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e") def testGetIdFromLogoutResponse(self): """ @@ -1455,9 +1474,9 @@ def testGetIdFromLogoutResponse(self): Case Valid Logout response """ settings = self.loadSettingsJSON() - response = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response.xml')) + response = self.file_contents(join(self.data_path, "logout_responses", "logout_response.xml")) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(response) - message_wrapper = {'get_data': {'SAMLResponse': message}} + message_wrapper = {"get_data": {"SAMLResponse": message}} auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings) auth.process_slo() - self.assertIn(auth.get_last_message_id(), '_f9ee61bd9dbf63606faa9ae3b10548d5b3656fb859') + self.assertIn(auth.get_last_message_id(), "_f9ee61bd9dbf63606faa9ae3b10548d5b3656fb859") diff --git a/tests/src/OneLogin/saml2_tests/authn_request_test.py b/tests/src/OneLogin/saml2_tests/authn_request_test.py index 3f1262f2..b3e187a5 100644 --- a/tests/src/OneLogin/saml2_tests/authn_request_test.py +++ b/tests/src/OneLogin/saml2_tests/authn_request_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json from os.path import dirname, join, exists @@ -22,24 +20,24 @@ class OneLogin_Saml2_Authn_Request_Test(unittest.TestCase): - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") # assertRegexpMatches deprecated on python3 def assertRegex(self, text, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRegex'): + if hasattr(unittest.TestCase, "assertRegex"): return super(OneLogin_Saml2_Authn_Request_Test, self).assertRegex(text, regexp, msg) else: return self.assertRegexpMatches(text, regexp, msg) - def loadSettingsJSON(self, name='settings1.json'): + def loadSettingsJSON(self, name="settings1.json"): filename = join(self.settings_path, name) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def setUp(self): self.__settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) @@ -52,26 +50,21 @@ def testCreateRequest(self): saml_settings = self.loadSettingsJSON() settings = OneLogin_Saml2_Settings(saml_settings) - settings._OneLogin_Saml2_Settings__organization = { - u'en-US': { - u'url': u'http://sp.example.com', - u'name': u'sp_test' - } - } + settings._organization = {"en-US": {"url": "http://sp.example.com", "name": "sp_test"}} authn_request = OneLogin_Saml2_Authn_Request(settings) authn_request_encoded = authn_request.get_request() inflated = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(authn_request_encoded)) - self.assertRegex(inflated, '^', inflated) + self.assertRegex(inflated, "^", inflated) - authn_request_2 = OneLogin_Saml2_Authn_Request(settings, name_id_value_req='testuser@example.com') + authn_request_2 = OneLogin_Saml2_Authn_Request(settings, name_id_value_req="testuser@example.com") authn_request_encoded_2 = authn_request_2.get_request() inflated_2 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(authn_request_encoded_2)) - self.assertRegex(inflated_2, '^', inflated_2) + self.assertRegex(inflated_2, "^", inflated_2) self.assertIn('Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">testuser@example.com', inflated_2) self.assertIn('', inflated_2) - saml_settings['sp']['NameIDFormat'] = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' + saml_settings["sp"]["NameIDFormat"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" settings = OneLogin_Saml2_Settings(saml_settings) - authn_request_3 = OneLogin_Saml2_Authn_Request(settings, name_id_value_req='testuser@example.com') + authn_request_3 = OneLogin_Saml2_Authn_Request(settings, name_id_value_req="testuser@example.com") authn_request_encoded_3 = authn_request_3.get_request() inflated_3 = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(authn_request_encoded_3)) - self.assertRegex(inflated_3, '^', inflated_3) + self.assertRegex(inflated_3, "^", inflated_3) self.assertIn('Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">testuser@example.com', inflated_3) self.assertIn('', inflated_3) @@ -294,16 +287,14 @@ def testCreateDeflatedSAMLRequestURLParameter(self): The creation of a deflated SAML Request """ authn_request = OneLogin_Saml2_Authn_Request(self.__settings) - parameters = { - 'SAMLRequest': authn_request.get_request() - } - auth_url = OneLogin_Saml2_Utils.redirect('http://idp.example.com/SSOService.php', parameters, True) - self.assertRegex(auth_url, r'^http://idp\.example\.com\/SSOService\.php\?SAMLRequest=') + parameters = {"SAMLRequest": authn_request.get_request()} + auth_url = OneLogin_Saml2_Utils.redirect("http://idp.example.com/SSOService.php", parameters, True) + self.assertRegex(auth_url, r"^http://idp\.example\.com\/SSOService\.php\?SAMLRequest=") exploded = urlparse(auth_url) exploded = parse_qs(exploded[4]) - payload = exploded['SAMLRequest'][0] + payload = exploded["SAMLRequest"][0] inflated = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(payload)) - self.assertRegex(inflated, '^') - self.assertRegex(inflated, 'http://stuff.com/endpoints/metadata.php') + self.assertRegex(inflated, "http://stuff.com/endpoints/metadata.php") self.assertRegex(inflated, 'Format="urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted"') self.assertRegex(inflated, 'ProviderName="SP prueba"') @@ -347,7 +330,7 @@ def testGetID(self): authn_request_encoded = authn_request.get_request() inflated = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(authn_request_encoded)) document = OneLogin_Saml2_XML.to_etree(inflated) - self.assertEqual(authn_request.get_id(), document.get('ID', None)) + self.assertEqual(authn_request.get_id(), document.get("ID", None)) def testAttributeConsumingService(self): """ @@ -362,7 +345,7 @@ def testAttributeConsumingService(self): self.assertNotIn('AttributeConsumingServiceIndex="1"', inflated) - saml_settings = self.loadSettingsJSON('settings4.json') + saml_settings = self.loadSettingsJSON("settings4.json") settings = OneLogin_Saml2_Settings(saml_settings) authn_request = OneLogin_Saml2_Authn_Request(settings) diff --git a/tests/src/OneLogin/saml2_tests/error_test.py b/tests/src/OneLogin/saml2_tests/error_test.py index cd7546b7..23ed4931 100644 --- a/tests/src/OneLogin/saml2_tests/error_test.py +++ b/tests/src/OneLogin/saml2_tests/error_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import unittest from onelogin.saml2.errors import OneLogin_Saml2_Error @@ -13,5 +11,5 @@ class OneLogin_Saml2_Error_Test(unittest.TestCase): """ def runTest(self): - exception = OneLogin_Saml2_Error('test') - self.assertEqual(str(exception), 'test') + exception = OneLogin_Saml2_Error("test") + self.assertEqual(str(exception), "test") diff --git a/tests/src/OneLogin/saml2_tests/idp_metadata_parser_test.py b/tests/src/OneLogin/saml2_tests/idp_metadata_parser_test.py index f4859244..4f352f69 100644 --- a/tests/src/OneLogin/saml2_tests/idp_metadata_parser_test.py +++ b/tests/src/OneLogin/saml2_tests/idp_metadata_parser_test.py @@ -1,12 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License -try: - from urllib.error import URLError -except ImportError: - from urllib2 import URLError +from urllib.error import URLError from copy import deepcopy import json @@ -24,21 +19,21 @@ class OneLogin_Saml2_IdPMetadataParser_Test(unittest.TestCase): # Set self.maxDiff to None to see it." from showing up. maxDiff = None - data_path = join(dirname(dirname(dirname(dirname(__file__)))), 'data') - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + data_path = join(dirname(dirname(dirname(dirname(__file__)))), "data") + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") - def loadSettingsJSON(self, filename='settings1.json'): + def loadSettingsJSON(self, filename="settings1.json"): filename = join(self.settings_path, filename) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -48,25 +43,32 @@ def testGetMetadata(self): Tests the get_metadata method of the OneLogin_Saml2_IdPMetadataParser """ with self.assertRaises(Exception): - data = OneLogin_Saml2_IdPMetadataParser.get_metadata('http://google.es') + data = OneLogin_Saml2_IdPMetadataParser.get_metadata("http://google.es", validate_cert=False) try: - data = OneLogin_Saml2_IdPMetadataParser.get_metadata('https://idp.testshib.org/idp/shibboleth') + data = OneLogin_Saml2_IdPMetadataParser.get_metadata("https://raw.githubusercontent.com/SAML-Toolkits/python3-saml/master/tests/data/metadata/testshib-providers.xml", validate_cert=False) self.assertTrue(data is not None and data is not {}) except URLError: pass + def testGetMetadataWithHeaders(self): + data = OneLogin_Saml2_IdPMetadataParser.get_metadata( + "https://raw.githubusercontent.com/SAML-Toolkits/python3-saml/master/tests/data/metadata/testshib-providers.xml", validate_cert=False, headers={"User-Agent": "Mozilla/5.0"} + ) + self.assertIsNotNone(data) + self.assertIn(b"entityID=", data) + def testParseRemote(self): """ Tests the parse_remote method of the OneLogin_Saml2_IdPMetadataParser """ with self.assertRaises(Exception): - data = OneLogin_Saml2_IdPMetadataParser.parse_remote('http://google.es') + data = OneLogin_Saml2_IdPMetadataParser.parse_remote("http://google.es", validate_cert=False) try: - data = OneLogin_Saml2_IdPMetadataParser.parse_remote('https://idp.testshib.org/idp/shibboleth') + data = OneLogin_Saml2_IdPMetadataParser.parse_remote("https://raw.githubusercontent.com/SAML-Toolkits/python3-saml/master/tests/data/metadata/testshib-providers.xml", validate_cert=False) except URLError: - xml = self.file_contents(join(self.data_path, 'metadata', 'testshib-providers.xml')) + xml = self.file_contents(join(self.data_path, "metadata", "testshib-providers.xml")) data = OneLogin_Saml2_IdPMetadataParser.parse(xml) self.assertTrue(data is not None and data is not {}) @@ -88,18 +90,27 @@ def testParseRemote(self): expected_settings = json.loads(expected_settings_json) self.assertEqual(expected_settings, data) + def testParseRemoteWithHeaders(self): + """ + Tests the parse_remote method passing headers of the OneLogin_Saml2_IdPMetadataParser + """ + data = OneLogin_Saml2_IdPMetadataParser.parse_remote("https://raw.githubusercontent.com/SAML-Toolkits/python3-saml/master/tests/data/metadata/testshib-providers.xml", validate_cert=False) + self.assertEqual(data["idp"]["entityId"], "https://idp.testshib.org/idp/shibboleth") + self.assertIsNotNone(data["idp"]["singleSignOnService"]["url"]) + self.assertIsNotNone(data["idp"]["x509cert"]) + def testParse(self): """ Tests the parse method of the OneLogin_Saml2_IdPMetadataParser """ with self.assertRaises(XMLSyntaxError): - data = OneLogin_Saml2_IdPMetadataParser.parse('') + data = OneLogin_Saml2_IdPMetadataParser.parse("") - xml_sp_metadata = self.file_contents(join(self.data_path, 'metadata', 'metadata_settings1.xml')) + xml_sp_metadata = self.file_contents(join(self.data_path, "metadata", "metadata_settings1.xml")) data = OneLogin_Saml2_IdPMetadataParser.parse(xml_sp_metadata) self.assertEqual({}, data) - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_metadata.xml")) data = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) # W/o further specification, expect to get the redirect binding SSO @@ -147,18 +158,14 @@ def test_parse_testshib_required_binding_sso_redirect(self): } """ try: - xmldoc = OneLogin_Saml2_IdPMetadataParser.get_metadata( - 'https://idp.testshib.org/idp/shibboleth') + xmldoc = OneLogin_Saml2_IdPMetadataParser.get_metadata("https://idp.testshib.org/idp/shibboleth") except URLError: - xmldoc = self.file_contents(join(self.data_path, 'metadata', 'testshib-providers.xml')) + xmldoc = self.file_contents(join(self.data_path, "metadata", "testshib-providers.xml")) # Parse, require SSO REDIRECT binding, implicitly. settings1 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc) # Parse, require SSO REDIRECT binding, explicitly. - settings2 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT - ) + settings2 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT) expected_settings = json.loads(expected_settings_json) self.assertEqual(expected_settings, settings1) self.assertEqual(expected_settings, settings2) @@ -185,16 +192,12 @@ def test_parse_testshib_required_binding_sso_post(self): } """ try: - xmldoc = OneLogin_Saml2_IdPMetadataParser.get_metadata( - 'https://idp.testshib.org/idp/shibboleth') + xmldoc = OneLogin_Saml2_IdPMetadataParser.get_metadata("https://idp.testshib.org/idp/shibboleth") except URLError: - xmldoc = self.file_contents(join(self.data_path, 'metadata', 'testshib-providers.xml')) + xmldoc = self.file_contents(join(self.data_path, "metadata", "testshib-providers.xml")) # Parse, require POST binding. - settings = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST - ) + settings = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST) expected_settings = json.loads(expected_settings_json) self.assertEqual(expected_settings, settings) @@ -225,7 +228,7 @@ def test_parse_required_binding_all(self): } } """ - xmldoc = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata2.xml')) + xmldoc = self.file_contents(join(self.data_path, "metadata", "idp_metadata2.xml")) expected_settings = json.loads(expected_settings_json) @@ -234,50 +237,30 @@ def test_parse_required_binding_all(self): # Parse, require SLO and SSO REDIRECT binding, explicitly. settings2 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, - required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT + xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT ) expected_settings1_2 = deepcopy(expected_settings) self.assertEqual(expected_settings1_2, settings1) self.assertEqual(expected_settings1_2, settings2) - settings3 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST, - required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST - ) + settings3 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST, required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST) expected_settings3 = deepcopy(expected_settings) - del expected_settings3['idp']['singleLogoutService'] - del expected_settings3['idp']['singleSignOnService'] + del expected_settings3["idp"]["singleLogoutService"] + del expected_settings3["idp"]["singleSignOnService"] self.assertEqual(expected_settings3, settings3) - settings4 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST, - required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT - ) - settings5 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST - ) + settings4 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST, required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT) + settings5 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST) expected_settings4_5 = deepcopy(expected_settings) - del expected_settings4_5['idp']['singleSignOnService'] + del expected_settings4_5["idp"]["singleSignOnService"] self.assertEqual(expected_settings4_5, settings4) self.assertEqual(expected_settings4_5, settings5) - settings6 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, - required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST - ) - settings7 = OneLogin_Saml2_IdPMetadataParser.parse( - xmldoc, - required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST - ) + settings6 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_sso_binding=OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT, required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST) + settings7 = OneLogin_Saml2_IdPMetadataParser.parse(xmldoc, required_slo_binding=OneLogin_Saml2_Constants.BINDING_HTTP_POST) expected_settings6_7 = deepcopy(expected_settings) - del expected_settings6_7['idp']['singleLogoutService'] + del expected_settings6_7["idp"]["singleLogoutService"] self.assertEqual(expected_settings6_7, settings6) self.assertEqual(expected_settings6_7, settings7) @@ -287,18 +270,42 @@ def test_parse_with_entity_id(self): Case: Provide entity_id to identify the desired IdPDescriptor from EntitiesDescriptor """ - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_multiple_descriptors.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_multiple_descriptors.xml")) # should find first descriptor data = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) self.assertEqual("https://foo.example.com/access/saml/idp.xml", data["idp"]["entityId"]) + expected_settings_json = """ + { + "security": {"authnRequestsSigned": true}, + "sp": { + "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" + }, + "idp": { + "singleLogoutService": { + "url": "https://hello.example.com/access/saml/logout", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + }, + "entityId": "https://foo.example.com/access/saml/idp.xml", + "x509cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psCmJtTmxjR2wwTG1OdmJURWxNQ01HQ1NxR1NJYjNEUUVKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnYKYlRDQm56QU5CZ2txaGtpRzl3MEJBUUVGQUFPQmpRQXdnWWtDZ1lFQXFq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T0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", + "singleSignOnService": { + "url": "https://hello.example.com/access/saml/login", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + } + } + } + """ + expected_settings = json.loads(expected_settings_json) + self.assertEqual(expected_settings, data) + # should find desired descriptor data2 = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata, entity_id="https://bar.example.com/access/saml/idp.xml") self.assertEqual("https://bar.example.com/access/saml/idp.xml", data2["idp"]["entityId"]) - expected_settings_json = """ + expected_settings_json2 = """ { + "security": {"authnRequestsSigned": false}, "sp": { "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" }, @@ -316,15 +323,15 @@ def test_parse_with_entity_id(self): } } """ - expected_settings = json.loads(expected_settings_json) - self.assertEqual(expected_settings, data2) + expected_settings2 = json.loads(expected_settings_json2) + self.assertEqual(expected_settings2, data2) def test_parse_multi_certs(self): """ Tests the parse method of the OneLogin_Saml2_IdPMetadataParser Case: IdP metadata contains multiple certs """ - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata_multi_certs.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_metadata_multi_certs.xml")) data = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) expected_settings_json = """ @@ -362,7 +369,7 @@ def test_parse_multi_singing_certs(self): Tests the parse method of the OneLogin_Saml2_IdPMetadataParser Case: IdP metadata contains multiple signing certs and no encryption certs """ - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata_multi_signing_certs.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_metadata_multi_signing_certs.xml")) data = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) expected_settings_json = """ @@ -399,7 +406,7 @@ def test_parse_multi_same_signing_and_encrypt_cert(self): Case: IdP metadata contains multiple signature cert and encrypt cert that is the same """ - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata_same_sign_and_encrypt_cert.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_metadata_same_sign_and_encrypt_cert.xml")) data = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) expected_settings_json = """ @@ -420,7 +427,7 @@ def test_parse_multi_same_signing_and_encrypt_cert(self): expected_settings = json.loads(expected_settings_json) self.assertEqual(expected_settings, data) - xml_idp_metadata_2 = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata_different_sign_and_encrypt_cert.xml')) + xml_idp_metadata_2 = self.file_contents(join(self.data_path, "metadata", "idp_metadata_different_sign_and_encrypt_cert.xml")) data_2 = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata_2) expected_settings_json_2 = """ { @@ -457,7 +464,7 @@ def test_merge_settings(self): with self.assertRaises(TypeError): settings_result = OneLogin_Saml2_IdPMetadataParser.merge_settings({}, None) - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_metadata.xml")) # Parse XML metadata. data = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) @@ -583,7 +590,7 @@ def test_merge_settings(self): self.assertEqual(expected_settings2, settings_result2) # Test merging multiple certs - xml_idp_metadata = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata_multi_certs.xml')) + xml_idp_metadata = self.file_contents(join(self.data_path, "metadata", "idp_metadata_multi_certs.xml")) data3 = OneLogin_Saml2_IdPMetadataParser.parse(xml_idp_metadata) settings_result3 = OneLogin_Saml2_IdPMetadataParser.merge_settings(settings, data3) expected_settings3_json = """ diff --git a/tests/src/OneLogin/saml2_tests/logout_request_test.py b/tests/src/OneLogin/saml2_tests/logout_request_test.py index d4c8ee6c..76994175 100644 --- a/tests/src/OneLogin/saml2_tests/logout_request_test.py +++ b/tests/src/OneLogin/saml2_tests/logout_request_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json from os.path import dirname, join, exists @@ -20,35 +18,35 @@ class OneLogin_Saml2_Logout_Request_Test(unittest.TestCase): - data_path = join(dirname(dirname(dirname(dirname(__file__)))), 'data') - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + data_path = join(dirname(dirname(dirname(dirname(__file__)))), "data") + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") # assertRegexpMatches deprecated on python3 def assertRegex(self, text, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRegex'): + if hasattr(unittest.TestCase, "assertRegex"): return super(OneLogin_Saml2_Logout_Request_Test, self).assertRegex(text, regexp, msg) else: return self.assertRegexpMatches(text, regexp, msg) # assertRaisesRegexp deprecated on python3 def assertRaisesRegex(self, exception, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRaisesRegex'): + if hasattr(unittest.TestCase, "assertRaisesRegex"): return super(OneLogin_Saml2_Logout_Request_Test, self).assertRaisesRegex(exception, regexp, msg=msg) else: return self.assertRaisesRegexp(exception, regexp) - def loadSettingsJSON(self, name='settings1.json'): + def loadSettingsJSON(self, name="settings1.json"): filename = join(self.settings_path, name) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -58,19 +56,19 @@ def testConstructor(self): Tests the OneLogin_Saml2_LogoutRequest Constructor. """ settings_info = self.loadSettingsJSON() - settings_info['security']['nameIdEncrypted'] = True + settings_info["security"]["nameIdEncrypted"] = True settings = OneLogin_Saml2_Settings(settings_info) logout_request = OneLogin_Saml2_Logout_Request(settings) - parameters = {'SAMLRequest': logout_request.get_request()} - logout_url = OneLogin_Saml2_Utils.redirect('http://idp.example.com/SingleLogoutService.php', parameters, True) - self.assertRegex(logout_url, r'^http://idp\.example\.com\/SingleLogoutService\.php\?SAMLRequest=') + parameters = {"SAMLRequest": logout_request.get_request()} + logout_url = OneLogin_Saml2_Utils.redirect("http://idp.example.com/SingleLogoutService.php", parameters, True) + self.assertRegex(logout_url, r"^http://idp\.example\.com\/SingleLogoutService\.php\?SAMLRequest=") url_parts = urlparse(logout_url) exploded = parse_qs(url_parts.query) - payload = exploded['SAMLRequest'][0] + payload = exploded["SAMLRequest"][0] inflated = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(payload)) - self.assertRegex(inflated, '^') + self.assertRegex(inflated, "^") def testGetIDFromSAMLLogoutRequest(self): """ Tests the get_id method of the OneLogin_Saml2_LogoutRequest """ - logout_request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + logout_request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) id1 = OneLogin_Saml2_Logout_Request.get_id(logout_request) - self.assertEqual('ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e', id1) + self.assertEqual("ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e", id1) dom = parseString(logout_request) id2 = OneLogin_Saml2_Logout_Request.get_id(dom.toxml()) - self.assertEqual('ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e', id2) + self.assertEqual("ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e", id2) def testGetIDFromDeflatedSAMLLogoutRequest(self): """ Tests the get_id method of the OneLogin_Saml2_LogoutRequest """ - deflated_logout_request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64')) + deflated_logout_request = self.file_contents(join(self.data_path, "logout_requests", "logout_request_deflated.xml.base64")) logout_request = OneLogin_Saml2_Utils.decode_base64_and_inflate(deflated_logout_request) id1 = OneLogin_Saml2_Logout_Request.get_id(logout_request) - self.assertEqual('ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e', id1) + self.assertEqual("ONELOGIN_21584ccdfaca36a145ae990442dcd96bfe60151e", id1) def testGetNameIdData(self): """ Tests the get_nameid_data method of the OneLogin_Saml2_LogoutRequest """ expected_name_id_data = { - 'Value': 'ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c', - 'Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', - 'SPNameQualifier': 'http://idp.example.com/' + "Value": "ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c", + "Format": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", + "SPNameQualifier": "http://idp.example.com/", } - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) name_id_data = OneLogin_Saml2_Logout_Request.get_nameid_data(request) self.assertEqual(expected_name_id_data, name_id_data) @@ -186,54 +179,48 @@ def testGetNameIdData(self): name_id_data_2 = OneLogin_Saml2_Logout_Request.get_nameid_data(dom.toxml()) self.assertEqual(expected_name_id_data, name_id_data_2) - request_2 = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_encrypted_nameid.xml')) - with self.assertRaisesRegex(Exception, 'Key is required in order to decrypt the NameID'): + request_2 = self.file_contents(join(self.data_path, "logout_requests", "logout_request_encrypted_nameid.xml")) + with self.assertRaisesRegex(Exception, "Key is required in order to decrypt the NameID"): OneLogin_Saml2_Logout_Request.get_nameid(request_2) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) key = settings.get_sp_key() name_id_data_4 = OneLogin_Saml2_Logout_Request.get_nameid_data(request_2, key) expected_name_id_data = { - 'Value': 'ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69', - 'Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress', - 'SPNameQualifier': 'https://pitbulk.no-ip.org/newonelogin/demo1/metadata.php' + "Value": "ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69", + "Format": "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress", + "SPNameQualifier": "https://pitbulk.no-ip.org/newonelogin/demo1/metadata.php", } self.assertEqual(expected_name_id_data, name_id_data_4) dom_2 = parseString(request_2) - encrypted_id_nodes = dom_2.getElementsByTagName('saml:EncryptedID') + encrypted_id_nodes = dom_2.getElementsByTagName("saml:EncryptedID") encrypted_data = encrypted_id_nodes[0].firstChild.nextSibling encrypted_id_nodes[0].removeChild(encrypted_data) - with self.assertRaisesRegex(Exception, 'NameID not found in the Logout Request'): + with self.assertRaisesRegex(Exception, "NameID not found in the Logout Request"): OneLogin_Saml2_Logout_Request.get_nameid(dom_2.toxml(), key) - inv_request = self.file_contents(join(self.data_path, 'logout_requests', 'invalids', 'no_nameId.xml')) - with self.assertRaisesRegex(Exception, 'NameID not found in the Logout Request'): + inv_request = self.file_contents(join(self.data_path, "logout_requests", "invalids", "no_nameId.xml")) + with self.assertRaisesRegex(Exception, "NameID not found in the Logout Request"): OneLogin_Saml2_Logout_Request.get_nameid(inv_request) idp_data = settings.get_idp_data() expected_name_id_data = { - 'Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress', - 'NameQualifier': idp_data['entityId'], - 'Value': 'ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69' + "Format": "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress", + "NameQualifier": idp_data["entityId"], + "Value": "ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69", } - logout_request = OneLogin_Saml2_Logout_Request(settings, None, expected_name_id_data['Value'], None, idp_data['entityId'], expected_name_id_data['Format']) + logout_request = OneLogin_Saml2_Logout_Request(settings, None, expected_name_id_data["Value"], None, idp_data["entityId"], expected_name_id_data["Format"]) name_id_data_3 = OneLogin_Saml2_Logout_Request.get_nameid_data(logout_request.get_xml()) self.assertEqual(expected_name_id_data, name_id_data_3) - expected_name_id_data = { - 'Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress', - 'Value': 'ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69' - } - logout_request = OneLogin_Saml2_Logout_Request(settings, None, expected_name_id_data['Value'], None, None, expected_name_id_data['Format']) + expected_name_id_data = {"Format": "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress", "Value": "ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69"} + logout_request = OneLogin_Saml2_Logout_Request(settings, None, expected_name_id_data["Value"], None, None, expected_name_id_data["Format"]) name_id_data_4 = OneLogin_Saml2_Logout_Request.get_nameid_data(logout_request.get_xml()) self.assertEqual(expected_name_id_data, name_id_data_4) - expected_name_id_data = { - 'Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity', - 'Value': 'http://idp.example.com/' - } + expected_name_id_data = {"Format": "urn:oasis:names:tc:SAML:2.0:nameid-format:entity", "Value": "http://idp.example.com/"} logout_request = OneLogin_Saml2_Logout_Request(settings) name_id_data_5 = OneLogin_Saml2_Logout_Request.get_nameid_data(logout_request.get_xml()) self.assertEqual(expected_name_id_data, name_id_data_5) @@ -242,33 +229,33 @@ def testGetNameId(self): """ Tests the get_nameid of the OneLogin_Saml2_LogoutRequest """ - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) name_id = OneLogin_Saml2_Logout_Request.get_nameid(request) - self.assertEqual(name_id, 'ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c') + self.assertEqual(name_id, "ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c") - request_2 = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_encrypted_nameid.xml')) - with self.assertRaisesRegex(Exception, 'Key is required in order to decrypt the NameID'): + request_2 = self.file_contents(join(self.data_path, "logout_requests", "logout_request_encrypted_nameid.xml")) + with self.assertRaisesRegex(Exception, "Key is required in order to decrypt the NameID"): OneLogin_Saml2_Logout_Request.get_nameid(request_2) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) key = settings.get_sp_key() name_id_3 = OneLogin_Saml2_Logout_Request.get_nameid(request_2, key) - self.assertEqual('ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69', name_id_3) + self.assertEqual("ONELOGIN_9c86c4542ab9d6fce07f2f7fd335287b9b3cdf69", name_id_3) def testGetIssuer(self): """ Tests the get_issuer of the OneLogin_Saml2_LogoutRequest """ - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) issuer = OneLogin_Saml2_Logout_Request.get_issuer(request) - self.assertEqual('http://idp.example.com/', issuer) + self.assertEqual("http://idp.example.com/", issuer) dom = parseString(request) issuer_2 = OneLogin_Saml2_Logout_Request.get_issuer(dom.toxml()) - self.assertEqual('http://idp.example.com/', issuer_2) + self.assertEqual("http://idp.example.com/", issuer_2) - issuer_node = dom.getElementsByTagName('saml:Issuer')[0] + issuer_node = dom.getElementsByTagName("saml:Issuer")[0] issuer_node.parentNode.removeChild(issuer_node) issuer_3 = OneLogin_Saml2_Logout_Request.get_issuer(dom.toxml()) self.assertIsNone(issuer_3) @@ -277,7 +264,7 @@ def testGetSessionIndexes(self): """ Tests the get_session_indexes of the OneLogin_Saml2_LogoutRequest """ - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) session_indexes = OneLogin_Saml2_Logout_Request.get_session_indexes(request) self.assertEqual(len(session_indexes), 0) @@ -286,19 +273,19 @@ def testGetSessionIndexes(self): session_indexes_2 = OneLogin_Saml2_Logout_Request.get_session_indexes(dom.toxml()) self.assertEqual(len(session_indexes_2), 0) - request_2 = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_with_sessionindex.xml')) + request_2 = self.file_contents(join(self.data_path, "logout_requests", "logout_request_with_sessionindex.xml")) session_indexes_3 = OneLogin_Saml2_Logout_Request.get_session_indexes(request_2) - self.assertEqual(['_ac72a76526cb6ca19f8438e73879a0e6c8ae5131'], session_indexes_3) + self.assertEqual(["_ac72a76526cb6ca19f8438e73879a0e6c8ae5131"], session_indexes_3) def testIsInvalidXML(self): """ Tests the is_valid method of the OneLogin_Saml2_LogoutRequest Case Invalid XML """ - request = OneLogin_Saml2_Utils.b64encode('invalid') + request = OneLogin_Saml2_Utils.b64encode("invalid") request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', + "http_host": "example.com", + "script_name": "index.html", } settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) @@ -315,20 +302,17 @@ def testIsInvalidIssuer(self): Tests the is_valid method of the OneLogin_Saml2_LogoutRequest Case Invalid Issuer """ - request = self.file_contents(join(self.data_path, 'logout_requests', 'invalids', 'invalid_issuer.xml')) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request = self.file_contents(join(self.data_path, "logout_requests", "invalids", "invalid_issuer.xml")) + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - request = request.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + request = request.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) self.assertTrue(logout_request.is_valid(request_data)) settings.set_strict(True) logout_request2 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) - with self.assertRaisesRegex(Exception, 'Invalid issuer in the Logout Request'): + with self.assertRaisesRegex(Exception, "Invalid issuer in the Logout Request"): logout_request2.is_valid(request_data, raise_exceptions=True) def testIsInvalidDestination(self): @@ -336,26 +320,23 @@ def testIsInvalidDestination(self): Tests the is_valid method of the OneLogin_Saml2_LogoutRequest Case Invalid Destination """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request_data = {"http_host": "example.com", "script_name": "index.html"} + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) self.assertTrue(logout_request.is_valid(request_data)) settings.set_strict(True) logout_request2 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) - with self.assertRaisesRegex(Exception, 'The LogoutRequest was received at'): + with self.assertRaisesRegex(Exception, "The LogoutRequest was received at"): logout_request2.is_valid(request_data, raise_exceptions=True) dom = parseString(request) - dom.documentElement.setAttribute('Destination', None) + dom.documentElement.setAttribute("Destination", None) logout_request3 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(dom.toxml())) self.assertTrue(logout_request3.is_valid(request_data)) - dom.documentElement.removeAttribute('Destination') + dom.documentElement.removeAttribute("Destination") logout_request4 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(dom.toxml())) self.assertTrue(logout_request4.is_valid(request_data)) @@ -364,13 +345,10 @@ def testIsInvalidNotOnOrAfter(self): Tests the is_valid method of the OneLogin_Saml2_LogoutRequest Case Invalid NotOnOrAfter """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } - request = self.file_contents(join(self.data_path, 'logout_requests', 'invalids', 'not_after_failed.xml')) + request_data = {"http_host": "example.com", "script_name": "index.html"} + request = self.file_contents(join(self.data_path, "logout_requests", "invalids", "not_after_failed.xml")) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - request = request.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + request = request.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) @@ -378,18 +356,15 @@ def testIsInvalidNotOnOrAfter(self): settings.set_strict(True) logout_request2 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) - with self.assertRaisesRegex(Exception, 'Could not validate timestamp: expired. Check system clock.'): + with self.assertRaisesRegex(Exception, "Could not validate timestamp: expired. Check system clock."): logout_request2.is_valid(request_data, raise_exceptions=True) def testIsValid(self): """ Tests the is_valid method of the OneLogin_Saml2_LogoutRequest """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request_data = {"http_host": "example.com", "script_name": "index.html"} + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) @@ -409,19 +384,74 @@ def testIsValid(self): self.assertFalse(logout_request4.is_valid(request_data)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - request = request.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + request = request.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) logout_request5 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) self.assertTrue(logout_request5.is_valid(request_data)) + def testIsValidWithCapitalization(self): + """ + Tests the is_valid method of the OneLogin_Saml2_LogoutRequest + """ + request_data = {"http_host": "exaMPLe.com", "script_name": "index.html"} + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + + logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) + self.assertTrue(logout_request.is_valid(request_data)) + + settings.set_strict(True) + logout_request2 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) + self.assertFalse(logout_request2.is_valid(request_data)) + + settings.set_strict(False) + dom = parseString(request) + logout_request3 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(dom.toxml())) + self.assertTrue(logout_request3.is_valid(request_data)) + + settings.set_strict(True) + logout_request4 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(dom.toxml())) + self.assertFalse(logout_request4.is_valid(request_data)) + + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) + request = request.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url.lower()) + logout_request5 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) + self.assertTrue(logout_request5.is_valid(request_data)) + + def testIsInValidWithCapitalization(self): + """ + Tests the is_valid method of the OneLogin_Saml2_LogoutRequest + """ + request_data = {"http_host": "example.com", "script_name": "INdex.html"} + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + + logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) + self.assertTrue(logout_request.is_valid(request_data)) + + settings.set_strict(True) + logout_request2 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) + self.assertFalse(logout_request2.is_valid(request_data)) + + settings.set_strict(False) + dom = parseString(request) + logout_request3 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(dom.toxml())) + self.assertTrue(logout_request3.is_valid(request_data)) + + settings.set_strict(True) + logout_request4 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(dom.toxml())) + self.assertFalse(logout_request4.is_valid(request_data)) + + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) + request = request.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url.lower()) + logout_request5 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) + self.assertFalse(logout_request5.is_valid(request_data)) + def testIsValidWithXMLEncoding(self): """ Tests the is_valid method of the OneLogin_Saml2_LogoutRequest """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_with_encoding.xml')) + request_data = {"http_host": "example.com", "script_name": "index.html"} + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request_with_encoding.xml")) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_request = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) @@ -441,15 +471,15 @@ def testIsValidWithXMLEncoding(self): self.assertFalse(logout_request4.is_valid(request_data)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - request = request.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + request = request.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) logout_request5 = OneLogin_Saml2_Logout_Request(settings, OneLogin_Saml2_Utils.b64encode(request)) self.assertTrue(logout_request5.is_valid(request_data)) def testIsValidRaisesExceptionWhenRaisesArgumentIsTrue(self): - request = OneLogin_Saml2_Utils.b64encode('invalid') + request = OneLogin_Saml2_Utils.b64encode("invalid") request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', + "http_host": "example.com", + "script_name": "index.html", } settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) settings.set_strict(True) @@ -466,15 +496,15 @@ def testGetXML(self): Tests that we can get the logout request XML directly without going through intermediate steps """ - request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml')) + request = self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml")) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_request_generated = OneLogin_Saml2_Logout_Request(settings) expectedFragment = ( 'Destination="http://idp.example.com/SingleLogoutService.php">\n' - ' http://stuff.com/endpoints/metadata.php\n' + " http://stuff.com/endpoints/metadata.php\n" ' http://idp.example.com/\n' - ' \n' + " \n" ) self.assertIn(expectedFragment, logout_request_generated.get_xml()) diff --git a/tests/src/OneLogin/saml2_tests/logout_response_test.py b/tests/src/OneLogin/saml2_tests/logout_response_test.py index 054e9762..45b8c6ed 100644 --- a/tests/src/OneLogin/saml2_tests/logout_response_test.py +++ b/tests/src/OneLogin/saml2_tests/logout_response_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json from os.path import dirname, join, exists @@ -22,35 +20,35 @@ class OneLogin_Saml2_Logout_Response_Test(unittest.TestCase): - data_path = join(dirname(dirname(dirname(dirname(__file__)))), 'data') - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + data_path = join(dirname(dirname(dirname(dirname(__file__)))), "data") + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") # assertRegexpMatches deprecated on python3 def assertRegex(self, text, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRegex'): + if hasattr(unittest.TestCase, "assertRegex"): return super(OneLogin_Saml2_Logout_Response_Test, self).assertRegex(text, regexp, msg) else: return self.assertRegexpMatches(text, regexp, msg) # assertRaisesRegexp deprecated on python3 def assertRaisesRegex(self, exception, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRaisesRegex'): + if hasattr(unittest.TestCase, "assertRaisesRegex"): return super(OneLogin_Saml2_Logout_Response_Test, self).assertRaisesRegex(exception, regexp, msg=msg) else: return self.assertRaisesRegexp(exception, regexp) - def loadSettingsJSON(self, name='settings1.json'): + def loadSettingsJSON(self, name="settings1.json"): filename = join(self.settings_path, name) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -60,9 +58,9 @@ def testConstructor(self): Tests the OneLogin_Saml2_LogoutResponse Constructor. """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) response = OneLogin_Saml2_Logout_Response(settings, message) - self.assertRegex(compat.to_string(OneLogin_Saml2_XML.to_string(response.document)), 'invalid') - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + message = OneLogin_Saml2_Utils.deflate_and_base64_encode("invalid") + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) response = OneLogin_Saml2_Logout_Response(settings, message) @@ -157,20 +151,16 @@ def testIsInValidRequestId(self): Tests the is_valid method of the OneLogin_Saml2_LogoutResponse Case invalid request Id """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) - request_id = 'invalid_request_id' + request_id = "invalid_request_id" settings.set_strict(False) response = OneLogin_Saml2_Logout_Response(settings, message) @@ -179,8 +169,8 @@ def testIsInValidRequestId(self): settings.set_strict(True) response_2 = OneLogin_Saml2_Logout_Response(settings, message) self.assertFalse(response_2.is_valid(request_data, request_id)) - self.assertIn('The InResponseTo of the Logout Response:', response_2.get_error()) - with self.assertRaisesRegex(Exception, 'The InResponseTo of the Logout Response:'): + self.assertIn("The InResponseTo of the Logout Response:", response_2.get_error()) + with self.assertRaisesRegex(Exception, "The InResponseTo of the Logout Response:"): response_2.is_valid(request_data, request_id, raise_exceptions=True) def testIsInValidIssuer(self): @@ -188,18 +178,14 @@ def testIsInValidIssuer(self): Tests the is_valid method of the OneLogin_Saml2_LogoutResponse Case invalid Issuer """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) - plain_message = plain_message.replace('http://idp.example.com/', 'http://invalid.issuer.example.com') + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) + plain_message = plain_message.replace("http://idp.example.com/", "http://invalid.issuer.example.com") message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) settings.set_strict(False) @@ -208,7 +194,7 @@ def testIsInValidIssuer(self): settings.set_strict(True) response_2 = OneLogin_Saml2_Logout_Response(settings, message) - with self.assertRaisesRegex(Exception, 'Invalid issuer in the Logout Response'): + with self.assertRaisesRegex(Exception, "Invalid issuer in the Logout Response"): response_2.is_valid(request_data, raise_exceptions=True) def testIsInValidDestination(self): @@ -216,13 +202,9 @@ def testIsInValidDestination(self): Tests the is_valid method of the OneLogin_Saml2_LogoutResponse Case invalid Destination """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) settings.set_strict(False) response = OneLogin_Saml2_Logout_Response(settings, message) @@ -230,19 +212,19 @@ def testIsInValidDestination(self): settings.set_strict(True) response_2 = OneLogin_Saml2_Logout_Response(settings, message) - with self.assertRaisesRegex(Exception, 'The LogoutResponse was received at'): + with self.assertRaisesRegex(Exception, "The LogoutResponse was received at"): response_2.is_valid(request_data, raise_exceptions=True) # Empty destination dom = parseString(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) - dom.firstChild.setAttribute('Destination', '') + dom.firstChild.setAttribute("Destination", "") xml = dom.toxml() message_3 = OneLogin_Saml2_Utils.deflate_and_base64_encode(xml) response_3 = OneLogin_Saml2_Logout_Response(settings, message_3) self.assertTrue(response_3.is_valid(request_data)) # No destination - dom.firstChild.removeAttribute('Destination') + dom.firstChild.removeAttribute("Destination") xml = dom.toxml() message_4 = OneLogin_Saml2_Utils.deflate_and_base64_encode(xml) response_4 = OneLogin_Saml2_Logout_Response(settings, message_4) @@ -252,65 +234,102 @@ def testIsValid(self): """ Tests the is_valid method of the OneLogin_Saml2_LogoutResponse """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) response = OneLogin_Saml2_Logout_Response(settings, message) self.assertTrue(response.is_valid(request_data)) settings.set_strict(True) response_2 = OneLogin_Saml2_Logout_Response(settings, message) - with self.assertRaisesRegex(Exception, 'The LogoutResponse was received at'): + with self.assertRaisesRegex(Exception, "The LogoutResponse was received at"): response_2.is_valid(request_data, raise_exceptions=True) plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message_3 = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) response_3 = OneLogin_Saml2_Logout_Response(settings, message_3) self.assertTrue(response_3.is_valid(request_data)) + def testIsValidWithCapitalization(self): + """ + Tests the is_valid method of the OneLogin_Saml2_LogoutResponse + """ + request_data = {"http_host": "exaMPLe.com", "script_name": "index.html", "get_data": {}} + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) + + response = OneLogin_Saml2_Logout_Response(settings, message) + self.assertTrue(response.is_valid(request_data)) + + settings.set_strict(True) + response_2 = OneLogin_Saml2_Logout_Response(settings, message) + with self.assertRaisesRegex(Exception, "The LogoutResponse was received at"): + response_2.is_valid(request_data, raise_exceptions=True) + + plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) + + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data).lower() + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) + message_3 = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) + + response_3 = OneLogin_Saml2_Logout_Response(settings, message_3) + self.assertTrue(response_3.is_valid(request_data)) + + def testIsInValidWithCapitalization(self): + """ + Tests the is_valid method of the OneLogin_Saml2_LogoutResponse + """ + request_data = {"http_host": "example.com", "script_name": "INdex.html", "get_data": {}} + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_deflated.xml.base64")) + + response = OneLogin_Saml2_Logout_Response(settings, message) + self.assertTrue(response.is_valid(request_data)) + + settings.set_strict(True) + response_2 = OneLogin_Saml2_Logout_Response(settings, message) + with self.assertRaisesRegex(Exception, "The LogoutResponse was received at"): + response_2.is_valid(request_data, raise_exceptions=True) + + plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) + current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data).lower() + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) + message_3 = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) + + response_3 = OneLogin_Saml2_Logout_Response(settings, message_3) + self.assertFalse(response_3.is_valid(request_data)) + def testIsValidWithXMLEncoding(self): """ Tests the is_valid method of the OneLogin_Saml2_LogoutResponse """ - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_with_encoding_deflated.xml.base64')) + message = self.file_contents(join(self.data_path, "logout_responses", "logout_response_with_encoding_deflated.xml.base64")) response = OneLogin_Saml2_Logout_Response(settings, message) self.assertTrue(response.is_valid(request_data)) settings.set_strict(True) response_2 = OneLogin_Saml2_Logout_Response(settings, message) - with self.assertRaisesRegex(Exception, 'The LogoutResponse was received at'): + with self.assertRaisesRegex(Exception, "The LogoutResponse was received at"): response_2.is_valid(request_data, raise_exceptions=True) plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message)) current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/sls.php", current_url) message_3 = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message) response_3 = OneLogin_Saml2_Logout_Response(settings, message_3) self.assertTrue(response_3.is_valid(request_data)) def testIsValidRaisesExceptionWhenRaisesArgumentIsTrue(self): - message = OneLogin_Saml2_Utils.deflate_and_base64_encode('invalid') - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + message = OneLogin_Saml2_Utils.deflate_and_base64_encode("invalid") + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) settings.set_strict(True) @@ -326,7 +345,7 @@ def testGetXML(self): Tests that we can get the logout response XML directly without going through intermediate steps """ - response = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response.xml')) + response = self.file_contents(join(self.data_path, "logout_responses", "logout_response.xml")) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) logout_response_generated = OneLogin_Saml2_Logout_Response(settings) @@ -334,13 +353,29 @@ def testGetXML(self): expectedFragment = ( 'Destination="http://idp.example.com/SingleLogoutService.php"\n' ' InResponseTo="InResponseValue">\n' - ' http://stuff.com/endpoints/metadata.php\n' - ' \n' + " http://stuff.com/endpoints/metadata.php\n" + " \n" ' \n' - ' \n' - '' + " \n" + "" ) self.assertIn(expectedFragment, logout_response_generated.get_xml()) logout_response_processed = OneLogin_Saml2_Logout_Response(settings, OneLogin_Saml2_Utils.deflate_and_base64_encode(response)) self.assertEqual(response, logout_response_processed.get_xml()) + + def testBuildWithStatus(self): + """ + Tests the build method when called specifying a non-default status for the LogoutResponse. + """ + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + + response_builder = OneLogin_Saml2_Logout_Response(settings) + response_builder.build("InResponseValue", status=OneLogin_Saml2_Constants.STATUS_REQUESTER) + generated_encoded_response = response_builder.get_response() + + # Parse and verify the status of the response, as the receiver will do: + parsed_response = OneLogin_Saml2_Logout_Response(settings, generated_encoded_response) + expectedFragment = " \n" ' \n' " \n" + self.assertIn(expectedFragment, parsed_response.get_xml()) + self.assertEqual(parsed_response.get_status(), OneLogin_Saml2_Constants.STATUS_REQUESTER) diff --git a/tests/src/OneLogin/saml2_tests/metadata_test.py b/tests/src/OneLogin/saml2_tests/metadata_test.py index 58afb5b9..71468542 100644 --- a/tests/src/OneLogin/saml2_tests/metadata_test.py +++ b/tests/src/OneLogin/saml2_tests/metadata_test.py @@ -1,12 +1,10 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json from os.path import dirname, join, exists from time import strftime -from datetime import datetime +from datetime import datetime, timezone import unittest from onelogin.saml2 import compat @@ -18,18 +16,18 @@ class OneLogin_Saml2_Metadata_Test(unittest.TestCase): - def loadSettingsJSON(self, filename='settings1.json'): - filename = join(dirname(__file__), '..', '..', '..', 'settings', filename) + def loadSettingsJSON(self, filename="settings1.json"): + filename = join(dirname(__file__), "..", "..", "..", "settings", filename) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -44,15 +42,11 @@ def testBuilder(self): organization = settings.get_organization() contacts = settings.get_contacts() - metadata = OneLogin_Saml2_Metadata.builder( - sp_data, security['authnRequestsSigned'], - security['wantAssertionsSigned'], None, None, contacts, - organization - ) + metadata = OneLogin_Saml2_Metadata.builder(sp_data, security["authnRequestsSigned"], security["wantAssertionsSigned"], None, None, contacts, organization) self.assertIsNotNone(metadata) - self.assertIn('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', metadata) + self.assertIn("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", metadata) self.assertIn('sp_test', metadata) self.assertIn('', metadata) - self.assertIn('technical_name', metadata) + self.assertIn("technical_name", metadata) - security['authnRequestsSigned'] = True - security['wantAssertionsSigned'] = True - del sp_data['singleLogoutService']['url'] + security["authnRequestsSigned"] = True + security["wantAssertionsSigned"] = True + del sp_data["singleLogoutService"]["url"] - metadata2 = OneLogin_Saml2_Metadata.builder( - sp_data, security['authnRequestsSigned'], - security['wantAssertionsSigned'] - ) + metadata2 = OneLogin_Saml2_Metadata.builder(sp_data, security["authnRequestsSigned"], security["wantAssertionsSigned"]) self.assertIsNotNone(metadata2) - self.assertIn('', metadata2) - metadata3 = OneLogin_Saml2_Metadata.builder( - sp_data, security['authnRequestsSigned'], - security['wantAssertionsSigned'], - '2014-10-01T11:04:29Z', - 'P1Y', - contacts, - organization - ) + metadata3 = OneLogin_Saml2_Metadata.builder(sp_data, security["authnRequestsSigned"], security["wantAssertionsSigned"], "2014-10-01T11:04:29Z", "P1Y", contacts, organization) self.assertIsNotNone(metadata3) - self.assertIn(' + metadata = OneLogin_Saml2_Metadata.builder(sp_data, security["authnRequestsSigned"], security["wantAssertionsSigned"], None, None, contacts, organization) + self.assertIn( + """ Test Service Test Service @@ -162,21 +122,20 @@ def testBuilderAttributeConsumingService(self): - """, metadata) + """, + metadata, + ) def testBuilderAttributeConsumingServiceWithMultipleAttributeValue(self): - settings = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings5.json')) + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings5.json")) sp_data = settings.get_sp_data() security = settings.get_security_data() organization = settings.get_organization() contacts = settings.get_contacts() - metadata = OneLogin_Saml2_Metadata.builder( - sp_data, security['authnRequestsSigned'], - security['wantAssertionsSigned'], None, None, contacts, - organization - ) - self.assertIn(""" + metadata = OneLogin_Saml2_Metadata.builder(sp_data, security["authnRequestsSigned"], security["wantAssertionsSigned"], None, None, contacts, organization) + self.assertIn( + """ Test Service Test Service @@ -184,7 +143,9 @@ def testBuilderAttributeConsumingServiceWithMultipleAttributeValue(self): admin - """, metadata) + """, + metadata, + ) def testSignMetadata(self): """ @@ -194,21 +155,18 @@ def testSignMetadata(self): sp_data = settings.get_sp_data() security = settings.get_security_data() - metadata = OneLogin_Saml2_Metadata.builder( - sp_data, security['authnRequestsSigned'], - security['wantAssertionsSigned'] - ) + metadata = OneLogin_Saml2_Metadata.builder(sp_data, security["authnRequestsSigned"], security["wantAssertionsSigned"]) self.assertIsNotNone(metadata) cert_path = settings.get_cert_path() - key = self.file_contents(join(cert_path, 'sp.key')) - cert = self.file_contents(join(cert_path, 'sp.crt')) + key = self.file_contents(join(cert_path, "sp.key")) + cert = self.file_contents(join(cert_path, "sp.crt")) signed_metadata = compat.to_string(OneLogin_Saml2_Metadata.sign_metadata(metadata, key, cert)) self.assertTrue(OneLogin_Saml2_Utils.validate_metadata_sign(signed_metadata, cert)) - self.assertIn('', signed_metadata) - self.assertIn('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', signed_metadata) + self.assertIn("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", signed_metadata) self.assertIn('\n', signed_metadata) - self.assertIn('', signed_metadata) - self.assertIn('', signed_metadata) - self.assertIn('\n\n', signed_metadata) + self.assertIn('', signed_metadata) + self.assertIn('', signed_metadata) + self.assertIn("\n\n", signed_metadata) with self.assertRaises(Exception) as context: - OneLogin_Saml2_Metadata.sign_metadata('', key, cert) + OneLogin_Saml2_Metadata.sign_metadata("", key, cert) exception = context.exception self.assertIn("Empty string supplied as input", str(exception)) signed_metadata_2 = compat.to_string(OneLogin_Saml2_Metadata.sign_metadata(metadata, key, cert, OneLogin_Saml2_Constants.RSA_SHA256, OneLogin_Saml2_Constants.SHA384)) self.assertTrue(OneLogin_Saml2_Utils.validate_metadata_sign(signed_metadata_2, cert)) - self.assertIn('', signed_metadata_2) - self.assertIn('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', signed_metadata_2) + self.assertIn("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", signed_metadata_2) self.assertIn('\n', signed_metadata_2) self.assertIn('', signed_metadata_2) self.assertIn('', signed_metadata_2) - self.assertIn('\n\n', signed_metadata_2) + self.assertIn("\n\n", signed_metadata_2) root = OneLogin_Saml2_XML.to_etree(signed_metadata_2) - first_child = OneLogin_Saml2_XML.query(root, '/md:EntityDescriptor/*[1]')[0] - self.assertEqual('{http://www.w3.org/2000/09/xmldsig#}Signature', first_child.tag) + first_child = OneLogin_Saml2_XML.query(root, "/md:EntityDescriptor/*[1]")[0] + self.assertEqual("{http://www.w3.org/2000/09/xmldsig#}Signature", first_child.tag) def testAddX509KeyDescriptors(self): """ @@ -273,24 +231,24 @@ def testAddX509KeyDescriptors(self): self.assertNotIn(' something_is_wrong'): + with self.assertRaisesRegex(Exception, "The status code of the Response was not Success, was Responder -> something_is_wrong"): response_3.check_status() def testCheckOneCondition(self): @@ -530,7 +527,7 @@ def testCheckOneCondition(self): Tests the check_one_condition method of SamlResponse """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_conditions.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_conditions.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.check_one_condition()) @@ -538,9 +535,9 @@ def testCheckOneCondition(self): settings.set_strict(True) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.is_valid(self.get_request_data())) - self.assertEqual('The Assertion must include a Conditions element', response.get_error()) + self.assertEqual("The Assertion must include a Conditions element", response.get_error()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertTrue(response_2.check_one_condition()) @@ -549,7 +546,7 @@ def testCheckOneAuthnStatement(self): Tests the check_one_authnstatement method of SamlResponse """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_authnstatement.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_authnstatement.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.check_one_authnstatement()) @@ -557,9 +554,9 @@ def testCheckOneAuthnStatement(self): settings.set_strict(True) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.is_valid(self.get_request_data())) - self.assertEqual('The Assertion must include an AuthnStatement element', response.get_error()) + self.assertEqual("The Assertion must include an AuthnStatement element", response.get_error()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertTrue(response_2.check_one_authnstatement()) @@ -568,17 +565,17 @@ def testGetAudiences(self): Tests the get_audiences method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'no_audience.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "no_audience.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertEqual([], response.get_audiences()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) - self.assertEqual(['{audience}'], response_2.get_audiences()) + self.assertEqual(["{audience}"], response_2.get_audiences()) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) - self.assertEqual(['http://stuff.com/endpoints/metadata.php'], response_3.get_audiences()) + self.assertEqual(["http://stuff.com/endpoints/metadata.php"], response_3.get_audiences()) def testQueryAssertions(self): """ @@ -586,59 +583,59 @@ def testQueryAssertions(self): OneLogin_Saml2_Response using the get_issuers call """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'adfs_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "adfs_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - self.assertEqual(['http://login.example.com/issuer'], response.get_issuers()) + self.assertEqual(["http://login.example.com/issuer"], response.get_issuers()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) - self.assertEqual(['http://idp.example.com/'], response_2.get_issuers()) + self.assertEqual(["http://idp.example.com/"], response_2.get_issuers()) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'double_signed_encrypted_assertion.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "double_signed_encrypted_assertion.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) - self.assertEqual(['http://idp.example.com/', 'https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php'], sorted(response_3.get_issuers())) + self.assertEqual(["http://idp.example.com/", "https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php"], sorted(response_3.get_issuers())) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'double_signed_response.xml.base64')) + xml_4 = self.file_contents(join(self.data_path, "responses", "double_signed_response.xml.base64")) response_4 = OneLogin_Saml2_Response(settings, xml_4) - self.assertEqual(['https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php'], response_4.get_issuers()) + self.assertEqual(["https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php"], response_4.get_issuers()) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "signed_message_encrypted_assertion.xml.base64")) response_5 = OneLogin_Saml2_Response(settings, xml_5) - self.assertEqual(['http://idp.example.com/', 'https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php'], sorted(response_5.get_issuers())) + self.assertEqual(["http://idp.example.com/", "https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php"], sorted(response_5.get_issuers())) - xml_6 = self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response.xml.base64')) + xml_6 = self.file_contents(join(self.data_path, "responses", "signed_assertion_response.xml.base64")) response_6 = OneLogin_Saml2_Response(settings, xml_6) - self.assertEqual(['https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php'], response_6.get_issuers()) + self.assertEqual(["https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php"], response_6.get_issuers()) - xml_7 = self.file_contents(join(self.data_path, 'responses', 'signed_encrypted_assertion.xml.base64')) + xml_7 = self.file_contents(join(self.data_path, "responses", "signed_encrypted_assertion.xml.base64")) response_7 = OneLogin_Saml2_Response(settings, xml_7) - self.assertEqual(['http://idp.example.com/'], response_7.get_issuers()) + self.assertEqual(["http://idp.example.com/"], response_7.get_issuers()) def testGetIssuers(self): """ Tests the get_issuers method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'adfs_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "adfs_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - self.assertEqual(['http://login.example.com/issuer'], response.get_issuers()) + self.assertEqual(["http://login.example.com/issuer"], response.get_issuers()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) - self.assertEqual(['http://idp.example.com/'], response_2.get_issuers()) + self.assertEqual(["http://idp.example.com/"], response_2.get_issuers()) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'double_signed_encrypted_assertion.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "double_signed_encrypted_assertion.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) - self.assertEqual(['http://idp.example.com/', 'https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php'], sorted(response_3.get_issuers())) + self.assertEqual(["http://idp.example.com/", "https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php"], sorted(response_3.get_issuers())) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_issuer_response.xml.base64')) + xml_4 = self.file_contents(join(self.data_path, "responses", "invalids", "no_issuer_response.xml.base64")) response_4 = OneLogin_Saml2_Response(settings, xml_4) response_4.get_issuers() - self.assertEqual(['https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php'], response_4.get_issuers()) + self.assertEqual(["https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php"], response_4.get_issuers()) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_issuer_assertion.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "invalids", "no_issuer_assertion.xml.base64")) response_5 = OneLogin_Saml2_Response(settings, xml_5) - with self.assertRaisesRegex(Exception, 'Issuer of the Assertion not found or multiple.'): + with self.assertRaisesRegex(Exception, "Issuer of the Assertion not found or multiple."): response_5.get_issuers() def testGetSessionIndex(self): @@ -646,70 +643,129 @@ def testGetSessionIndex(self): Tests the get_session_index method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - self.assertEqual('_531c32d283bdff7e04e487bcdbc4dd8d', response.get_session_index()) + self.assertEqual("_531c32d283bdff7e04e487bcdbc4dd8d", response.get_session_index()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) - self.assertEqual('_7164a9a9f97828bfdb8d0ebc004a05d2e7d873f70c', response_2.get_session_index()) + self.assertEqual("_7164a9a9f97828bfdb8d0ebc004a05d2e7d873f70c", response_2.get_session_index()) def testGetAttributes(self): """ - Tests the getAttributes method of the OneLogin_Saml2_Response + Tests the get_attributes method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - expected_attributes = { - 'uid': ['demo'], - 'another_value': ['value'] - } + expected_attributes = {"uid": ["demo"], "another_value": ["value"]} self.assertEqual(expected_attributes, response.get_attributes()) # An assertion that has no attributes should return an empty # array when asked for the attributes - xml_2 = self.file_contents(join(self.data_path, 'responses', 'response2.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "response2.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertEqual({}, response_2.get_attributes()) # Encrypted Attributes are not supported - xml_3 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'encrypted_attrs.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "invalids", "encrypted_attrs.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) self.assertEqual({}, response_3.get_attributes()) + # Test retrieving duplicate attributes + xml_4 = self.file_contents(join(self.data_path, "responses", "response1_with_duplicate_attributes.xml.base64")) + response_4 = OneLogin_Saml2_Response(settings, xml_4) + with self.assertRaises(OneLogin_Saml2_ValidationError) as duplicate_name_exc: + response_4.get_attributes() + self.assertIn("Found an Attribute element with duplicated Name", str(duplicate_name_exc.exception)) + + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings11.json")) + expected_attributes = {"another_value": ["value"], "duplicate_name": ["name1", "name2"], "friendly1": ["friendly1"], "friendly2": ["friendly2"], "uid": ["demo"]} + + response_5 = OneLogin_Saml2_Response(settings, xml_4) + self.assertEqual(expected_attributes, response_5.get_attributes()) + + def testGetFriendlyAttributes(self): + """ + Tests the get_friendlyname_attributes method of the OneLogin_Saml2_Response + """ + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) + response = OneLogin_Saml2_Response(settings, xml) + self.assertEqual({}, response.get_friendlyname_attributes()) + + expected_attributes = {"username": ["demo"]} + xml_2 = self.file_contents(join(self.data_path, "responses", "response1_with_friendlyname.xml.base64")) + response_2 = OneLogin_Saml2_Response(settings, xml_2) + self.assertEqual(expected_attributes, response_2.get_friendlyname_attributes()) + + xml_3 = self.file_contents(join(self.data_path, "responses", "response2.xml.base64")) + response_3 = OneLogin_Saml2_Response(settings, xml_3) + self.assertEqual({}, response_3.get_friendlyname_attributes()) + + xml_4 = self.file_contents(join(self.data_path, "responses", "invalids", "encrypted_attrs.xml.base64")) + response_4 = OneLogin_Saml2_Response(settings, xml_4) + self.assertEqual({}, response_4.get_friendlyname_attributes()) + + # Test retrieving duplicate attributes + xml_5 = self.file_contents(join(self.data_path, "responses", "response1_with_duplicate_attributes.xml.base64")) + response_5 = OneLogin_Saml2_Response(settings, xml_5) + with self.assertRaises(OneLogin_Saml2_ValidationError) as duplicate_name_exc: + response_5.get_friendlyname_attributes() + self.assertIn("Found an Attribute element with duplicated FriendlyName", str(duplicate_name_exc.exception)) + + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings11.json")) + expected_attributes = {"username": ["demo"], "friendlytest": ["friendly1", "friendly2"]} + + response_6 = OneLogin_Saml2_Response(settings, xml_5) + self.assertEqual(expected_attributes, response_6.get_friendlyname_attributes()) + + def testGetEncryptedAttributes(self): + """ + Tests the get_attributes method of the OneLogin_Saml2_Response with an encrypted response + """ + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings8.json")) + xml = self.file_contents(join(self.data_path, "responses", "signed_message_encrypted_assertion2.xml.base64")) + response = OneLogin_Saml2_Response(settings, xml) + self.assertEqual( + { + "uid": ["smartin"], + "mail": ["smartin@yaco.es"], + "cn": ["Sixto3"], + "sn": ["Martin2"], + "phone": [], + "eduPersonAffiliation": ["user", "admin"], + }, + response.get_attributes(), + ) + def testGetNestedNameIDAttributes(self): """ Tests the getAttributes method of the OneLogin_Saml2_Response with nested nameID data """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response_with_nested_nameid_values.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response_with_nested_nameid_values.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - expected_attributes = { - 'uid': ['demo'], - 'another_value': [{ - 'NameID': { - 'Format': 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent', - 'NameQualifier': 'https://idpID', - 'value': 'value' - } - }] - } + expected_attributes = {"uid": ["demo"], "another_value": [{"NameID": {"Format": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", "NameQualifier": "https://idpID", "value": "value"}}]} self.assertEqual(expected_attributes, response.get_attributes()) + expected_attributes = {"another_friendly_value": [{"NameID": {"Format": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", "NameQualifier": "https://idpID", "value": "value"}}]} + self.assertEqual(expected_attributes, response.get_friendlyname_attributes()) + def testOnlyRetrieveAssertionWithIDThatMatchesSignatureReference(self): """ Tests the get_nameid method of the OneLogin_Saml2_Response The Assertion is unsigned so the method fails """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'wrapped_response_2.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "wrapped_response_2.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Invalid Signature Element {urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptor SAML Response rejected'): + with self.assertRaisesRegex(Exception, "Invalid Signature Element {urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptor SAML Response rejected"): response.is_valid(self.get_request_data(), raise_exceptions=True) nameid = response.get_nameid() - self.assertEqual('root@example.com', nameid) + self.assertEqual("root@example.com", nameid) def testDoesNotAllowSignatureWrappingAttack(self): """ @@ -717,9 +773,9 @@ def testDoesNotAllowSignatureWrappingAttack(self): Test that the SignatureWrappingAttack is not allowed """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response4.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response4.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - self.assertEqual('test@onelogin.com', response.get_nameid()) + self.assertEqual("test@onelogin.com", response.get_nameid()) self.assertFalse(response.is_valid(self.get_request_data())) def testNodeTextAttack(self): @@ -727,29 +783,29 @@ def testNodeTextAttack(self): Tests the get_nameid and get_attributes methods of the OneLogin_Saml2_Response Test that the node text with comment attack (VU#475445) is not allowed """ - xml = self.file_contents(join(self.data_path, 'responses', 'response_node_text_attack.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response_node_text_attack.xml.base64")) settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) response = OneLogin_Saml2_Response(settings, xml) attributes = response.get_attributes() nameid = response.get_nameid() - self.assertEqual("smith", attributes.get('surname')[0]) - self.assertEqual('support@onelogin.com', nameid) + self.assertEqual("smith", attributes.get("surname")[0]) + self.assertEqual("support@onelogin.com", nameid) def testGetSessionNotOnOrAfter(self): """ Tests the get_session_not_on_or_after method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertEqual(1290203857, response.get_session_not_on_or_after()) # An assertion that do not specified Session timeout should return NULL - xml_2 = self.file_contents(join(self.data_path, 'responses', 'response2.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "response2.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertEqual(None, response_2.get_session_not_on_or_after()) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) self.assertEqual(2696012228, response_3.get_session_not_on_or_after()) @@ -761,46 +817,46 @@ def testGetInResponseTo(self): settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) # Response without an InResponseTo element should return None - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertIsNone(response.get_in_response_to()) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) - self.assertEqual('ONELOGIN_be60b8caf8e9d19b7a3551b244f116c947ff247d', response_3.get_in_response_to()) + self.assertEqual("ONELOGIN_be60b8caf8e9d19b7a3551b244f116c947ff247d", response_3.get_in_response_to()) def testIsInvalidXML(self): """ Tests the is_valid method of the OneLogin_Saml2_Response Case Invalid XML """ - message = compat.to_string(OneLogin_Saml2_Utils.b64encode('invalid')) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html', - 'get_data': {} - } + message = compat.to_string( + OneLogin_Saml2_Utils.b64encode( + 'invalid' + ) + ) + request_data = {"http_host": "example.com", "script_name": "index.html", "get_data": {}} settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, message) self.assertFalse(response_2.is_valid(request_data)) - self.assertEqual('Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd', response_2.get_error()) + self.assertEqual("Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd", response_2.get_error()) def testValidateNumAssertions(self): """ Tests the validate_num_assertions method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.validate_num_assertions()) - xml_multi_assertion = self.file_contents(join(self.data_path, 'responses', 'invalids', 'multiple_assertions.xml.base64')) + xml_multi_assertion = self.file_contents(join(self.data_path, "responses", "invalids", "multiple_assertions.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_multi_assertion) self.assertFalse(response_2.validate_num_assertions()) @@ -809,23 +865,23 @@ def testValidateTimestamps(self): Tests the validate_timestamps method of the OneLogin_Saml2_Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.validate_timestamps()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertTrue(response_2.validate_timestamps()) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'expired_response.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "expired_response.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) self.assertFalse(response_3.validate_timestamps()) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'not_after_failed.xml.base64')) + xml_4 = self.file_contents(join(self.data_path, "responses", "invalids", "not_after_failed.xml.base64")) response_4 = OneLogin_Saml2_Response(settings, xml_4) self.assertFalse(response_4.validate_timestamps()) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'not_before_failed.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "invalids", "not_before_failed.xml.base64")) response_5 = OneLogin_Saml2_Response(settings, xml_5) self.assertFalse(response_5.validate_timestamps()) @@ -835,9 +891,9 @@ def testValidateVersion(self): Case invalid version """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_saml2.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_saml2.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Unsupported SAML version'): + with self.assertRaisesRegex(Exception, "Unsupported SAML version"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testValidateID(self): @@ -846,9 +902,9 @@ def testValidateID(self): Case invalid no ID """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_id.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_id.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Missing ID attribute on SAML Response'): + with self.assertRaisesRegex(Exception, "Missing ID attribute on SAML Response"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidReference(self): @@ -857,12 +913,12 @@ def testIsInValidReference(self): Case invalid reference """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.is_valid(self.get_request_data())) - self.assertEqual('Signature validation failed. SAML Response rejected', response.get_error()) + self.assertEqual("Signature validation failed. SAML Response rejected", response.get_error()) - with self.assertRaisesRegex(Exception, 'Signature validation failed. SAML Response rejected'): + with self.assertRaisesRegex(Exception, "Signature validation failed. SAML Response rejected"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidExpired(self): @@ -871,14 +927,14 @@ def testIsInValidExpired(self): Case expired response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'expired_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "expired_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) response.is_valid(self.get_request_data()) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Could not validate timestamp: expired. Check system clock.'): + with self.assertRaisesRegex(Exception, "Could not validate timestamp: expired. Check system clock."): response_2.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidNoStatement(self): @@ -887,15 +943,15 @@ def testIsInValidNoStatement(self): Case no statement """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_signature.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_signature.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) response.is_valid(self.get_request_data()) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response_2.is_valid(self.get_request_data())) - self.assertEqual('There is no AttributeStatement on the Response', response_2.get_error()) + self.assertEqual("There is no AttributeStatement on the Response", response_2.get_error()) def testIsValidOptionalStatement(self): """ @@ -908,25 +964,25 @@ def testIsValidOptionalStatement(self): settings.set_strict(True) # want AttributeStatement True by default - self.assertTrue(settings.get_security_data()['wantAttributeStatement']) + self.assertTrue(settings.get_security_data()["wantAttributeStatement"]) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'signed_assertion_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "signed_assertion_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.is_valid(self.get_request_data())) - self.assertEqual('There is no AttributeStatement on the Response', response.get_error()) + self.assertEqual("There is no AttributeStatement on the Response", response.get_error()) # change wantAttributeStatement to optional - json_settings['security']['wantAttributeStatement'] = False + json_settings["security"]["wantAttributeStatement"] = False settings = OneLogin_Saml2_Settings(json_settings) # check settings - self.assertFalse(settings.get_security_data()['wantAttributeStatement']) + self.assertFalse(settings.get_security_data()["wantAttributeStatement"]) response = OneLogin_Saml2_Response(settings, xml) response.is_valid(self.get_request_data()) - self.assertNotEqual('There is no AttributeStatement on the Response', response.get_error()) - self.assertEqual('Signature validation failed. SAML Response rejected', response.get_error()) + self.assertNotEqual("There is no AttributeStatement on the Response", response.get_error()) + self.assertEqual("Signature validation failed. SAML Response rejected", response.get_error()) def testIsInValidNoKey(self): """ @@ -934,9 +990,22 @@ def testIsInValidNoKey(self): Case no key """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_key.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_key.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Signature validation failed. SAML Response rejected'): + with self.assertRaisesRegex(Exception, "Signature validation failed. SAML Response rejected"): + response.is_valid(self.get_request_data(), raise_exceptions=True) + + def testIsInValidDeprecatedAlgorithm(self): + """ + Tests the is_valid method of the OneLogin_Saml2_Response + Case Deprecated algorithm used + """ + settings_dict = self.loadSettingsJSON() + settings_dict["security"]["rejectDeprecatedAlgorithm"] = True + settings = OneLogin_Saml2_Settings(settings_dict) + xml = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + response = OneLogin_Saml2_Response(settings, xml) + with self.assertRaisesRegex(Exception, "Deprecated signature algorithm found: http://www.w3.org/2000/09/xmldsig#rsa-sha1"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidMultipleAssertions(self): @@ -946,9 +1015,9 @@ def testIsInValidMultipleAssertions(self): """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'multiple_assertions.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "multiple_assertions.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'SAML Response must contain 1 assertion'): + with self.assertRaisesRegex(Exception, "SAML Response must contain 1 assertion"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidEncAttrs(self): @@ -957,14 +1026,14 @@ def testIsInValidEncAttrs(self): Case invalid Encrypted Attrs """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'encrypted_attrs.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "encrypted_attrs.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) response.is_valid(self.get_request_data()) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'There is an EncryptedAttribute in the Response and this SP not support them'): + with self.assertRaisesRegex(Exception, "There is an EncryptedAttribute in the Response and this SP not support them"): response_2.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidDuplicatedAttrs(self): @@ -973,9 +1042,9 @@ def testIsInValidDuplicatedAttrs(self): Case duplicated Attrs """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'duplicated_attributes.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "duplicated_attributes.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Found an Attribute element with duplicated Name'): + with self.assertRaisesRegex(Exception, "Found an Attribute element with duplicated Name"): response.get_attributes() def testIsInValidDestination(self): @@ -984,35 +1053,75 @@ def testIsInValidDestination(self): Case Invalid Response, Invalid Destination """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'responses', 'unsigned_response.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) response = OneLogin_Saml2_Response(settings, message) response.is_valid(self.get_request_data()) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, message) self.assertFalse(response_2.is_valid(self.get_request_data())) - self.assertIn('The response was received at', response_2.get_error()) + self.assertIn("The response was received at", response_2.get_error()) # Empty Destination dom = parseString(b64decode(message)) - dom.firstChild.setAttribute('Destination', '') + dom.firstChild.setAttribute("Destination", "") message_2 = OneLogin_Saml2_Utils.b64encode(dom.toxml()) response_3 = OneLogin_Saml2_Response(settings, message_2) self.assertFalse(response_3.is_valid(self.get_request_data())) - self.assertIn('The response has an empty Destination value', response_3.get_error()) + self.assertIn("The response has an empty Destination value", response_3.get_error()) - message_3 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'empty_destination.xml.base64')) + message_3 = self.file_contents(join(self.data_path, "responses", "invalids", "empty_destination.xml.base64")) response_4 = OneLogin_Saml2_Response(settings, message_3) self.assertFalse(response_4.is_valid(self.get_request_data())) - self.assertEqual('The response has an empty Destination value', response_4.get_error()) + self.assertEqual("The response has an empty Destination value", response_4.get_error()) # No Destination - dom.firstChild.removeAttribute('Destination') + dom.firstChild.removeAttribute("Destination") message_4 = OneLogin_Saml2_Utils.b64encode(dom.toxml()) response_5 = OneLogin_Saml2_Response(settings, message_4) self.assertFalse(response_5.is_valid(self.get_request_data())) - self.assertIn('A valid SubjectConfirmation was not found on this Response', response_5.get_error()) + self.assertIn("A valid SubjectConfirmation was not found on this Response", response_5.get_error()) + + settings.set_strict(True) + response_2 = OneLogin_Saml2_Response(settings, message) + self.assertFalse(response_2.is_valid(self.get_request_data())) + self.assertIn("The response was received at", response_2.get_error()) + + def testIsInValidDestinationCapitalizationOfElements(self): + """ + Tests the is_valid method of the OneLogin_Saml2_Response class + Case Invalid Response due to differences in capitalization of path + """ + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + message = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) + + # Test path capitalized + settings.set_strict(True) + response = OneLogin_Saml2_Response(settings, message) + self.assertFalse(response.is_valid(self.get_request_data_path_capitalized())) + self.assertIn("The response was received at", response.get_error()) + + # Test both domain and path capitalized + response_2 = OneLogin_Saml2_Response(settings, message) + self.assertFalse(response_2.is_valid(self.get_request_data_both_capitalized())) + self.assertIn("The response was received at", response_2.get_error()) + + def testIsValidDestinationCapitalizationOfHost(self): + """ + Tests the is_valid method of the OneLogin_Saml2_Response class + Case Valid Response, even if host is differently capitalized (per RFC) + """ + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) + message = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) + # Test domain capitalized + settings.set_strict(True) + response = OneLogin_Saml2_Response(settings, message) + self.assertFalse(response.is_valid(self.get_request_data_domain_capitalized())) + self.assertNotIn("The response was received at", response.get_error()) + + # Assert we got past the destination check, which appears later + self.assertIn("A valid SubjectConfirmation was not found", response.get_error()) def testIsInValidAudience(self): """ @@ -1020,21 +1129,21 @@ def testIsInValidAudience(self): Case Invalid Response, Invalid Audience """ request_data = { - 'http_host': 'stuff.com', - 'script_name': '/endpoints/endpoints/acs.php', + "http_host": "stuff.com", + "script_name": "/endpoints/endpoints/acs.php", } settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_audience.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_audience.xml.base64")) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, message) self.assertFalse(response_2.is_valid(request_data)) - self.assertIn('is not a valid audience for this Response', response_2.get_error()) + self.assertIn("is not a valid audience for this Response", response_2.get_error()) def testIsInValidAuthenticationContext(self): """ @@ -1044,19 +1153,19 @@ def testIsInValidAuthenticationContext(self): that didn't complete the two-factor step. """ request_data = self.get_request_data() - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) - two_factor_context = 'urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken' - password_context = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password' + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) + two_factor_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken" + password_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password" settings_dict = self.loadSettingsJSON() - settings_dict['security']['requestedAuthnContext'] = [two_factor_context] - settings_dict['security']['failOnAuthnContextMismatch'] = True - settings_dict['strict'] = True + settings_dict["security"]["requestedAuthnContext"] = [two_factor_context] + settings_dict["security"]["failOnAuthnContextMismatch"] = True + settings_dict["strict"] = True settings = OneLogin_Saml2_Settings(settings_dict) # check that we catch when the contexts don't match response = OneLogin_Saml2_Response(settings, message) self.assertFalse(response.is_valid(request_data)) - self.assertIn('The AuthnContext "%s" didn\'t include requested context "%s"' % (password_context, two_factor_context), response.get_error()) + self.assertIn('The AuthnContext "%s" was not a requested context "%s"' % (password_context, two_factor_context), response.get_error()) # now drop in the expected AuthnContextClassRef and see that it passes original_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(message)) @@ -1065,14 +1174,14 @@ def testIsInValidAuthenticationContext(self): response = OneLogin_Saml2_Response(settings, two_factor_message) response.is_valid(request_data) # check that we got as far as destination validation, which comes later - self.assertIn('The response was received at', response.get_error()) + self.assertIn("The response was received at", response.get_error()) # with the default setting, check that we succeed with our original context - settings_dict['security']['requestedAuthnContext'] = True + settings_dict["security"]["requestedAuthnContext"] = True settings = OneLogin_Saml2_Settings(settings_dict) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertIn('The response was received at', response.get_error()) + self.assertIn("The response was received at", response.get_error()) def testIsInValidIssuer(self): """ @@ -1080,36 +1189,33 @@ def testIsInValidIssuer(self): Case Invalid Response, Invalid Issuer """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_issuer_assertion.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_issuer_assertion.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_issuer_message.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_issuer_message.xml.base64")) plain_message_2 = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_2)) - plain_message_2 = plain_message_2.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message_2 = plain_message_2.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message_2 = OneLogin_Saml2_Utils.b64encode(plain_message_2) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) response_2 = OneLogin_Saml2_Response(settings, message_2) response_2.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_2.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_2.get_error()) settings.set_strict(True) response_3 = OneLogin_Saml2_Response(settings, message) - with self.assertRaisesRegex(Exception, 'Invalid issuer in the Assertion/Response'): + with self.assertRaisesRegex(Exception, "Invalid issuer in the Assertion/Response"): response_3.is_valid(request_data, raise_exceptions=True) response_4 = OneLogin_Saml2_Response(settings, message_2) - with self.assertRaisesRegex(Exception, 'Invalid issuer in the Assertion/Response'): + with self.assertRaisesRegex(Exception, "Invalid issuer in the Assertion/Response"): response_4.is_valid(request_data, raise_exceptions=True) def testIsInValidSessionIndex(self): @@ -1118,45 +1224,39 @@ def testIsInValidSessionIndex(self): Case Invalid Response, Invalid SessionIndex """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_sessionindex.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_sessionindex.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response_2 = OneLogin_Saml2_Response(settings, message) - with self.assertRaisesRegex(Exception, 'The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response'): + with self.assertRaisesRegex(Exception, "The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response"): response_2.is_valid(request_data, raise_exceptions=True) def testDatetimeWithMiliseconds(self): """ Tests the is_valid method of the OneLogin_Saml2_Response class - Somtimes IdPs uses datetimes with miliseconds, this + Sometimes IdPs uses datetimes with miliseconds, this test is to verify that the toolkit supports them """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'unsigned_response_with_miliseconds.xm.base64')) + xml = self.file_contents(join(self.data_path, "responses", "unsigned_response_with_miliseconds.xm.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) def testIsInValidSubjectConfirmation(self): """ @@ -1164,88 +1264,85 @@ def testIsInValidSubjectConfirmation(self): Case Invalid Response, Invalid SubjectConfirmation """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_subjectconfirmation_method.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_subjectconfirmation_method.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_subjectconfirmation_data.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "invalids", "no_subjectconfirmation_data.xml.base64")) plain_message_2 = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_2)) - plain_message_2 = plain_message_2.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message_2 = plain_message_2.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message_2 = OneLogin_Saml2_Utils.b64encode(plain_message_2) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_subjectconfirmation_inresponse.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_subjectconfirmation_inresponse.xml.base64")) plain_message_3 = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_3)) - plain_message_3 = plain_message_3.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message_3 = plain_message_3.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message_3 = OneLogin_Saml2_Utils.b64encode(plain_message_3) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_subjectconfirmation_recipient.xml.base64')) + xml_4 = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_subjectconfirmation_recipient.xml.base64")) plain_message_4 = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_4)) - plain_message_4 = plain_message_4.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message_4 = plain_message_4.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message_4 = OneLogin_Saml2_Utils.b64encode(plain_message_4) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_subjectconfirmation_noa.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_subjectconfirmation_noa.xml.base64")) plain_message_5 = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_5)) - plain_message_5 = plain_message_5.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message_5 = plain_message_5.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message_5 = OneLogin_Saml2_Utils.b64encode(plain_message_5) - xml_6 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'invalid_subjectconfirmation_nb.xml.base64')) + xml_6 = self.file_contents(join(self.data_path, "responses", "invalids", "invalid_subjectconfirmation_nb.xml.base64")) plain_message_6 = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_6)) - plain_message_6 = plain_message_6.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message_6 = plain_message_6.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message_6 = OneLogin_Saml2_Utils.b64encode(plain_message_6) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) response_2 = OneLogin_Saml2_Response(settings, message_2) response_2.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_2.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_2.get_error()) response_3 = OneLogin_Saml2_Response(settings, message_3) response_3.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_3.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_3.get_error()) response_4 = OneLogin_Saml2_Response(settings, message_4) response_4.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_4.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_4.get_error()) response_5 = OneLogin_Saml2_Response(settings, message_5) response_5.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_5.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_5.get_error()) response_6 = OneLogin_Saml2_Response(settings, message_6) response_6.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_6.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_6.get_error()) settings.set_strict(True) response = OneLogin_Saml2_Response(settings, message) - with self.assertRaisesRegex(Exception, 'A valid SubjectConfirmation was not found on this Response'): + with self.assertRaisesRegex(Exception, "A valid SubjectConfirmation was not found on this Response"): response.is_valid(request_data, raise_exceptions=True) response_2 = OneLogin_Saml2_Response(settings, message_2) - with self.assertRaisesRegex(Exception, 'A valid SubjectConfirmation was not found on this Response'): + with self.assertRaisesRegex(Exception, "A valid SubjectConfirmation was not found on this Response"): response_2.is_valid(request_data, raise_exceptions=True) response_3 = OneLogin_Saml2_Response(settings, message_3) - with self.assertRaisesRegex(Exception, 'A valid SubjectConfirmation was not found on this Response'): + with self.assertRaisesRegex(Exception, "A valid SubjectConfirmation was not found on this Response"): response_3.is_valid(request_data, raise_exceptions=True) response_4 = OneLogin_Saml2_Response(settings, message_4) - with self.assertRaisesRegex(Exception, 'A valid SubjectConfirmation was not found on this Response'): + with self.assertRaisesRegex(Exception, "A valid SubjectConfirmation was not found on this Response"): response_4.is_valid(request_data, raise_exceptions=True) response_5 = OneLogin_Saml2_Response(settings, message_5) - with self.assertRaisesRegex(Exception, 'A valid SubjectConfirmation was not found on this Response'): + with self.assertRaisesRegex(Exception, "A valid SubjectConfirmation was not found on this Response"): response_5.is_valid(request_data, raise_exceptions=True) response_6 = OneLogin_Saml2_Response(settings, message_6) - with self.assertRaisesRegex(Exception, 'A valid SubjectConfirmation was not found on this Response'): + with self.assertRaisesRegex(Exception, "A valid SubjectConfirmation was not found on this Response"): response_6.is_valid(request_data, raise_exceptions=True) def testIsInValidRequestId(self): @@ -1254,29 +1351,26 @@ def testIsInValidRequestId(self): Case Invalid Response, Invalid requestID """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'unsigned_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) response = OneLogin_Saml2_Response(settings, message) - request_id = 'invalid' + request_id = "invalid" response.is_valid(request_data, request_id) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) settings.set_strict(True) response = OneLogin_Saml2_Response(settings, message) - with self.assertRaisesRegex(Exception, 'The InResponseTo of the Response'): + with self.assertRaisesRegex(Exception, "The InResponseTo of the Response"): response.is_valid(request_data, request_id, raise_exceptions=True) - valid_request_id = '_57bcbf70-7b1f-012e-c821-782bcb13bb38' + valid_request_id = "_57bcbf70-7b1f-012e-c821-782bcb13bb38" response.is_valid(request_data, valid_request_id) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) def testIsInValidSignIssues(self): """ @@ -1284,67 +1378,64 @@ def testIsInValidSignIssues(self): Case Invalid Response, Invalid signing issues """ settings_info = self.loadSettingsJSON() - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'unsigned_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) - settings_info['security']['wantAssertionsSigned'] = False + settings_info["security"]["wantAssertionsSigned"] = False settings = OneLogin_Saml2_Settings(settings_info) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) - settings_info['security']['wantAssertionsSigned'] = True + settings_info["security"]["wantAssertionsSigned"] = True settings_2 = OneLogin_Saml2_Settings(settings_info) response_2 = OneLogin_Saml2_Response(settings_2, message) response_2.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_2.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_2.get_error()) - settings_info['strict'] = True - settings_info['security']['wantAssertionsSigned'] = False + settings_info["strict"] = True + settings_info["security"]["wantAssertionsSigned"] = False settings_3 = OneLogin_Saml2_Settings(settings_info) response_3 = OneLogin_Saml2_Response(settings_3, message) response_3.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_3.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_3.get_error()) - settings_info['security']['wantAssertionsSigned'] = True + settings_info["security"]["wantAssertionsSigned"] = True settings_4 = OneLogin_Saml2_Settings(settings_info) response_4 = OneLogin_Saml2_Response(settings_4, message) - with self.assertRaisesRegex(Exception, 'The Assertion of the Response is not signed and the SP require it'): + with self.assertRaisesRegex(Exception, "The Assertion of the Response is not signed and the SP require it"): response_4.is_valid(request_data, raise_exceptions=True) - settings_info['security']['wantAssertionsSigned'] = False - settings_info['strict'] = False + settings_info["security"]["wantAssertionsSigned"] = False + settings_info["strict"] = False - settings_info['security']['wantMessagesSigned'] = False + settings_info["security"]["wantMessagesSigned"] = False settings_5 = OneLogin_Saml2_Settings(settings_info) response_5 = OneLogin_Saml2_Response(settings_5, message) response_5.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_5.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_5.get_error()) - settings_info['security']['wantMessagesSigned'] = True + settings_info["security"]["wantMessagesSigned"] = True settings_6 = OneLogin_Saml2_Settings(settings_info) response_6 = OneLogin_Saml2_Response(settings_6, message) response_6.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_6.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_6.get_error()) - settings_info['strict'] = True - settings_info['security']['wantMessagesSigned'] = False + settings_info["strict"] = True + settings_info["security"]["wantMessagesSigned"] = False settings_7 = OneLogin_Saml2_Settings(settings_info) response_7 = OneLogin_Saml2_Response(settings_7, message) response_7.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_7.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_7.get_error()) - settings_info['security']['wantMessagesSigned'] = True + settings_info["security"]["wantMessagesSigned"] = True settings_8 = OneLogin_Saml2_Settings(settings_info) response_8 = OneLogin_Saml2_Response(settings_8, message) - with self.assertRaisesRegex(Exception, 'The Message of the Response is not signed and the SP require it'): + with self.assertRaisesRegex(Exception, "The Message of the Response is not signed and the SP require it"): response_8.is_valid(request_data, raise_exceptions=True) def testIsInValidEncIssues(self): @@ -1353,67 +1444,74 @@ def testIsInValidEncIssues(self): Case Invalid Response, Invalid encryptation issues """ settings_info = self.loadSettingsJSON() - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - xml = self.file_contents(join(self.data_path, 'responses', 'unsigned_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "unsigned_response.xml.base64")) plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml)) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = OneLogin_Saml2_Utils.b64encode(plain_message) - settings_info['security']['wantAssertionsEncrypted'] = True + settings_info["security"]["wantAssertionsEncrypted"] = True settings = OneLogin_Saml2_Settings(settings_info) response = OneLogin_Saml2_Response(settings, message) response.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) - settings_info['strict'] = True - settings_info['security']['wantAssertionsEncrypted'] = False + settings_info["strict"] = True + settings_info["security"]["wantAssertionsEncrypted"] = False settings = OneLogin_Saml2_Settings(settings_info) response_2 = OneLogin_Saml2_Response(settings, message) response_2.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_2.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_2.get_error()) - settings_info['security']['wantAssertionsEncrypted'] = True + settings_info["security"]["wantAssertionsEncrypted"] = True settings = OneLogin_Saml2_Settings(settings_info) response_3 = OneLogin_Saml2_Response(settings, message) self.assertFalse(response_3.is_valid(request_data)) - self.assertEqual('The assertion of the Response is not encrypted and the SP require it', response_3.get_error()) + self.assertEqual("The assertion of the Response is not encrypted and the SP require it", response_3.get_error()) - settings_info['security']['wantAssertionsEncrypted'] = False - settings_info['security']['wantNameIdEncrypted'] = True - settings_info['strict'] = False + settings_info["security"]["wantAssertionsEncrypted"] = False + settings_info["security"]["wantNameIdEncrypted"] = True + settings_info["strict"] = False settings = OneLogin_Saml2_Settings(settings_info) response_4 = OneLogin_Saml2_Response(settings, message) response_4.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_4.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_4.get_error()) - settings_info['strict'] = True + settings_info["strict"] = True settings = OneLogin_Saml2_Settings(settings_info) response_5 = OneLogin_Saml2_Response(settings, message) self.assertFalse(response_5.is_valid(request_data)) - self.assertEqual('The NameID of the Response is not encrypted and the SP require it', response_5.get_error()) + self.assertEqual("The NameID of the Response is not encrypted and the SP require it", response_5.get_error()) - settings_info_2 = self.loadSettingsJSON('settings3.json') - settings_info_2['strict'] = True - settings_info_2['security']['wantNameIdEncrypted'] = True + def testIsInValidEncIssues_2(self): + settings_info_2 = self.loadSettingsJSON("settings3.json") + settings_info_2["strict"] = True + settings_info_2["security"]["wantNameIdEncrypted"] = True settings_2 = OneLogin_Saml2_Settings(settings_info_2) + request_data = {"script_name": "", "request_uri": "?acs", "http_host": "pytoolkit.com", "server_port": 8000} + + message_2 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion_encrypted_nameid.xml.base64")) + response_6 = OneLogin_Saml2_Response(settings_2, message_2) + + if sys.version_info > (3, 2, 0): + with self.assertWarns(Warning): + self.assertFalse(response_6.is_valid(request_data)) + self.assertEqual("The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response", response_6.get_error()) + request_data = { - 'http_host': 'pytoolkit.com', - 'server_port': 8000, - 'script_name': '', - 'request_uri': '?acs', + "script_name": "", + "request_uri": "?acs", + "http_host": "pytoolkit.com:8000", } - message_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion_encrypted_nameid.xml.base64')) + message_2 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion_encrypted_nameid.xml.base64")) response_6 = OneLogin_Saml2_Response(settings_2, message_2) self.assertFalse(response_6.is_valid(request_data)) - self.assertEqual('The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response', response_6.get_error()) + self.assertEqual("The attributes have expired, based on the SessionNotOnOrAfter of the AttributeStatement of this Response", response_6.get_error()) def testIsInValidCert(self): """ @@ -1421,12 +1519,12 @@ def testIsInValidCert(self): Case invalid cert """ settings_info = self.loadSettingsJSON() - settings_info['idp']['x509cert'] = 'NotValidCert' + settings_info["idp"]["x509cert"] = "NotValidCert" settings = OneLogin_Saml2_Settings(settings_info) - xml = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'Signature validation failed. SAML Response rejected'): + with self.assertRaisesRegex(Exception, "Signature validation failed. SAML Response rejected"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testIsInValidCert2(self): @@ -1435,9 +1533,11 @@ def testIsInValidCert2(self): Case invalid cert2 """ settings_info = self.loadSettingsJSON() - settings_info['idp']['x509cert'] = 'MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkK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nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=" settings = OneLogin_Saml2_Settings(settings_info) - xml = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.is_valid(self.get_request_data())) @@ -1448,10 +1548,10 @@ def testIsValid(self): """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'valid_unsigned_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_unsigned_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) response.is_valid(self.get_request_data()) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response.get_error()) def testIsValid2(self): """ @@ -1462,36 +1562,36 @@ def testIsValid2(self): settings = OneLogin_Saml2_Settings(settings_info) # expired cert - xml = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.is_valid(self.get_request_data())) - settings_info_2 = self.loadSettingsJSON('settings2.json') + settings_info_2 = self.loadSettingsJSON("settings2.json") settings_2 = OneLogin_Saml2_Settings(settings_info_2) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_response2.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "valid_response2.xml.base64")) response_2 = OneLogin_Saml2_Response(settings_2, xml_2) self.assertTrue(response_2.is_valid(self.get_request_data())) - settings_info_3 = self.loadSettingsJSON('settings2.json') - idp_cert = OneLogin_Saml2_Utils.format_cert(settings_info_3['idp']['x509cert']) - settings_info_3['idp']['certFingerprint'] = OneLogin_Saml2_Utils.calculate_x509_fingerprint(idp_cert) - settings_info_3['idp']['x509cert'] = '' + settings_info_3 = self.loadSettingsJSON("settings10.json") + idp_cert = OneLogin_Saml2_Utils.format_cert(settings_info_3["idp"]["x509cert"]) + settings_info_3["idp"]["certFingerprint"] = OneLogin_Saml2_Utils.calculate_x509_fingerprint(idp_cert) + settings_info_3["idp"]["x509cert"] = "" settings_3 = OneLogin_Saml2_Settings(settings_info_3) response_3 = OneLogin_Saml2_Response(settings_3, xml_2) self.assertTrue(response_3.is_valid(self.get_request_data())) - settings_info_3['idp']['certFingerprintAlgorithm'] = 'sha1' + settings_info_3["idp"]["certFingerprintAlgorithm"] = "sha1" settings_4 = OneLogin_Saml2_Settings(settings_info_3) response_4 = OneLogin_Saml2_Response(settings_4, xml_2) self.assertTrue(response_4.is_valid(self.get_request_data())) - settings_info_3['idp']['certFingerprintAlgorithm'] = 'sha256' + settings_info_3["idp"]["certFingerprintAlgorithm"] = "sha256" settings_5 = OneLogin_Saml2_Settings(settings_info_3) response_5 = OneLogin_Saml2_Response(settings_5, xml_2) self.assertFalse(response_5.is_valid(self.get_request_data())) - settings_info_3['idp']['certFingerprint'] = OneLogin_Saml2_Utils.calculate_x509_fingerprint(idp_cert, 'sha256') + settings_info_3["idp"]["certFingerprint"] = OneLogin_Saml2_Utils.calculate_x509_fingerprint(idp_cert, "sha256") settings_6 = OneLogin_Saml2_Settings(settings_info_3) response_6 = OneLogin_Saml2_Response(settings_6, xml_2) self.assertTrue(response_6.is_valid(self.get_request_data())) @@ -1507,45 +1607,42 @@ def testIsValidEnc(self): settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) # expired cert - xml = self.file_contents(join(self.data_path, 'responses', 'double_signed_encrypted_assertion.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "double_signed_encrypted_assertion.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.is_valid(self.get_request_data())) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'signed_encrypted_assertion.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "signed_encrypted_assertion.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertTrue(response_2.is_valid(self.get_request_data())) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "signed_message_encrypted_assertion.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) self.assertTrue(response_3.is_valid(self.get_request_data())) - settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings2.json')) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'double_signed_encrypted_assertion2.xml.base64')) + settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings2.json")) + xml_4 = self.file_contents(join(self.data_path, "responses", "double_signed_encrypted_assertion2.xml.base64")) response_4 = OneLogin_Saml2_Response(settings_2, xml_4) self.assertTrue(response_4.is_valid(self.get_request_data())) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'signed_encrypted_assertion2.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "signed_encrypted_assertion2.xml.base64")) response_5 = OneLogin_Saml2_Response(settings_2, xml_5) self.assertTrue(response_5.is_valid(self.get_request_data())) - xml_6 = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion2.xml.base64')) + xml_6 = self.file_contents(join(self.data_path, "responses", "signed_message_encrypted_assertion2.xml.base64")) response_6 = OneLogin_Saml2_Response(settings_2, xml_6) self.assertTrue(response_6.is_valid(self.get_request_data())) settings.set_strict(True) - xml_7 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64')) + xml_7 = self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion.xml.base64")) # In order to avoid the destination problem plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml_7)) - request_data = { - 'http_host': 'example.com', - 'script_name': 'index.html' - } + request_data = {"http_host": "example.com", "script_name": "index.html"} current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data) - plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url) + plain_message = plain_message.replace("http://stuff.com/endpoints/endpoints/acs.php", current_url) message = compat.to_string(OneLogin_Saml2_Utils.b64encode(plain_message)) response_7 = OneLogin_Saml2_Response(settings, message) response_7.is_valid(request_data) - self.assertEqual('No Signature found. SAML Response rejected', response_7.get_error()) + self.assertEqual("No Signature found. SAML Response rejected", response_7.get_error()) def testIsValidSign(self): """ @@ -1558,47 +1655,47 @@ def testIsValidSign(self): settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) # expired cert - xml = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "signed_message_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.is_valid(self.get_request_data())) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "signed_assertion_response.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertTrue(response_2.is_valid(self.get_request_data())) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'double_signed_response.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "double_signed_response.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) self.assertTrue(response_3.is_valid(self.get_request_data())) - settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings2.json')) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'signed_message_response2.xml.base64')) + settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings2.json")) + xml_4 = self.file_contents(join(self.data_path, "responses", "signed_message_response2.xml.base64")) response_4 = OneLogin_Saml2_Response(settings_2, xml_4) self.assertTrue(response_4.is_valid(self.get_request_data())) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response2.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "signed_assertion_response2.xml.base64")) response_5 = OneLogin_Saml2_Response(settings_2, xml_5) self.assertTrue(response_5.is_valid(self.get_request_data())) - xml_6 = self.file_contents(join(self.data_path, 'responses', 'double_signed_response2.xml.base64')) + xml_6 = self.file_contents(join(self.data_path, "responses", "double_signed_response2.xml.base64")) response_6 = OneLogin_Saml2_Response(settings_2, xml_6) self.assertTrue(response_6.is_valid(self.get_request_data())) dom = parseString(b64decode(xml_4)) - dom.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" xml_7 = OneLogin_Saml2_Utils.b64encode(dom.toxml()) response_7 = OneLogin_Saml2_Response(settings, xml_7) # Modified message self.assertFalse(response_7.is_valid(self.get_request_data())) dom_2 = parseString(OneLogin_Saml2_Utils.b64decode(xml_5)) - dom_2.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom_2.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" xml_8 = OneLogin_Saml2_Utils.b64encode(dom_2.toxml()) response_8 = OneLogin_Saml2_Response(settings, xml_8) # Modified message self.assertFalse(response_8.is_valid(self.get_request_data())) dom_3 = parseString(OneLogin_Saml2_Utils.b64decode(xml_6)) - dom_3.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom_3.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" xml_9 = OneLogin_Saml2_Utils.b64encode(dom_3.toxml()) response_9 = OneLogin_Saml2_Response(settings, xml_9) # Modified message @@ -1615,58 +1712,67 @@ def testIsValidSignFingerprint(self): settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings6.json")) # expired cert - xml = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "signed_message_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.is_valid(self.get_request_data())) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response.xml.base64')) + xml_2 = self.file_contents(join(self.data_path, "responses", "signed_assertion_response.xml.base64")) response_2 = OneLogin_Saml2_Response(settings, xml_2) self.assertTrue(response_2.is_valid(self.get_request_data())) - xml_3 = self.file_contents(join(self.data_path, 'responses', 'double_signed_response.xml.base64')) + xml_3 = self.file_contents(join(self.data_path, "responses", "double_signed_response.xml.base64")) response_3 = OneLogin_Saml2_Response(settings, xml_3) self.assertTrue(response_3.is_valid(self.get_request_data())) - settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings2.json')) - xml_4 = self.file_contents(join(self.data_path, 'responses', 'signed_message_response2.xml.base64')) + settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings2.json")) + xml_4 = self.file_contents(join(self.data_path, "responses", "signed_message_response2.xml.base64")) response_4 = OneLogin_Saml2_Response(settings_2, xml_4) self.assertTrue(response_4.is_valid(self.get_request_data())) - xml_5 = self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response2.xml.base64')) + xml_5 = self.file_contents(join(self.data_path, "responses", "signed_assertion_response2.xml.base64")) response_5 = OneLogin_Saml2_Response(settings_2, xml_5) self.assertTrue(response_5.is_valid(self.get_request_data())) - xml_6 = self.file_contents(join(self.data_path, 'responses', 'double_signed_response2.xml.base64')) + xml_6 = self.file_contents(join(self.data_path, "responses", "double_signed_response2.xml.base64")) response_6 = OneLogin_Saml2_Response(settings_2, xml_6) self.assertTrue(response_6.is_valid(self.get_request_data())) dom = parseString(b64decode(xml_4)) - dom.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" xml_7 = OneLogin_Saml2_Utils.b64encode(dom.toxml()) response_7 = OneLogin_Saml2_Response(settings, xml_7) # Modified message self.assertFalse(response_7.is_valid(self.get_request_data())) dom_2 = parseString(OneLogin_Saml2_Utils.b64decode(xml_5)) - dom_2.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom_2.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" xml_8 = OneLogin_Saml2_Utils.b64encode(dom_2.toxml()) response_8 = OneLogin_Saml2_Response(settings, xml_8) # Modified message self.assertFalse(response_8.is_valid(self.get_request_data())) dom_3 = parseString(OneLogin_Saml2_Utils.b64decode(xml_6)) - dom_3.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom_3.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" xml_9 = OneLogin_Saml2_Utils.b64encode(dom_3.toxml()) response_9 = OneLogin_Saml2_Response(settings, xml_9) # Modified message self.assertFalse(response_9.is_valid(self.get_request_data())) - def testIsValidSignWithEmptyReferenceURI(self): - settings_info = self.loadSettingsJSON() - del settings_info['idp']['x509cert'] - settings_info['idp']['certFingerprint'] = "194d97e4d8c9c8cfa4b721e5ee497fd9660e5213" + def testMessageSignedIsValidSignWithEmptyReferenceURI(self): + settings_info = self.loadSettingsJSON("settings10.json") + del settings_info["idp"]["x509cert"] + settings_info["idp"]["certFingerprint"] = "657302a5e11a4794a1e50a705988d66c9377575d" settings = OneLogin_Saml2_Settings(settings_info) - xml = self.file_contents(join(self.data_path, 'responses', 'response_without_reference_uri.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response_without_reference_uri.xml.base64")) + response = OneLogin_Saml2_Response(settings, xml) + self.assertTrue(response.is_valid(self.get_request_data())) + + def testAssertionSignedIsValidSignWithEmptyReferenceURI(self): + settings_info = self.loadSettingsJSON("settings10.json") + del settings_info["idp"]["x509cert"] + settings_info["idp"]["certFingerprint"] = "657302a5e11a4794a1e50a705988d66c9377575d" + settings = OneLogin_Saml2_Settings(settings_info) + xml = self.file_contents(join(self.data_path, "responses", "response_without_assertion_reference_uri.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertTrue(response.is_valid(self.get_request_data())) @@ -1678,24 +1784,16 @@ def testIsValidWithoutInResponseTo(self): # prepare strict settings settings_info = self.loadSettingsJSON() - settings_info['strict'] = True - settings_info['idp']['entityId'] = 'https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php' - settings_info['sp']['entityId'] = 'https://pitbulk.no-ip.org/newonelogin/demo1/metadata.php' + settings_info["strict"] = True + settings_info["idp"]["entityId"] = "https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php" + settings_info["sp"]["entityId"] = "https://pitbulk.no-ip.org/newonelogin/demo1/metadata.php" settings = OneLogin_Saml2_Settings(settings_info) - xml = self.file_contents(join(self.data_path, 'responses', 'valid_response_without_inresponseto.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_response_without_inresponseto.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - not_on_or_after = datetime.strptime('2014-02-19T09:37:01Z', '%Y-%m-%dT%H:%M:%SZ') - not_on_or_after -= timedelta(seconds=150) - - with freeze_time(not_on_or_after): - self.assertTrue(response.is_valid({ - 'https': 'on', - 'http_host': 'pitbulk.no-ip.org', - 'script_name': 'newonelogin/demo1/index.php?acs' - })) + self.assertTrue(response.is_valid({"https": "on", "http_host": "pitbulk.no-ip.org", "script_name": "newonelogin/demo1/index.php?acs"})) def testIsValidRaisesExceptionWhenRaisesArgumentIsTrue(self): """ @@ -1704,7 +1802,7 @@ def testIsValidRaisesExceptionWhenRaisesArgumentIsTrue(self): """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) settings.set_strict(True) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_conditions.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "no_conditions.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) self.assertFalse(response.is_valid(self.get_request_data())) @@ -1717,9 +1815,9 @@ def testStatusCheckBeforeAssertionCheck(self): Tests the status of a response is checked before the assertion count. As failed statuses will have no assertions """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responder.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "invalids", "status_code_responder.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - with self.assertRaisesRegex(Exception, 'The status code of the Response was not Success, was Responder'): + with self.assertRaisesRegex(Exception, "The status code of the Response was not Success, was Responder"): response.is_valid(self.get_request_data(), raise_exceptions=True) def testGetId(self): @@ -1727,18 +1825,18 @@ def testGetId(self): Tests that we can retrieve the ID of the Response """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "signed_message_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - self.assertEqual(response.get_id(), 'pfxc3d2b542-0f7e-8767-8e87-5b0dc6913375') + self.assertEqual(response.get_id(), "pfxf209cd60-f060-722b-02e9-4850ac5a2e41") def testGetAssertionId(self): """ Tests that we can retrieve the ID of the Assertion """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "signed_message_response.xml.base64")) response = OneLogin_Saml2_Response(settings, xml) - self.assertEqual(response.get_assertion_id(), '_cccd6024116641fe48e0ae2c51220d02755f96c98d') + self.assertEqual(response.get_assertion_id(), "_cccd6024116641fe48e0ae2c51220d02755f96c98d") def testGetAssertionNotOnOrAfter(self): """ @@ -1748,7 +1846,7 @@ def testGetAssertionNotOnOrAfter(self): settings_data = self.loadSettingsJSON() request_data = self.get_request_data() settings = OneLogin_Saml2_Settings(settings_data) - message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + message = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) response = OneLogin_Saml2_Response(settings, message) self.assertIsNone(response.get_assertion_not_on_or_after()) @@ -1756,7 +1854,7 @@ def testGetAssertionNotOnOrAfter(self): self.assertIsNone(response.get_error()) self.assertIsNone(response.get_assertion_not_on_or_after()) - settings_data['strict'] = True + settings_data["strict"] = True settings = OneLogin_Saml2_Settings(settings_data) response = OneLogin_Saml2_Response(settings, message) @@ -1764,9 +1862,9 @@ def testGetAssertionNotOnOrAfter(self): self.assertNotEqual(response.get_error(), None) self.assertIsNone(response.get_assertion_not_on_or_after()) - request_data['https'] = 'on' - request_data['http_host'] = 'pitbulk.no-ip.org' - request_data['script_name'] = '/newonelogin/demo1/index.php?acs' + request_data["https"] = "on" + request_data["http_host"] = "pitbulk.no-ip.org" + request_data["script_name"] = "/newonelogin/demo1/index.php?acs" response.is_valid(request_data) self.assertIsNone(response.get_error()) self.assertEqual(response.get_assertion_not_on_or_after(), 2671081021) diff --git a/tests/src/OneLogin/saml2_tests/settings_test.py b/tests/src/OneLogin/saml2_tests/settings_test.py index 75031009..85386fc3 100644 --- a/tests/src/OneLogin/saml2_tests/settings_test.py +++ b/tests/src/OneLogin/saml2_tests/settings_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json from os.path import dirname, join, exists, sep @@ -14,21 +12,21 @@ class OneLogin_Saml2_Settings_Test(unittest.TestCase): - data_path = join(dirname(dirname(dirname(dirname(__file__)))), 'data') - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + data_path = join(dirname(dirname(dirname(dirname(__file__)))), "data") + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") - def loadSettingsJSON(self, name='settings1.json'): + def loadSettingsJSON(self, name="settings1.json"): filename = join(self.settings_path, name) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -42,75 +40,93 @@ def testLoadSettingsFromDict(self): settings = OneLogin_Saml2_Settings(settings_info) self.assertEqual(len(settings.get_errors()), 0) - del settings_info['contactPerson'] - del settings_info['organization'] + del settings_info["contactPerson"] + del settings_info["organization"] settings = OneLogin_Saml2_Settings(settings_info) self.assertEqual(len(settings.get_errors()), 0) - del settings_info['security'] + del settings_info["security"] settings = OneLogin_Saml2_Settings(settings_info) self.assertEqual(len(settings.get_errors()), 0) - del settings_info['sp']['NameIDFormat'] - del settings_info['idp']['x509cert'] - settings_info['idp']['certFingerprint'] = 'afe71c28ef740bc87425be13a2263d37971daA1f9' + del settings_info["sp"]["NameIDFormat"] + del settings_info["idp"]["x509cert"] + settings_info["idp"]["certFingerprint"] = "afe71c28ef740bc87425be13a2263d37971daA1f9" settings = OneLogin_Saml2_Settings(settings_info) self.assertEqual(len(settings.get_errors()), 0) - settings_info['idp']['singleSignOnService']['url'] = 'invalid_url' + settings_info["idp"]["singleSignOnService"]["url"] = "invalid_url" try: settings_2 = OneLogin_Saml2_Settings(settings_info) self.assertNotEqual(len(settings_2.get_errors()), 0) except Exception as e: - self.assertIn('Invalid dict settings: idp_sso_url_invalid', str(e)) + self.assertIn("Invalid dict settings: idp_sso_url_invalid", str(e)) - settings_info['idp']['singleSignOnService']['url'] = 'http://invalid_domain' + settings_info["idp"]["singleSignOnService"]["url"] = "http://invalid_domain" try: settings_3 = OneLogin_Saml2_Settings(settings_info) self.assertNotEqual(len(settings_3.get_errors()), 0) except Exception as e: - self.assertIn('Invalid dict settings: idp_sso_url_invalid', str(e)) + self.assertIn("Invalid dict settings: idp_sso_url_invalid", str(e)) + + settings_info["idp"]["singleSignOnService"]["url"] = "http://single-label-domain" + settings_info["security"] = {} + settings_info["security"]["allowSingleLabelDomains"] = True + settings_4 = OneLogin_Saml2_Settings(settings_info) + self.assertEqual(len(settings_4.get_errors()), 0) - del settings_info['sp'] - del settings_info['idp'] + del settings_info["security"] + del settings_info["sp"] + del settings_info["idp"] try: - settings_4 = OneLogin_Saml2_Settings(settings_info) - self.assertNotEqual(len(settings_4.get_errors()), 0) + settings_5 = OneLogin_Saml2_Settings(settings_info) + self.assertNotEqual(len(settings_5.get_errors()), 0) except Exception as e: - self.assertIn('Invalid dict settings', str(e)) - self.assertIn('idp_not_found', str(e)) - self.assertIn('sp_not_found', str(e)) + self.assertIn("Invalid dict settings", str(e)) + self.assertIn("idp_not_found", str(e)) + self.assertIn("sp_not_found", str(e)) settings_info = self.loadSettingsJSON() - settings_info['security']['authnRequestsSigned'] = True - settings_info['custom_base_path'] = dirname(__file__) + settings_info["security"]["authnRequestsSigned"] = True + settings_info["custom_base_path"] = dirname(__file__) try: - settings_5 = OneLogin_Saml2_Settings(settings_info) - self.assertNotEqual(len(settings_5.get_errors()), 0) + settings_6 = OneLogin_Saml2_Settings(settings_info) + self.assertNotEqual(len(settings_6.get_errors()), 0) except Exception as e: - self.assertIn('Invalid dict settings: sp_cert_not_found_and_required', str(e)) + self.assertIn("Invalid dict settings: sp_cert_not_found_and_required", str(e)) + # test if the cert-file is loaded correct with the default filename settings_info = self.loadSettingsJSON() settings_info['security']['nameIdEncrypted'] = True del settings_info['idp']['x509cert'] + settings_7 = OneLogin_Saml2_Settings(settings_info) + self.assertEqual(len(settings_7.get_errors()), 0) + + # test if the cert-file is loaded correct with a custom filename + settings_info['idp']['cert_filename'] = "Test_Root_CA.crt" + settings_8 = OneLogin_Saml2_Settings(settings_info) + self.assertEqual(len(settings_8.get_errors()), 0) + + # test for the correct error, if there is no cert at all + settings_info['idp']['cert_filename'] = "not_existing_file.crt" try: - settings_6 = OneLogin_Saml2_Settings(settings_info) - self.assertNotEqual(len(settings_6.get_errors()), 0) + settings_9 = OneLogin_Saml2_Settings(settings_info) + self.assertNotEqual(len(settings_9.get_errors()), 0) except Exception as e: - self.assertIn('Invalid dict settings: idp_cert_not_found_and_required', str(e)) + self.assertIn("Invalid dict settings: idp_cert_not_found_and_required", str(e)) def testLoadSettingsFromInvalidData(self): """ Tests the OneLogin_Saml2_Settings Constructor. Case load setting """ - invalid_settings = ('param1', 'param2') + invalid_settings = ("param1", "param2") try: OneLogin_Saml2_Settings(invalid_settings) self.assertTrue(False) except Exception as e: - self.assertIn('Unsupported settings object', str(e)) + self.assertIn("Unsupported settings object", str(e)) settings = OneLogin_Saml2_Settings(custom_base_path=self.settings_path) self.assertEqual(len(settings.get_errors()), 0) @@ -120,7 +136,7 @@ def testLoadSettingsFromFile(self): Tests the OneLogin_Saml2_Settings Constructor. Case load setting from file """ - custom_base_path = join(dirname(__file__), '..', '..', '..', 'settings') + custom_base_path = join(dirname(__file__), "..", "..", "..", "settings") settings = OneLogin_Saml2_Settings(custom_base_path=custom_base_path) self.assertEqual(len(settings.get_errors()), 0) @@ -128,9 +144,9 @@ def testLoadSettingsFromFile(self): try: OneLogin_Saml2_Settings(custom_base_path=custom_base_path) except Exception as e: - self.assertIn('Settings file not found', str(e)) + self.assertIn("Settings file not found", str(e)) - custom_base_path = join(dirname(__file__), '..', '..', '..', 'data', 'customPath') + custom_base_path = join(dirname(__file__), "..", "..", "..", "data", "customPath") settings_3 = OneLogin_Saml2_Settings(custom_base_path=custom_base_path) self.assertEqual(len(settings_3.get_errors()), 0) @@ -139,31 +155,94 @@ def testGetCertPath(self): Tests getCertPath method of the OneLogin_Saml2_Settings """ settings = OneLogin_Saml2_Settings(custom_base_path=self.settings_path) - self.assertEqual(self.settings_path + sep + 'certs' + sep, settings.get_cert_path()) + self.assertEqual(self.settings_path + sep + "certs" + sep, settings.get_cert_path()) - def testGetLibPath(self): + def testSetCertPath(self): """ - Tests getLibPath method of the OneLogin_Saml2_Settings + Tests setCertPath method of the OneLogin_Saml2_Settings """ settings = OneLogin_Saml2_Settings(custom_base_path=self.settings_path) - base = settings.get_base_path() - self.assertEqual(join(base, 'lib') + sep, settings.get_lib_path()) + self.assertEqual(self.settings_path + sep + "certs" + sep, settings.get_cert_path()) + + settings.set_cert_path("/tmp") + self.assertEqual("/tmp", settings.get_cert_path()) - def testGetExtLibPath(self): + def testGetLibPath(self): """ - Tests getExtLibPath method of the OneLogin_Saml2_Settings + Tests getLibPath method of the OneLogin_Saml2_Settings """ + settingsInfo = self.loadSettingsJSON() + settings = OneLogin_Saml2_Settings(settingsInfo) + path = settings.get_base_path() + self.assertEqual(settings.get_lib_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/")) + self.assertEqual(path, join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/../../../tests/data/customPath/")) + + del settingsInfo["custom_base_path"] + settings = OneLogin_Saml2_Settings(settingsInfo) + path = settings.get_base_path() + self.assertEqual(settings.get_lib_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/")) + self.assertEqual(path, join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/")) + settings = OneLogin_Saml2_Settings(custom_base_path=self.settings_path) - base = settings.get_base_path() - self.assertEqual(join(base, 'extlib') + sep, settings.get_ext_lib_path()) + path = settings.get_base_path() + self.assertEqual(settings.get_lib_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/")) + self.assertEqual(path, join(dirname(dirname(dirname(dirname(__file__)))), "settings/")) def testGetSchemasPath(self): """ Tests getSchemasPath method of the OneLogin_Saml2_Settings """ + settingsInfo = self.loadSettingsJSON() + settings = OneLogin_Saml2_Settings(settingsInfo) + path = settings.get_base_path() + self.assertEqual(settings.get_schemas_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/schemas/")) + self.assertEqual(path, join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/../../../tests/data/customPath/")) + + del settingsInfo["custom_base_path"] + settings = OneLogin_Saml2_Settings(settingsInfo) + path = settings.get_base_path() + self.assertEqual(settings.get_schemas_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/schemas/")) + self.assertEqual(path, join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/")) + settings = OneLogin_Saml2_Settings(custom_base_path=self.settings_path) - base = settings.get_base_path() - self.assertEqual(join(base, 'lib', 'schemas') + sep, settings.get_schemas_path()) + path = settings.get_base_path() + self.assertEqual(settings.get_schemas_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), "src/onelogin/saml2/schemas/")) + self.assertEqual(path, join(dirname(dirname(dirname(dirname(__file__)))), "settings/")) + + def testGetIdPSSOurl(self): + """ + Tests the get_idp_sso_url method of the OneLogin_Saml2_Settings class + """ + settings_info = self.loadSettingsJSON() + settings = OneLogin_Saml2_Settings(settings_info) + + sso_url = settings_info["idp"]["singleSignOnService"]["url"] + self.assertEqual(settings.get_idp_sso_url(), sso_url) + + def testGetIdPSLOurl(self): + """ + Tests the get_idp_slo_url method of the OneLogin_Saml2_Settings class + """ + settings_info = self.loadSettingsJSON() + settings = OneLogin_Saml2_Settings(settings_info) + + slo_url = settings_info["idp"]["singleLogoutService"]["url"] + self.assertEqual(settings.get_idp_slo_url(), slo_url) + + def testGetIdPSLOresponseUrl(self): + """ + Tests the get_idp_slo_response_url method of the OneLogin_Saml2_Settings class + """ + settings_info = self.loadSettingsJSON() + settings_info["idp"]["singleLogoutService"]["responseUrl"] = "http://idp.example.com/SingleLogoutReturn.php" + settings = OneLogin_Saml2_Settings(settings_info) + slo_url = settings_info["idp"]["singleLogoutService"]["responseUrl"] + self.assertEqual(settings.get_idp_slo_response_url(), slo_url) + # test that the function falls back to the url setting if responseUrl is not set + settings_info["idp"]["singleLogoutService"].pop("responseUrl") + settings = OneLogin_Saml2_Settings(settings_info) + slo_url = settings_info["idp"]["singleLogoutService"]["url"] + self.assertEqual(settings.get_idp_slo_response_url(), slo_url) def testGetSPCert(self): """ @@ -175,12 +254,12 @@ def testGetSPCert(self): self.assertEqual(cert, settings.get_sp_cert()) cert_2 = "-----BEGIN CERTIFICATE-----\nMIICbDCCAdWgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBTMQswCQYDVQQGEwJ1czET\nMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRgwFgYD\nVQQDDA9pZHAuZXhhbXBsZS5jb20wHhcNMTQwOTIzMTIyNDA4WhcNNDIwMjA4MTIy\nNDA4WjBTMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UE\nCgwMT25lbG9naW4gSW5jMRgwFgYDVQQDDA9pZHAuZXhhbXBsZS5jb20wgZ8wDQYJ\nKoZIhvcNAQEBBQADgY0AMIGJAoGBAOWA+YHU7cvPOrBOfxCscsYTJB+kH3MaA9BF\nrSHFS+KcR6cw7oPSktIJxUgvDpQbtfNcOkE/tuOPBDoech7AXfvH6d7Bw7xtW8PP\nJ2mB5Hn/HGW2roYhxmfh3tR5SdwN6i4ERVF8eLkvwCHsNQyK2Ref0DAJvpBNZMHC\npS24916/AgMBAAGjUDBOMB0GA1UdDgQWBBQ77/qVeiigfhYDITplCNtJKZTM8DAf\nBgNVHSMEGDAWgBQ77/qVeiigfhYDITplCNtJKZTM8DAMBgNVHRMEBTADAQH/MA0G\nCSqGSIb3DQEBDQUAA4GBAJO2j/1uO80E5C2PM6Fk9mzerrbkxl7AZ/mvlbOn+sNZ\nE+VZ1AntYuG8ekbJpJtG1YfRfc7EA9mEtqvv4dhv7zBy4nK49OR+KpIBjItWB5kY\nvrqMLKBa32sMbgqqUqeF1ENXKjpvLSuPdfGJZA3dNa/+Dyb8GGqWe707zLyc5F8m\n-----END CERTIFICATE-----\n" - settings_data['sp']['x509cert'] = cert_2 + settings_data["sp"]["x509cert"] = cert_2 settings = OneLogin_Saml2_Settings(settings_data) self.assertEqual(cert_2, settings.get_sp_cert()) - del settings_data['sp']['x509cert'] - del settings_data['custom_base_path'] + del settings_data["sp"]["x509cert"] + del settings_data["custom_base_path"] custom_base_path = dirname(__file__) settings_3 = OneLogin_Saml2_Settings(settings_data, custom_base_path=custom_base_path) @@ -196,7 +275,7 @@ def testGetSPCertNew(self): self.assertEqual(cert, settings.get_sp_cert()) self.assertIsNone(settings.get_sp_cert_new()) - settings = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings7.json')) + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings7.json")) cert_new = "-----BEGIN CERTIFICATE-----\nMIICVDCCAb2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBHMQswCQYDVQQGEwJ1czEQ\nMA4GA1UECAwHZXhhbXBsZTEQMA4GA1UECgwHZXhhbXBsZTEUMBIGA1UEAwwLZXhh\nbXBsZS5jb20wHhcNMTcwNDA3MDgzMDAzWhcNMjcwNDA1MDgzMDAzWjBHMQswCQYD\nVQQGEwJ1czEQMA4GA1UECAwHZXhhbXBsZTEQMA4GA1UECgwHZXhhbXBsZTEUMBIG\nA1UEAwwLZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKhP\nS4/0azxbQekHHewQGKD7Pivr3CDpsrKxY3xlVanxj427OwzOb5KUVzsDEazumt6s\nZFY8HfidsjXY4EYA4ZzyL7ciIAR5vlAsIYN9nJ4AwVDnN/RjVwj+TN6BqWPLpVIp\nHc6Dl005HyE0zJnk1DZDn2tQVrIzbD3FhCp7YeotAgMBAAGjUDBOMB0GA1UdDgQW\nBBRYZx4thASfNvR/E7NsCF2IaZ7wIDAfBgNVHSMEGDAWgBRYZx4thASfNvR/E7Ns\nCF2IaZ7wIDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBDQUAA4GBACz4aobx9aG3\nkh+rNyrlgM3K6dYfnKG1/YH5sJCAOvg8kDr0fQAQifH8lFVWumKUMoAe0bFTfwWt\np/VJ8MprrEJth6PFeZdczpuv+fpLcNj2VmNVJqvQYvS4m36OnBFh1QFZW8UrbFIf\ndtm2nuZ+twSKqfKwjLdqcoX0p39h7Uw/\n-----END CERTIFICATE-----\n" self.assertEqual(cert, settings.get_sp_cert()) self.assertEqual(cert_new, settings.get_sp_cert_new()) @@ -211,17 +290,39 @@ def testGetSPKey(self): self.assertEqual(key, settings.get_sp_key()) key_2 = "-----BEGIN PRIVATE KEY-----\nMIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAOWA+YHU7cvPOrBO\nfxCscsYTJB+kH3MaA9BFrSHFS+KcR6cw7oPSktIJxUgvDpQbtfNcOkE/tuOPBDoe\nch7AXfvH6d7Bw7xtW8PPJ2mB5Hn/HGW2roYhxmfh3tR5SdwN6i4ERVF8eLkvwCHs\nNQyK2Ref0DAJvpBNZMHCpS24916/AgMBAAECgYEA0wDXZPS9hKqMTNh+nnfONioX\nBjhA6fQ7GVtWKDxa3ofMoPyt7ejGL/Hnvcv13Vn02UAsFx1bKrCstDqVtYwrWrnm\nywXyH+o9paJnTmd+cRIjWU8mRvCrxzH5I/Bcvbp1qZoASuqZEaGwNjM6JpW2o3QT\nmHGMALcLUPfEvhApssECQQDy2e65E86HcFhi/Ta8TQ0odDCNbiWA0bI1Iu8B7z+N\nAy1D1+WnCd7w2u9U6CF/k2nFHCsvxEoeANM0z7h5T/XvAkEA8e4JqKmDrfdiakQT\n7nf9svU2jXZtxSbPiIRMafNikDvzZ1vJCZkvdmaWYL70GlDZIwc9ad67rHZ/n/fq\nX1d0MQJAbRpRsJ5gY+KqItbFt3UaWzlP8sowWR5cZJjsLb9RmsV5mYguKYw6t5R0\nf33GRu1wUFimYlBaR/5w5MIJi57LywJATO1a5uWX+G5MPewNxmsjIY91XEAHIYR4\nwzkGLz5z3dciS4BVCZdLD0QJlxPA/MkuckPwFET9uhYn+M7VGKHvUQJBANSDwsY+\nBdCGpi/WRV37HUfwLl07damaFbW3h08PQx8G8SuF7DpN+FPBcI6VhzrIWNRBxWpr\nkgeGioKNfFWzSaM=\n-----END PRIVATE KEY-----\n" - settings_data['sp']['privateKey'] = key_2 + settings_data["sp"]["privateKey"] = key_2 settings_2 = OneLogin_Saml2_Settings(settings_data) self.assertEqual(key_2, settings_2.get_sp_key()) - del settings_data['sp']['privateKey'] - del settings_data['custom_base_path'] + del settings_data["sp"]["privateKey"] + del settings_data["custom_base_path"] custom_base_path = dirname(__file__) settings_3 = OneLogin_Saml2_Settings(settings_data, custom_base_path=custom_base_path) self.assertIsNone(settings_3.get_sp_key()) + def testGetIDPCert(self): + """ + Tests the get_idp_cert method of the OneLogin_Saml2_Settings + """ + + settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings9.json")) + cert = "-----BEGIN CERTIFICATE-----\nMIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC\nTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD\nVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG\n9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4\nMTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi\nZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl\naWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO\nNoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS\nKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d\n1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8\nBUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n\nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar\nQ4/67OZfHd7R+POBXhophSMv1ZOo\n-----END CERTIFICATE-----" + self.assertEqual(cert, settings.get_idp_cert()) + + settings_data = self.loadSettingsJSON() + + settings = OneLogin_Saml2_Settings(settings_data) + settings_data["idp"]["x509cert"] = cert + self.assertEqual(cert, settings.get_idp_cert()) + + del settings_data["idp"]["x509cert"] + del settings_data["custom_base_path"] + custom_base_path = dirname(__file__) + + settings_3 = OneLogin_Saml2_Settings(settings_data, custom_base_path=custom_base_path) + self.assertIsNone(settings_3.get_idp_cert()) + def testFormatIdPCert(self): """ Tests the format_idp_cert method of the OneLogin_Saml2_Settings @@ -232,7 +333,7 @@ def testFormatIdPCert(self): self.assertEqual(cert, settings.get_idp_cert()) cert_2 = "-----BEGIN CERTIFICATE-----\nMIICbDCCAdWgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBTMQswCQYDVQQGEwJ1czET\nMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRgwFgYD\nVQQDDA9pZHAuZXhhbXBsZS5jb20wHhcNMTQwOTIzMTIyNDA4WhcNNDIwMjA4MTIy\nNDA4WjBTMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UE\nCgwMT25lbG9naW4gSW5jMRgwFgYDVQQDDA9pZHAuZXhhbXBsZS5jb20wgZ8wDQYJ\nKoZIhvcNAQEBBQADgY0AMIGJAoGBAOWA+YHU7cvPOrBOfxCscsYTJB+kH3MaA9BF\nrSHFS+KcR6cw7oPSktIJxUgvDpQbtfNcOkE/tuOPBDoech7AXfvH6d7Bw7xtW8PP\nJ2mB5Hn/HGW2roYhxmfh3tR5SdwN6i4ERVF8eLkvwCHsNQyK2Ref0DAJvpBNZMHC\npS24916/AgMBAAGjUDBOMB0GA1UdDgQWBBQ77/qVeiigfhYDITplCNtJKZTM8DAf\nBgNVHSMEGDAWgBQ77/qVeiigfhYDITplCNtJKZTM8DAMBgNVHRMEBTADAQH/MA0G\nCSqGSIb3DQEBDQUAA4GBAJO2j/1uO80E5C2PM6Fk9mzerrbkxl7AZ/mvlbOn+sNZ\nE+VZ1AntYuG8ekbJpJtG1YfRfc7EA9mEtqvv4dhv7zBy4nK49OR+KpIBjItWB5kY\nvrqMLKBa32sMbgqqUqeF1ENXKjpvLSuPdfGJZA3dNa/+Dyb8GGqWe707zLyc5F8m\n-----END CERTIFICATE-----\n" - settings_data['idp']['x509cert'] = cert_2 + settings_data["idp"]["x509cert"] = cert_2 settings = OneLogin_Saml2_Settings(settings_data) self.assertEqual(cert_2, settings.get_idp_cert()) @@ -246,12 +347,12 @@ def testFormatSPCert(self): settings = OneLogin_Saml2_Settings(settings_data) self.assertEqual(cert, settings.get_sp_cert()) - settings_data['sp']['x509cert'] = cert + settings_data["sp"]["x509cert"] = cert settings = OneLogin_Saml2_Settings(settings_data) self.assertEqual(cert, settings.get_sp_cert()) cert_2 = "-----BEGIN CERTIFICATE-----\nMIICbDCCAdWgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBTMQswCQYDVQQGEwJ1czET\nMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRgwFgYD\nVQQDDA9pZHAuZXhhbXBsZS5jb20wHhcNMTQwOTIzMTIyNDA4WhcNNDIwMjA4MTIy\nNDA4WjBTMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UE\nCgwMT25lbG9naW4gSW5jMRgwFgYDVQQDDA9pZHAuZXhhbXBsZS5jb20wgZ8wDQYJ\nKoZIhvcNAQEBBQADgY0AMIGJAoGBAOWA+YHU7cvPOrBOfxCscsYTJB+kH3MaA9BF\nrSHFS+KcR6cw7oPSktIJxUgvDpQbtfNcOkE/tuOPBDoech7AXfvH6d7Bw7xtW8PP\nJ2mB5Hn/HGW2roYhxmfh3tR5SdwN6i4ERVF8eLkvwCHsNQyK2Ref0DAJvpBNZMHC\npS24916/AgMBAAGjUDBOMB0GA1UdDgQWBBQ77/qVeiigfhYDITplCNtJKZTM8DAf\nBgNVHSMEGDAWgBQ77/qVeiigfhYDITplCNtJKZTM8DAMBgNVHRMEBTADAQH/MA0G\nCSqGSIb3DQEBDQUAA4GBAJO2j/1uO80E5C2PM6Fk9mzerrbkxl7AZ/mvlbOn+sNZ\nE+VZ1AntYuG8ekbJpJtG1YfRfc7EA9mEtqvv4dhv7zBy4nK49OR+KpIBjItWB5kY\nvrqMLKBa32sMbgqqUqeF1ENXKjpvLSuPdfGJZA3dNa/+Dyb8GGqWe707zLyc5F8m\n-----END CERTIFICATE-----\n" - settings_data['sp']['x509cert'] = cert_2 + settings_data["sp"]["x509cert"] = cert_2 settings = OneLogin_Saml2_Settings(settings_data) self.assertEqual(cert_2, settings.get_sp_cert()) @@ -261,12 +362,12 @@ def testFormatSPKey(self): """ settings_data = self.loadSettingsJSON() key = "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9\nIbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+\nPbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQAB\nAoGAD4/Z4LWVWV6D1qMIp1Gzr0ZmdWTE1SPdZ7Ej8glGnCzPdguCPuzbhGXmIg0V\nJ5D+02wsqws1zd48JSMXXM8zkYZVwQYIPUsNn5FetQpwxDIMPmhHg+QNBgwOnk8J\nK2sIjjLPL7qY7Itv7LT7Gvm5qSOkZ33RCgXcgz+okEIQMYkCQQDzbTOyDL0c5WQV\n6A2k06T/azdhUdGXF9C0+WkWSfNaovmTgRXh1G+jMlr82Snz4p4/STt7P/XtyWzF\n3pkVgZr3AkEA7nPjXwHlttNEMo6AtxHd47nizK2NUN803ElIUT8P9KSCoERmSXq6\n6PDekGNic4ldpsSvOeYCk8MAYoDBy9kvVwJBAMLgX4xg6lzhv7hR5+pWjTb1rIY6\nrCHbrPfU264+UZXz9v2BT/VUznLF81WMvStD9xAPHpFS6R0OLghSZhdzhI0CQQDL\n8Duvfxzrn4b9QlmduV8wLERoT6rEVxKLsPVz316TGrxJvBZLk/cV0SRZE1cZf4uk\nXSWMfEcJ/0Zt+LdG1CqjAkEAqwLSglJ9Dy3HpgMz4vAAyZWzAxvyA1zW0no9GOLc\nPQnYaNUN/Fy2SYtETXTb0CQ9X1rt8ffkFP7ya+5TC83aMg==\n-----END RSA PRIVATE KEY-----\n" - settings_data['sp']['privateKey'] = key + settings_data["sp"]["privateKey"] = key settings = OneLogin_Saml2_Settings(settings_data) self.assertEqual(key, settings.get_sp_key()) key_2 = "-----BEGIN PRIVATE KEY-----\nMIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAOWA+YHU7cvPOrBO\nfxCscsYTJB+kH3MaA9BFrSHFS+KcR6cw7oPSktIJxUgvDpQbtfNcOkE/tuOPBDoe\nch7AXfvH6d7Bw7xtW8PPJ2mB5Hn/HGW2roYhxmfh3tR5SdwN6i4ERVF8eLkvwCHs\nNQyK2Ref0DAJvpBNZMHCpS24916/AgMBAAECgYEA0wDXZPS9hKqMTNh+nnfONioX\nBjhA6fQ7GVtWKDxa3ofMoPyt7ejGL/Hnvcv13Vn02UAsFx1bKrCstDqVtYwrWrnm\nywXyH+o9paJnTmd+cRIjWU8mRvCrxzH5I/Bcvbp1qZoASuqZEaGwNjM6JpW2o3QT\nmHGMALcLUPfEvhApssECQQDy2e65E86HcFhi/Ta8TQ0odDCNbiWA0bI1Iu8B7z+N\nAy1D1+WnCd7w2u9U6CF/k2nFHCsvxEoeANM0z7h5T/XvAkEA8e4JqKmDrfdiakQT\n7nf9svU2jXZtxSbPiIRMafNikDvzZ1vJCZkvdmaWYL70GlDZIwc9ad67rHZ/n/fq\nX1d0MQJAbRpRsJ5gY+KqItbFt3UaWzlP8sowWR5cZJjsLb9RmsV5mYguKYw6t5R0\nf33GRu1wUFimYlBaR/5w5MIJi57LywJATO1a5uWX+G5MPewNxmsjIY91XEAHIYR4\nwzkGLz5z3dciS4BVCZdLD0QJlxPA/MkuckPwFET9uhYn+M7VGKHvUQJBANSDwsY+\nBdCGpi/WRV37HUfwLl07damaFbW3h08PQx8G8SuF7DpN+FPBcI6VhzrIWNRBxWpr\nkgeGioKNfFWzSaM=\n-----END PRIVATE KEY-----\n" - settings_data['sp']['privateKey'] = key_2 + settings_data["sp"]["privateKey"] = key_2 settings_2 = OneLogin_Saml2_Settings(settings_data) self.assertEqual(key_2, settings_2.get_sp_key()) @@ -287,112 +388,93 @@ def testCheckSettings(self): OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('Invalid dict settings: invalid_syntax', str(e)) + self.assertIn("Invalid dict settings: invalid_syntax", str(e)) - settings_info['strict'] = True + settings_info["strict"] = True try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('idp_not_found', str(e)) - self.assertIn('sp_not_found', str(e)) - - settings_info['idp'] = {} - settings_info['idp']['x509cert'] = '' - settings_info['sp'] = {} - settings_info['sp']['entityID'] = 'SPentityId' - settings_info['security'] = {} - settings_info['security']['signMetadata'] = False + self.assertIn("idp_not_found", str(e)) + self.assertIn("sp_not_found", str(e)) + + settings_info["idp"] = {} + settings_info["idp"]["x509cert"] = "" + settings_info["sp"] = {} + settings_info["sp"]["entityID"] = "SPentityId" + settings_info["security"] = {} + settings_info["security"]["signMetadata"] = False try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('idp_entityId_not_found', str(e)) - self.assertIn('idp_sso_not_found', str(e)) - self.assertIn('sp_entityId_not_found', str(e)) - self.assertIn('sp_acs_not_found', str(e)) + self.assertIn("idp_entityId_not_found", str(e)) + self.assertIn("idp_sso_not_found", str(e)) + self.assertIn("sp_entityId_not_found", str(e)) + self.assertIn("sp_acs_not_found", str(e)) # AttributeConsumingService tests # serviceName, requestedAttributes are required - settings_info['sp']['attributeConsumingService'] = { - "serviceDescription": "Test Service" - } + settings_info["sp"]["attributeConsumingService"] = {"serviceDescription": "Test Service"} try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('sp_attributeConsumingService_serviceName_not_found', str(e)) - self.assertIn('sp_attributeConsumingService_requestedAttributes_not_found', str(e)) + self.assertIn("sp_attributeConsumingService_serviceName_not_found", str(e)) + self.assertIn("sp_attributeConsumingService_requestedAttributes_not_found", str(e)) # requestedAttributes/name is required - settings_info['sp']['attributeConsumingService'] = { + settings_info["sp"]["attributeConsumingService"] = { "serviceName": {}, "serviceDescription": ["Test Service"], - "requestedAttributes": [{ - "nameFormat": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri", - "friendlyName": "givenName", - "isRequired": "False" - } - ] + "requestedAttributes": [{"nameFormat": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "friendlyName": "givenName", "isRequired": "False"}], } try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('sp_attributeConsumingService_requestedAttributes_name_not_found', str(e)) - self.assertIn('sp_attributeConsumingService_requestedAttributes_isRequired_type_invalid', str(e)) - self.assertIn('sp_attributeConsumingService_serviceDescription_type_invalid', str(e)) - self.assertIn('sp_attributeConsumingService_serviceName_type_invalid', str(e)) - - settings_info['idp']['entityID'] = 'entityId' - settings_info['idp']['singleSignOnService'] = {} - settings_info['idp']['singleSignOnService']['url'] = 'invalid_value' - settings_info['idp']['singleLogoutService'] = {} - settings_info['idp']['singleLogoutService']['url'] = 'invalid_value' - settings_info['sp']['assertionConsumerService'] = {} - settings_info['sp']['assertionConsumerService']['url'] = 'invalid_value' - settings_info['sp']['singleLogoutService'] = {} - settings_info['sp']['singleLogoutService']['url'] = 'invalid_value' + self.assertIn("sp_attributeConsumingService_requestedAttributes_name_not_found", str(e)) + self.assertIn("sp_attributeConsumingService_requestedAttributes_isRequired_type_invalid", str(e)) + self.assertIn("sp_attributeConsumingService_serviceDescription_type_invalid", str(e)) + self.assertIn("sp_attributeConsumingService_serviceName_type_invalid", str(e)) + + settings_info["idp"]["entityID"] = "entityId" + settings_info["idp"]["singleSignOnService"] = {} + settings_info["idp"]["singleSignOnService"]["url"] = "invalid_value" + settings_info["idp"]["singleLogoutService"] = {} + settings_info["idp"]["singleLogoutService"]["url"] = "invalid_value" + settings_info["sp"]["assertionConsumerService"] = {} + settings_info["sp"]["assertionConsumerService"]["url"] = "invalid_value" + settings_info["sp"]["singleLogoutService"] = {} + settings_info["sp"]["singleLogoutService"]["url"] = "invalid_value" try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('idp_sso_url_invalid', str(e)) - self.assertIn('idp_slo_url_invalid', str(e)) - self.assertIn('sp_acs_url_invalid', str(e)) - self.assertIn('sp_sls_url_invalid', str(e)) + self.assertIn("idp_sso_url_invalid", str(e)) + self.assertIn("idp_slo_url_invalid", str(e)) + self.assertIn("sp_acs_url_invalid", str(e)) + self.assertIn("sp_sls_url_invalid", str(e)) - settings_info['security']['wantAssertionsSigned'] = True + settings_info["security"]["wantAssertionsSigned"] = True try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('idp_cert_or_fingerprint_not_found_and_required', str(e)) + self.assertIn("idp_cert_or_fingerprint_not_found_and_required", str(e)) settings_info = self.loadSettingsJSON() - settings_info['security']['signMetadata'] = {} - settings_info['security']['signMetadata']['keyFileName'] = 'metadata.key' - settings_info['organization'] = { - 'en-US': { - 'name': 'miss_information' - } - } - settings_info['contactPerson'] = { - 'support': { - 'givenName': 'support_name' - }, - 'auxiliar': { - 'givenName': 'auxiliar_name', - 'emailAddress': 'auxiliar@example.com' - } - } + settings_info["security"]["signMetadata"] = {} + settings_info["security"]["signMetadata"]["keyFileName"] = "metadata.key" + settings_info["organization"] = {"en-US": {"name": "miss_information"}} + settings_info["contactPerson"] = {"support": {"givenName": "support_name"}, "auxiliar": {"givenName": "auxiliar_name", "emailAddress": "auxiliar@example.com"}} try: OneLogin_Saml2_Settings(settings_info) self.assertTrue(False) except Exception as e: - self.assertIn('sp_signMetadata_invalid', str(e)) - self.assertIn('organization_not_enought_data', str(e)) - self.assertIn('contact_type_invalid', str(e)) + self.assertIn("sp_signMetadata_invalid", str(e)) + self.assertIn("organization_not_enought_data", str(e)) + self.assertIn("contact_type_invalid", str(e)) def testGetSPMetadata(self): """ @@ -400,28 +482,28 @@ def testGetSPMetadata(self): Case unsigned metadata """ settings_info = self.loadSettingsJSON() - settings_info['security']['wantNameIdEncrypted'] = False - settings_info['security']['wantAssertionsEncrypted'] = False + settings_info["security"]["wantNameIdEncrypted"] = False + settings_info["security"]["wantAssertionsEncrypted"] = False settings = OneLogin_Saml2_Settings(settings_info) metadata = compat.to_string(settings.get_sp_metadata()) self.assertNotEqual(len(metadata), 0) - self.assertIn('', metadata) self.assertIn('', metadata) - self.assertIn('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', metadata) - self.assertEqual(1, metadata.count('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", metadata) + self.assertEqual(1, metadata.count("', metadata) self.assertIn('', metadata) - self.assertIn('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', metadata) + self.assertIn("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", metadata) self.assertIn('\n', metadata) - self.assertIn('', metadata) - self.assertIn('\n\n', metadata) + self.assertIn('', metadata) + self.assertIn("\n\n", metadata) def testGetSPMetadataSignedNoMetadataCert(self): """ @@ -511,36 +593,30 @@ def testGetSPMetadataSignedNoMetadataCert(self): Case signed metadata with specific certs """ settings_info = self.loadSettingsJSON() - if 'security' not in settings_info: - settings_info['security'] = {} - settings_info['security']['signMetadata'] = {} + if "security" not in settings_info: + settings_info["security"] = {} + settings_info["security"]["signMetadata"] = {} with self.assertRaises(Exception) as context: OneLogin_Saml2_Settings(settings_info) exception = context.exception self.assertIn("sp_signMetadata_invalid", str(exception)) - settings_info['security']['signMetadata'] = { - 'keyFileName': 'noexist.key', - 'certFileName': 'sp.crt' - } + settings_info["security"]["signMetadata"] = {"keyFileName": "noexist.key", "certFileName": "sp.crt"} settings = OneLogin_Saml2_Settings(settings_info) with self.assertRaises(Exception) as context: settings.get_sp_metadata() exception = context.exception self.assertIn("Private key file not readable", str(exception)) - settings_info['security']['signMetadata'] = { - 'keyFileName': 'sp.key', - 'certFileName': 'noexist.crt' - } + settings_info["security"]["signMetadata"] = {"keyFileName": "sp.key", "certFileName": "noexist.crt"} settings = OneLogin_Saml2_Settings(settings_info) with self.assertRaises(Exception) as context: settings.get_sp_metadata() exception = context.exception self.assertIn("Public cert file not readable", str(exception)) - settings_info['security']['signMetadata'] = 'invalid_value' + settings_info["security"]["signMetadata"] = "invalid_value" settings = OneLogin_Saml2_Settings(settings_info) with self.assertRaises(Exception) as context: settings.get_sp_metadata() @@ -556,19 +632,19 @@ def testValidateMetadata(self): metadata = settings.get_sp_metadata() self.assertEqual(len(settings.validate_metadata(metadata)), 0) - xml = self.file_contents(join(self.data_path, 'metadata', 'metadata_settings1.xml')) + xml = self.file_contents(join(self.data_path, "metadata", "metadata_settings1.xml")) self.assertEqual(len(settings.validate_metadata(xml)), 0) - xml_2 = 'invalid' - self.assertIn('invalid_xml', settings.validate_metadata(xml_2)) + xml_2 = "invalid" + self.assertIn("invalid_xml", settings.validate_metadata(xml_2)) - xml_3 = self.file_contents(join(self.data_path, 'metadata', 'entities_metadata.xml')) - self.assertIn('noEntityDescriptor_xml', settings.validate_metadata(xml_3)) + xml_3 = self.file_contents(join(self.data_path, "metadata", "entities_metadata.xml")) + self.assertIn("noEntityDescriptor_xml", settings.validate_metadata(xml_3)) - xml_4 = self.file_contents(join(self.data_path, 'metadata', 'idp_metadata.xml')) - self.assertIn('onlySPSSODescriptor_allowed_xml', settings.validate_metadata(xml_4)) + xml_4 = self.file_contents(join(self.data_path, "metadata", "idp_metadata.xml")) + self.assertIn("onlySPSSODescriptor_allowed_xml", settings.validate_metadata(xml_4)) - xml_5 = self.file_contents(join(self.data_path, 'metadata', 'no_expiration_mark_metadata.xml')) + xml_5 = self.file_contents(join(self.data_path, "metadata", "no_expiration_mark_metadata.xml")) self.assertEqual(len(settings.validate_metadata(xml_5)), 0) def testValidateMetadataExpired(self): @@ -576,10 +652,10 @@ def testValidateMetadataExpired(self): Tests the validateMetadata method of the OneLogin_Saml2_Settings """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - metadata = self.file_contents(join(self.data_path, 'metadata', 'expired_metadata_settings1.xml')) + metadata = self.file_contents(join(self.data_path, "metadata", "expired_metadata_settings1.xml")) errors = settings.validate_metadata(metadata) self.assertNotEqual(len(metadata), 0) - self.assertIn('expired_xml', errors) + self.assertIn("expired_xml", errors) def testValidateMetadataNoXML(self): """ @@ -587,17 +663,17 @@ def testValidateMetadataNoXML(self): Case no metadata """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - metadata = '' + metadata = "" with self.assertRaises(Exception) as context: settings.validate_metadata(metadata) exception = context.exception self.assertIn("t", str(exception)) - metadata = '' + metadata = "" errors = settings.validate_metadata(metadata) self.assertNotEqual(len(errors), 0) - self.assertIn('unloaded_xml', errors) + self.assertIn("unloaded_xml", errors) def testValidateMetadataNoEntity(self): """ @@ -605,10 +681,10 @@ def testValidateMetadataNoEntity(self): Case invalid xml metadata """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - metadata = self.file_contents(join(self.data_path, 'metadata', 'noentity_metadata_settings1.xml')) + metadata = self.file_contents(join(self.data_path, "metadata", "noentity_metadata_settings1.xml")) errors = settings.validate_metadata(metadata) self.assertNotEqual(len(metadata), 0) - self.assertIn('invalid_xml', errors) + self.assertIn("invalid_xml", errors) def testGetIdPData(self): """ @@ -618,18 +694,18 @@ def testGetIdPData(self): idp_data = settings.get_idp_data() self.assertNotEqual(len(idp_data), 0) - self.assertIn('entityId', idp_data) - self.assertIn('singleSignOnService', idp_data) - self.assertIn('singleLogoutService', idp_data) - self.assertIn('x509cert', idp_data) + self.assertIn("entityId", idp_data) + self.assertIn("singleSignOnService", idp_data) + self.assertIn("singleLogoutService", idp_data) + self.assertIn("x509cert", idp_data) - self.assertEqual('http://idp.example.com/', idp_data['entityId']) - self.assertEqual('http://idp.example.com/SSOService.php', idp_data['singleSignOnService']['url']) - self.assertEqual('http://idp.example.com/SingleLogoutService.php', idp_data['singleLogoutService']['url']) + self.assertEqual("http://idp.example.com/", idp_data["entityId"]) + self.assertEqual("http://idp.example.com/SSOService.php", idp_data["singleSignOnService"]["url"]) + self.assertEqual("http://idp.example.com/SingleLogoutService.php", idp_data["singleLogoutService"]["url"]) - x509cert = 'MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMCTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYDVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xiZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2ZlaWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo' + x509cert = "MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMCTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYDVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xiZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2ZlaWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo" formated_x509_cert = OneLogin_Saml2_Utils.format_cert(x509cert) - self.assertEqual(formated_x509_cert, idp_data['x509cert']) + self.assertEqual(formated_x509_cert, idp_data["x509cert"]) def testGetSPData(self): """ @@ -639,15 +715,15 @@ def testGetSPData(self): sp_data = settings.get_sp_data() self.assertNotEqual(len(sp_data), 0) - self.assertIn('entityId', sp_data) - self.assertIn('assertionConsumerService', sp_data) - self.assertIn('singleLogoutService', sp_data) - self.assertIn('NameIDFormat', sp_data) + self.assertIn("entityId", sp_data) + self.assertIn("assertionConsumerService", sp_data) + self.assertIn("singleLogoutService", sp_data) + self.assertIn("NameIDFormat", sp_data) - self.assertEqual('http://stuff.com/endpoints/metadata.php', sp_data['entityId']) - self.assertEqual('http://stuff.com/endpoints/endpoints/acs.php', sp_data['assertionConsumerService']['url']) - self.assertEqual('http://stuff.com/endpoints/endpoints/sls.php', sp_data['singleLogoutService']['url']) - self.assertEqual('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', sp_data['NameIDFormat']) + self.assertEqual("http://stuff.com/endpoints/metadata.php", sp_data["entityId"]) + self.assertEqual("http://stuff.com/endpoints/endpoints/acs.php", sp_data["assertionConsumerService"]["url"]) + self.assertEqual("http://stuff.com/endpoints/endpoints/sls.php", sp_data["singleLogoutService"]["url"]) + self.assertEqual("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", sp_data["NameIDFormat"]) def testGetSecurityData(self): """ @@ -657,55 +733,55 @@ def testGetSecurityData(self): security = settings.get_security_data() self.assertNotEqual(len(security), 0) - self.assertIn('nameIdEncrypted', security) - self.assertIn('authnRequestsSigned', security) - self.assertIn('logoutRequestSigned', security) - self.assertIn('logoutResponseSigned', security) - self.assertIn('signMetadata', security) - self.assertIn('wantMessagesSigned', security) - self.assertIn('wantAssertionsSigned', security) - self.assertIn('requestedAuthnContext', security) - self.assertIn('wantNameId', security) - self.assertIn('wantNameIdEncrypted', security) + self.assertIn("nameIdEncrypted", security) + self.assertIn("authnRequestsSigned", security) + self.assertIn("logoutRequestSigned", security) + self.assertIn("logoutResponseSigned", security) + self.assertIn("signMetadata", security) + self.assertIn("wantMessagesSigned", security) + self.assertIn("wantAssertionsSigned", security) + self.assertIn("requestedAuthnContext", security) + self.assertIn("wantNameId", security) + self.assertIn("wantNameIdEncrypted", security) def testGetDefaultSecurityValues(self): """ Tests default values of Security advanced sesettings """ settings_json = self.loadSettingsJSON() - del settings_json['security'] + del settings_json["security"] settings = OneLogin_Saml2_Settings(settings_json) security = settings.get_security_data() - self.assertIn('nameIdEncrypted', security) - self.assertFalse(security.get('nameIdEncrypted')) + self.assertIn("nameIdEncrypted", security) + self.assertFalse(security.get("nameIdEncrypted")) - self.assertIn('authnRequestsSigned', security) - self.assertFalse(security.get('authnRequestsSigned')) + self.assertIn("authnRequestsSigned", security) + self.assertFalse(security.get("authnRequestsSigned")) - self.assertIn('logoutRequestSigned', security) - self.assertFalse(security.get('logoutRequestSigned')) + self.assertIn("logoutRequestSigned", security) + self.assertFalse(security.get("logoutRequestSigned")) - self.assertIn('logoutResponseSigned', security) - self.assertFalse(security.get('logoutResponseSigned')) + self.assertIn("logoutResponseSigned", security) + self.assertFalse(security.get("logoutResponseSigned")) - self.assertIn('signMetadata', security) - self.assertFalse(security.get('signMetadata')) + self.assertIn("signMetadata", security) + self.assertFalse(security.get("signMetadata")) - self.assertIn('wantMessagesSigned', security) - self.assertFalse(security.get('wantMessagesSigned')) + self.assertIn("wantMessagesSigned", security) + self.assertFalse(security.get("wantMessagesSigned")) - self.assertIn('wantAssertionsSigned', security) - self.assertFalse(security.get('wantAssertionsSigned')) + self.assertIn("wantAssertionsSigned", security) + self.assertFalse(security.get("wantAssertionsSigned")) - self.assertIn('requestedAuthnContext', security) - self.assertTrue(security.get('requestedAuthnContext')) + self.assertIn("requestedAuthnContext", security) + self.assertTrue(security.get("requestedAuthnContext")) - self.assertIn('wantNameId', security) - self.assertTrue(security.get('wantNameId')) + self.assertIn("wantNameId", security) + self.assertTrue(security.get("wantNameId")) - self.assertIn('wantNameIdEncrypted', security) - self.assertFalse(security.get('wantNameIdEncrypted')) + self.assertIn("wantNameIdEncrypted", security) + self.assertFalse(security.get("wantNameIdEncrypted")) def testGetContacts(self): """ @@ -715,10 +791,10 @@ def testGetContacts(self): contacts = settings.get_contacts() self.assertNotEqual(len(contacts), 0) - self.assertEqual('technical_name', contacts['technical']['givenName']) - self.assertEqual('technical@example.com', contacts['technical']['emailAddress']) - self.assertEqual('support_name', contacts['support']['givenName']) - self.assertEqual('support@example.com', contacts['support']['emailAddress']) + self.assertEqual("technical_name", contacts["technical"]["givenName"]) + self.assertEqual("technical@example.com", contacts["technical"]["emailAddress"]) + self.assertEqual("support_name", contacts["support"]["givenName"]) + self.assertEqual("support@example.com", contacts["support"]["emailAddress"]) def testGetOrganization(self): """ @@ -728,9 +804,9 @@ def testGetOrganization(self): organization = settings.get_organization() self.assertNotEqual(len(organization), 0) - self.assertEqual('sp_test', organization['en-US']['name']) - self.assertEqual('SP test', organization['en-US']['displayname']) - self.assertEqual('http://sp.example.com', organization['en-US']['url']) + self.assertEqual("sp_test", organization["en-US"]["name"]) + self.assertEqual("SP test", organization["en-US"]["displayname"]) + self.assertEqual("http://sp.example.com", organization["en-US"]["url"]) def testSetStrict(self): """ @@ -745,23 +821,23 @@ def testSetStrict(self): settings.set_strict(False) self.assertFalse(settings.is_strict()) - self.assertRaises(AssertionError, settings.set_strict, 'a') + self.assertRaises(AssertionError, settings.set_strict, "a") def testIsStrict(self): """ Tests the isStrict method of the OneLogin_Saml2_Settings """ settings_info = self.loadSettingsJSON() - del settings_info['strict'] + del settings_info["strict"] settings = OneLogin_Saml2_Settings(settings_info) - self.assertFalse(settings.is_strict()) + self.assertTrue(settings.is_strict()) - settings_info['strict'] = False + settings_info["strict"] = False settings_2 = OneLogin_Saml2_Settings(settings_info) self.assertFalse(settings_2.is_strict()) - settings_info['strict'] = True + settings_info["strict"] = True settings_3 = OneLogin_Saml2_Settings(settings_info) self.assertTrue(settings_3.is_strict()) @@ -770,15 +846,15 @@ def testIsDebugActive(self): Tests the isDebugActive method of the OneLogin_Saml2_Settings """ settings_info = self.loadSettingsJSON() - del settings_info['debug'] + del settings_info["debug"] settings = OneLogin_Saml2_Settings(settings_info) self.assertFalse(settings.is_debug_active()) - settings_info['debug'] = False + settings_info["debug"] = False settings_2 = OneLogin_Saml2_Settings(settings_info) self.assertFalse(settings_2.is_debug_active()) - settings_info['debug'] = True + settings_info["debug"] = True settings_3 = OneLogin_Saml2_Settings(settings_info) self.assertTrue(settings_3.is_debug_active()) diff --git a/tests/src/OneLogin/saml2_tests/signed_response_test.py b/tests/src/OneLogin/saml2_tests/signed_response_test.py index 45afb505..844fc930 100644 --- a/tests/src/OneLogin/saml2_tests/signed_response_test.py +++ b/tests/src/OneLogin/saml2_tests/signed_response_test.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json from os.path import dirname, join, exists @@ -13,20 +11,20 @@ class OneLogin_Saml2_SignedResponse_Test(unittest.TestCase): - data_path = join(dirname(__file__), '..', '..', '..', 'data') + data_path = join(dirname(__file__), "..", "..", "..", "data") def loadSettingsJSON(self): - filename = join(dirname(__file__), '..', '..', '..', 'settings', 'settings1.json') + filename = join(dirname(__file__), "..", "..", "..", "settings", "settings1.json") if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -37,10 +35,10 @@ def testResponseSignedAssertionNot(self): Case valid signed response, unsigned assertion """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'responses', 'open_saml_response.xml')) + message = self.file_contents(join(self.data_path, "responses", "open_saml_response.xml")) response = OneLogin_Saml2_Response(settings, OneLogin_Saml2_Utils.b64encode(message)) - self.assertEqual('someone@example.org', response.get_nameid()) + self.assertEqual("someone@example.org", response.get_nameid()) def testResponseAndAssertionSigned(self): """ @@ -48,7 +46,7 @@ def testResponseAndAssertionSigned(self): Case valid signed response, signed assertion """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - message = self.file_contents(join(self.data_path, 'responses', 'simple_saml_php.xml')) + message = self.file_contents(join(self.data_path, "responses", "simple_saml_php.xml")) response = OneLogin_Saml2_Response(settings, OneLogin_Saml2_Utils.b64encode(message)) - self.assertEqual('someone@example.com', response.get_nameid()) + self.assertEqual("someone@example.com", response.get_nameid()) diff --git a/tests/src/OneLogin/saml2_tests/utils_test.py b/tests/src/OneLogin/saml2_tests/utils_test.py index 366a125b..60637e5f 100644 --- a/tests/src/OneLogin/saml2_tests/utils_test.py +++ b/tests/src/OneLogin/saml2_tests/utils_test.py @@ -1,45 +1,44 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License from base64 import b64decode import json from lxml import etree from os.path import dirname, join, exists import unittest -from defusedxml.lxml import fromstring +import sys from xml.dom.minidom import parseString from onelogin.saml2 import compat from onelogin.saml2.constants import OneLogin_Saml2_Constants from onelogin.saml2.settings import OneLogin_Saml2_Settings from onelogin.saml2.utils import OneLogin_Saml2_Utils +from onelogin.saml2.xmlparser import fromstring class OneLogin_Saml2_Utils_Test(unittest.TestCase): - data_path = join(dirname(dirname(dirname(dirname(__file__)))), 'data') - settings_path = join(dirname(dirname(dirname(dirname(__file__)))), 'settings') + data_path = join(dirname(dirname(dirname(dirname(__file__)))), "data") + settings_path = join(dirname(dirname(dirname(dirname(__file__)))), "settings") # assertRegexpMatches deprecated on python3 def assertRaisesRegex(self, exception, regexp, msg=None): - if hasattr(unittest.TestCase, 'assertRaisesRegex'): + if hasattr(unittest.TestCase, "assertRaisesRegex"): return super(OneLogin_Saml2_Utils_Test, self).assertRaisesRegex(exception, regexp, msg=msg) else: return self.assertRaisesRegexp(exception, regexp) - def loadSettingsJSON(self, name='settings1.json'): + def loadSettingsJSON(self, name="settings1.json"): filename = join(self.settings_path, name) if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content @@ -49,21 +48,21 @@ def testFormatCert(self): Tests the format_cert method of the OneLogin_Saml2_Utils """ settings_info = self.loadSettingsJSON() - cert = settings_info['idp']['x509cert'] - self.assertNotIn('-----BEGIN CERTIFICATE-----', cert) - self.assertNotIn('-----END CERTIFICATE-----', cert) + cert = settings_info["idp"]["x509cert"] + self.assertNotIn("-----BEGIN CERTIFICATE-----", cert) + self.assertNotIn("-----END CERTIFICATE-----", cert) self.assertEqual(len(cert), 860) formated_cert1 = OneLogin_Saml2_Utils.format_cert(cert) - self.assertIn('-----BEGIN CERTIFICATE-----', formated_cert1) - self.assertIn('-----END CERTIFICATE-----', formated_cert1) + self.assertIn("-----BEGIN CERTIFICATE-----", formated_cert1) + self.assertIn("-----END CERTIFICATE-----", formated_cert1) formated_cert2 = OneLogin_Saml2_Utils.format_cert(cert, True) self.assertEqual(formated_cert1, formated_cert2) formated_cert3 = OneLogin_Saml2_Utils.format_cert(cert, False) - self.assertNotIn('-----BEGIN CERTIFICATE-----', formated_cert3) - self.assertNotIn('-----END CERTIFICATE-----', formated_cert3) + self.assertNotIn("-----BEGIN CERTIFICATE-----", formated_cert3) + self.assertNotIn("-----END CERTIFICATE-----", formated_cert3) self.assertEqual(len(formated_cert3), 860) def testFormatPrivateKey(self): @@ -72,51 +71,49 @@ def testFormatPrivateKey(self): """ key = "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9\nIbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+\nPbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQAB\nAoGAD4/Z4LWVWV6D1qMIp1Gzr0ZmdWTE1SPdZ7Ej8glGnCzPdguCPuzbhGXmIg0V\nJ5D+02wsqws1zd48JSMXXM8zkYZVwQYIPUsNn5FetQpwxDIMPmhHg+QNBgwOnk8J\nK2sIjjLPL7qY7Itv7LT7Gvm5qSOkZ33RCgXcgz+okEIQMYkCQQDzbTOyDL0c5WQV\n6A2k06T/azdhUdGXF9C0+WkWSfNaovmTgRXh1G+jMlr82Snz4p4/STt7P/XtyWzF\n3pkVgZr3AkEA7nPjXwHlttNEMo6AtxHd47nizK2NUN803ElIUT8P9KSCoERmSXq6\n6PDekGNic4ldpsSvOeYCk8MAYoDBy9kvVwJBAMLgX4xg6lzhv7hR5+pWjTb1rIY6\nrCHbrPfU264+UZXz9v2BT/VUznLF81WMvStD9xAPHpFS6R0OLghSZhdzhI0CQQDL\n8Duvfxzrn4b9QlmduV8wLERoT6rEVxKLsPVz316TGrxJvBZLk/cV0SRZE1cZf4uk\nXSWMfEcJ/0Zt+LdG1CqjAkEAqwLSglJ9Dy3HpgMz4vAAyZWzAxvyA1zW0no9GOLc\nPQnYaNUN/Fy2SYtETXTb0CQ9X1rt8ffkFP7ya+5TC83aMg==\n-----END RSA PRIVATE KEY-----\n" formated_key = OneLogin_Saml2_Utils.format_private_key(key, True) - self.assertIn('-----BEGIN RSA PRIVATE KEY-----', formated_key) - self.assertIn('-----END RSA PRIVATE KEY-----', formated_key) + self.assertIn("-----BEGIN RSA PRIVATE KEY-----", formated_key) + self.assertIn("-----END RSA PRIVATE KEY-----", formated_key) self.assertEqual(len(formated_key), 891) formated_key = OneLogin_Saml2_Utils.format_private_key(key, False) - self.assertNotIn('-----BEGIN RSA PRIVATE KEY-----', formated_key) - self.assertNotIn('-----END RSA PRIVATE KEY-----', formated_key) + self.assertNotIn("-----BEGIN RSA PRIVATE KEY-----", formated_key) + self.assertNotIn("-----END RSA PRIVATE KEY-----", formated_key) self.assertEqual(len(formated_key), 816) key_2 = "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAM62buSW9Zgh7CmZ\nouJekK0ac9sgEZkspemjv7SyE6Hbdz+KmUr3C7MI6JuPfVyJbxvMDf3FbgBBK7r5\nyfGgehXwplLMZj8glvV3NkdLMLPWmaw9U5sOzRoym46pVvsEo1PUL2qDK5Wrsm1g\nuY1KIDSHL59NQ7PzDKgm1dxioeXFAgMBAAECgYA/fvRzTReloo3rfWD2Tfv84EpE\nPgaJ2ZghO4Zwl97F8icgIo/R4i760Lq6xgnI+gJiNHz7vcB7XYl0RrRMf3HgbA7z\npJxREmOVltESDHy6lH0TmCdv9xMmHltB+pbGOhqBvuGgFbEOR73lDDV0ln2rEITJ\nA2zjYF+hWe8b0JFeQQJBAOsIIIlHAMngjhCQDD6kla/vce972gCFU7ZeFw16ZMmb\n8W4rGRfQoQWYxSLAFIFsYewSBTccanyYbBNe3njki3ECQQDhJ4cgV6VpTwez4dkp\nU/xCHKoReedAEJhXucTNGpiIqu+TDgIz9aRbrgnUKkS1s06UJhcDRTl/+pCSRRt/\nCA2VAkBkPw4pn1hNwvK1S8t9OJQD+5xcKjZcvIFtKoqonAi7GUGL3OQSDVFw4q1K\n2iSk40aM+06wJ/WfeR+3z2ISrGBxAkAJ20YiF1QpcQlASbHNCl0vs7uKOlDyUAer\nR3mjFPf6e6kzQdi815MTZGIPxK3vWmMlPymgvgYPYTO1A4t5myulAkEA1QioAWcJ\noO26qhUlFRBCR8BMJoVPImV7ndVHE7usHdJvP7V2P9RyuRcMCTVul8RRmyoh/+yG\n4ghMaHo/v0YY5Q==\n-----END PRIVATE KEY-----\n" formated_key_2 = OneLogin_Saml2_Utils.format_private_key(key_2, True) - self.assertIn('-----BEGIN PRIVATE KEY-----', formated_key_2) - self.assertIn('-----END PRIVATE KEY-----', formated_key_2) + self.assertIn("-----BEGIN PRIVATE KEY-----", formated_key_2) + self.assertIn("-----END PRIVATE KEY-----", formated_key_2) self.assertEqual(len(formated_key_2), 916) formated_key_2 = OneLogin_Saml2_Utils.format_private_key(key_2, False) - self.assertNotIn('-----BEGIN PRIVATE KEY-----', formated_key_2) - self.assertNotIn('-----END PRIVATE KEY-----', formated_key_2) + self.assertNotIn("-----BEGIN PRIVATE KEY-----", formated_key_2) + self.assertNotIn("-----END PRIVATE KEY-----", formated_key_2) self.assertEqual(len(formated_key_2), 848) - key_3 = 'MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAM62buSW9Zgh7CmZouJekK0ac9sgEZkspemjv7SyE6Hbdz+KmUr3C7MI6JuPfVyJbxvMDf3FbgBBK7r5yfGgehXwplLMZj8glvV3NkdLMLPWmaw9U5sOzRoym46pVvsEo1PUL2qDK5Wrsm1guY1KIDSHL59NQ7PzDKgm1dxioeXFAgMBAAECgYA/fvRzTReloo3rfWD2Tfv84EpEPgaJ2ZghO4Zwl97F8icgIo/R4i760Lq6xgnI+gJiNHz7vcB7XYl0RrRMf3HgbA7zpJxREmOVltESDHy6lH0TmCdv9xMmHltB+pbGOhqBvuGgFbEOR73lDDV0ln2rEITJA2zjYF+hWe8b0JFeQQJBAOsIIIlHAMngjhCQDD6kla/vce972gCFU7ZeFw16ZMmb8W4rGRfQoQWYxSLAFIFsYewSBTccanyYbBNe3njki3ECQQDhJ4cgV6VpTwez4dkpU/xCHKoReedAEJhXucTNGpiIqu+TDgIz9aRbrgnUKkS1s06UJhcDRTl/+pCSRRt/CA2VAkBkPw4pn1hNwvK1S8t9OJQD+5xcKjZcvIFtKoqonAi7GUGL3OQSDVFw4q1K2iSk40aM+06wJ/WfeR+3z2ISrGBxAkAJ20YiF1QpcQlASbHNCl0vs7uKOlDyUAerR3mjFPf6e6kzQdi815MTZGIPxK3vWmMlPymgvgYPYTO1A4t5myulAkEA1QioAWcJoO26qhUlFRBCR8BMJoVPImV7ndVHE7usHdJvP7V2P9RyuRcMCTVul8RRmyoh/+yG4ghMaHo/v0YY5Q==' + key_3 = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAM62buSW9Zgh7CmZouJekK0ac9sgEZkspemjv7SyE6Hbdz+KmUr3C7MI6JuPfVyJbxvMDf3FbgBBK7r5yfGgehXwplLMZj8glvV3NkdLMLPWmaw9U5sOzRoym46pVvsEo1PUL2qDK5Wrsm1guY1KIDSHL59NQ7PzDKgm1dxioeXFAgMBAAECgYA/fvRzTReloo3rfWD2Tfv84EpEPgaJ2ZghO4Zwl97F8icgIo/R4i760Lq6xgnI+gJiNHz7vcB7XYl0RrRMf3HgbA7zpJxREmOVltESDHy6lH0TmCdv9xMmHltB+pbGOhqBvuGgFbEOR73lDDV0ln2rEITJA2zjYF+hWe8b0JFeQQJBAOsIIIlHAMngjhCQDD6kla/vce972gCFU7ZeFw16ZMmb8W4rGRfQoQWYxSLAFIFsYewSBTccanyYbBNe3njki3ECQQDhJ4cgV6VpTwez4dkpU/xCHKoReedAEJhXucTNGpiIqu+TDgIz9aRbrgnUKkS1s06UJhcDRTl/+pCSRRt/CA2VAkBkPw4pn1hNwvK1S8t9OJQD+5xcKjZcvIFtKoqonAi7GUGL3OQSDVFw4q1K2iSk40aM+06wJ/WfeR+3z2ISrGBxAkAJ20YiF1QpcQlASbHNCl0vs7uKOlDyUAerR3mjFPf6e6kzQdi815MTZGIPxK3vWmMlPymgvgYPYTO1A4t5myulAkEA1QioAWcJoO26qhUlFRBCR8BMJoVPImV7ndVHE7usHdJvP7V2P9RyuRcMCTVul8RRmyoh/+yG4ghMaHo/v0YY5Q==" formated_key_3 = OneLogin_Saml2_Utils.format_private_key(key_3, True) - self.assertIn('-----BEGIN RSA PRIVATE KEY-----', formated_key_3) - self.assertIn('-----END RSA PRIVATE KEY-----', formated_key_3) + self.assertIn("-----BEGIN RSA PRIVATE KEY-----", formated_key_3) + self.assertIn("-----END RSA PRIVATE KEY-----", formated_key_3) self.assertEqual(len(formated_key_3), 924) formated_key_3 = OneLogin_Saml2_Utils.format_private_key(key_3, False) - self.assertNotIn('-----BEGIN PRIVATE KEY-----', formated_key_3) - self.assertNotIn('-----END PRIVATE KEY-----', formated_key_3) - self.assertNotIn('-----BEGIN RSA PRIVATE KEY-----', formated_key_3) - self.assertNotIn('-----END RSA PRIVATE KEY-----', formated_key_3) + self.assertNotIn("-----BEGIN PRIVATE KEY-----", formated_key_3) + self.assertNotIn("-----END PRIVATE KEY-----", formated_key_3) + self.assertNotIn("-----BEGIN RSA PRIVATE KEY-----", formated_key_3) + self.assertNotIn("-----END RSA PRIVATE KEY-----", formated_key_3) self.assertEqual(len(formated_key_3), 848) def testRedirect(self): """ Tests the redirect method of the OneLogin_Saml2_Utils """ - request_data = { - 'http_host': 'example.com' - } + request_data = {"http_host": "example.com"} # Check relative and absolute hostname = OneLogin_Saml2_Utils.get_self_host(request_data) - url = 'http://%s/example' % hostname - url2 = '/example' + url = "http://%s/example" % hostname + url2 = "/example" target_url = OneLogin_Saml2_Utils.redirect(url, {}, request_data) target_url2 = OneLogin_Saml2_Utils.redirect(url2, {}, request_data) @@ -124,48 +121,42 @@ def testRedirect(self): self.assertEqual(target_url, target_url2) # Check that accept http/https and reject other protocols - url3 = 'https://%s/example?test=true' % hostname - url4 = 'ftp://%s/example' % hostname + url3 = "https://%s/example?test=true" % hostname + url4 = "ftp://%s/example" % hostname target_url3 = OneLogin_Saml2_Utils.redirect(url3, {}, request_data) - self.assertIn('test=true', target_url3) + self.assertIn("test=true", target_url3) with self.assertRaises(Exception) as context: OneLogin_Saml2_Utils.redirect(url4, {}, request_data) exception = context.exception self.assertIn("Redirect to invalid URL", str(exception)) # Review parameter prefix - parameters1 = { - 'value1': 'a' - } + parameters1 = {"value1": "a"} target_url5 = OneLogin_Saml2_Utils.redirect(url, parameters1, request_data) - self.assertEqual('http://%s/example?value1=a' % hostname, target_url5) + self.assertEqual("http://%s/example?value1=a" % hostname, target_url5) target_url6 = OneLogin_Saml2_Utils.redirect(url3, parameters1, request_data) - self.assertEqual('https://%s/example?test=true&value1=a' % hostname, target_url6) + self.assertEqual("https://%s/example?test=true&value1=a" % hostname, target_url6) # Review parameters - parameters2 = { - 'alphavalue': 'a', - 'numvaluelist': ['1', '2'], - 'testing': None - } + parameters2 = {"alphavalue": "a", "numvaluelist": ["1", "2"], "testing": None} target_url7 = OneLogin_Saml2_Utils.redirect(url, parameters2, request_data) parameters2_decoded = {"alphavalue": "alphavalue=a", "numvaluelist": "numvaluelist[]=1&numvaluelist[]=2", "testing": "testing"} parameters2_str = "&".join(parameters2_decoded[x] for x in parameters2) - self.assertEqual('http://%s/example?%s' % (hostname, parameters2_str), target_url7) + self.assertEqual("http://%s/example?%s" % (hostname, parameters2_str), target_url7) parameters3 = { - 'alphavalue': 'a', - 'emptynumvaluelist': [], - 'numvaluelist': [''], + "alphavalue": "a", + "emptynumvaluelist": [], + "numvaluelist": [""], } parameters3_decoded = {"alphavalue": "alphavalue=a", "numvaluelist": "numvaluelist[]="} parameters3_str = "&".join((parameters3_decoded[x] for x in parameters3.keys() if x in parameters3_decoded)) target_url8 = OneLogin_Saml2_Utils.redirect(url, parameters3, request_data) - self.assertEqual('http://%s/example?%s' % (hostname, parameters3_str), target_url8) + self.assertEqual("http://%s/example?%s" % (hostname, parameters3_str), target_url8) def testGetselfhost(self): """ @@ -177,94 +168,86 @@ def testGetselfhost(self): exception = context.exception self.assertIn("No hostname defined", str(exception)) - request_data = { - 'server_name': 'example.com' - } - self.assertEqual('example.com', OneLogin_Saml2_Utils.get_self_host(request_data)) + if sys.version_info > (3, 2, 0): + request_data = {"server_name": "example.com"} + with self.assertWarns(Warning) as context: + self_host = OneLogin_Saml2_Utils.get_self_host(request_data) - request_data = { - 'http_host': 'example.com' - } - self.assertEqual('example.com', OneLogin_Saml2_Utils.get_self_host(request_data)) + self.assertEqual("example.com", self_host) - request_data = { - 'http_host': 'example.com:443' - } - self.assertEqual('example.com', OneLogin_Saml2_Utils.get_self_host(request_data)) + request_data = {"http_host": "example.com"} + self.assertEqual("example.com", OneLogin_Saml2_Utils.get_self_host(request_data)) - request_data = { - 'http_host': 'example.com:ok' - } - self.assertEqual('example.com:ok', OneLogin_Saml2_Utils.get_self_host(request_data)) + request_data = {"http_host": "example.com:443"} + self.assertEqual("example.com:443", OneLogin_Saml2_Utils.get_self_host(request_data)) + + request_data = {"http_host": "example.com:ok"} + self.assertEqual("example.com:ok", OneLogin_Saml2_Utils.get_self_host(request_data)) def testisHTTPS(self): """ Tests the is_https method of the OneLogin_Saml2_Utils """ - request_data = { - 'https': 'off' - } + request_data = {"https": "off"} self.assertFalse(OneLogin_Saml2_Utils.is_https(request_data)) - request_data = { - 'https': 'on' - } + request_data = {"https": "on"} self.assertTrue(OneLogin_Saml2_Utils.is_https(request_data)) - request_data = { - 'server_port': '80' - } - self.assertFalse(OneLogin_Saml2_Utils.is_https(request_data)) - - request_data = { - 'server_port': '443' - } + request_data = {"server_port": "443"} self.assertTrue(OneLogin_Saml2_Utils.is_https(request_data)) def testGetSelfURLhost(self): """ Tests the get_self_url_host method of the OneLogin_Saml2_Utils """ - request_data = { - 'http_host': 'example.com' - } - self.assertEqual('http://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + request_data = {"http_host": "example.com"} + self.assertEqual("http://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['server_port'] = '80' - self.assertEqual('http://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + if sys.version_info > (3, 2, 0): + with self.assertWarns(Warning) as context: + request_data["server_port"] = "80" + self.assertEqual("http://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['server_port'] = '81' - self.assertEqual('http://example.com:81', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["server_port"] = "81" + self.assertEqual("http://example.com:81", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['server_port'] = '443' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["server_port"] = "443" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - del request_data['server_port'] - request_data['https'] = 'on' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + del request_data["server_port"] + request_data["https"] = "on" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['server_port'] = '444' - self.assertEqual('https://example.com:444', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + if sys.version_info > (3, 2, 0): + with self.assertWarns(Warning) as context: + request_data["server_port"] = "444" + self.assertEqual("https://example.com:444", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['server_port'] = '443' - request_data['request_uri'] = '' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["server_port"] = "443" + request_data["request_uri"] = "" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['request_uri'] = '/' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["request_uri"] = "/" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['request_uri'] = 'onelogin/' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["request_uri"] = "onelogin/" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['request_uri'] = '/onelogin' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["request_uri"] = "/onelogin" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data['request_uri'] = 'https://example.com/onelogin/sso' - self.assertEqual('https://example.com', OneLogin_Saml2_Utils.get_self_url_host(request_data)) + with self.assertWarns(Warning) as context: + request_data["request_uri"] = "https://example.com/onelogin/sso" + self.assertEqual("https://example.com", OneLogin_Saml2_Utils.get_self_url_host(request_data)) - request_data2 = { - 'request_uri': 'example.com/onelogin/sso' - } + request_data2 = {"request_uri": "example.com/onelogin/sso"} with self.assertRaises(Exception) as context: OneLogin_Saml2_Utils.get_self_url_host(request_data2) exception = context.exception @@ -274,144 +257,127 @@ def testGetSelfURL(self): """ Tests the get_self_url method of the OneLogin_Saml2_Utils """ - request_data = { - 'http_host': 'example.com' - } + request_data = {"http_host": "example.com"} url = OneLogin_Saml2_Utils.get_self_url_host(request_data) self.assertEqual(url, OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = '' + request_data["request_uri"] = "" self.assertEqual(url, OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = '/' - self.assertEqual(url + '/', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "/" + self.assertEqual(url + "/", OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = 'index.html' - self.assertEqual(url + 'index.html', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "index.html" + self.assertEqual(url + "index.html", OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = '?index.html' - self.assertEqual(url + '?index.html', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "?index.html" + self.assertEqual(url + "?index.html", OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = '/index.html' - self.assertEqual(url + '/index.html', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "/index.html" + self.assertEqual(url + "/index.html", OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = '/index.html?testing' - self.assertEqual(url + '/index.html?testing', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "/index.html?testing" + self.assertEqual(url + "/index.html?testing", OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = '/test/index.html?testing' - self.assertEqual(url + '/test/index.html?testing', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "/test/index.html?testing" + self.assertEqual(url + "/test/index.html?testing", OneLogin_Saml2_Utils.get_self_url(request_data)) - request_data['request_uri'] = 'https://example.com/testing' - self.assertEqual(url + '/testing', OneLogin_Saml2_Utils.get_self_url(request_data)) + request_data["request_uri"] = "https://example.com/testing" + self.assertEqual(url + "/testing", OneLogin_Saml2_Utils.get_self_url(request_data)) def testGetSelfURLNoQuery(self): """ Tests the get_self_url_no_query method of the OneLogin_Saml2_Utils """ - request_data = { - 'http_host': 'example.com', - 'script_name': '/index.html' - } - url = OneLogin_Saml2_Utils.get_self_url_host(request_data) + request_data['script_name'] + request_data = {"http_host": "example.com", "script_name": "/index.html"} + url = OneLogin_Saml2_Utils.get_self_url_host(request_data) + request_data["script_name"] self.assertEqual(url, OneLogin_Saml2_Utils.get_self_url_no_query(request_data)) - request_data['path_info'] = '/test' - self.assertEqual(url + '/test', OneLogin_Saml2_Utils.get_self_url_no_query(request_data)) + request_data["path_info"] = "/test" + self.assertEqual(url + "/test", OneLogin_Saml2_Utils.get_self_url_no_query(request_data)) def testGetSelfRoutedURLNoQuery(self): """ Tests the get_self_routed_url_no_query method of the OneLogin_Saml2_Utils """ - request_data = { - 'http_host': 'example.com', - 'request_uri': '/example1/route?x=test', - 'query_string': '?x=test' - } - url = OneLogin_Saml2_Utils.get_self_url_host(request_data) + '/example1/route' + request_data = {"http_host": "example.com", "request_uri": "/example1/route?x=test", "query_string": "?x=test"} + url = OneLogin_Saml2_Utils.get_self_url_host(request_data) + "/example1/route" self.assertEqual(url, OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data)) request_data_2 = { - 'http_host': 'example.com', - 'request_uri': '', + "http_host": "example.com", + "request_uri": "", } url_2 = OneLogin_Saml2_Utils.get_self_url_host(request_data_2) self.assertEqual(url_2, OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data_2)) request_data_3 = { - 'http_host': 'example.com', + "http_host": "example.com", } url_3 = OneLogin_Saml2_Utils.get_self_url_host(request_data_3) self.assertEqual(url_3, OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data_3)) - request_data_4 = { - 'http_host': 'example.com', - 'request_uri': '/example1/route/test/', - 'query_string': '?invalid=1' - } - url_4 = OneLogin_Saml2_Utils.get_self_url_host(request_data_4) + '/example1/route/test/' + request_data_4 = {"http_host": "example.com", "request_uri": "/example1/route/test/", "query_string": "?invalid=1"} + url_4 = OneLogin_Saml2_Utils.get_self_url_host(request_data_4) + "/example1/route/test/" self.assertEqual(url_4, OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data_4)) - request_data_5 = { - 'http_host': 'example.com', - 'request_uri': '/example1/route/test/', - 'query_string': '' - } - url_5 = OneLogin_Saml2_Utils.get_self_url_host(request_data_5) + '/example1/route/test/' + request_data_5 = {"http_host": "example.com", "request_uri": "/example1/route/test/", "query_string": ""} + url_5 = OneLogin_Saml2_Utils.get_self_url_host(request_data_5) + "/example1/route/test/" self.assertEqual(url_5, OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data_5)) request_data_6 = { - 'http_host': 'example.com', - 'request_uri': '/example1/route/test/', + "http_host": "example.com", + "request_uri": "/example1/route/test/", } - url_6 = OneLogin_Saml2_Utils.get_self_url_host(request_data_6) + '/example1/route/test/' + url_6 = OneLogin_Saml2_Utils.get_self_url_host(request_data_6) + "/example1/route/test/" self.assertEqual(url_6, OneLogin_Saml2_Utils.get_self_routed_url_no_query(request_data_6)) def testGetStatus(self): """ Gets the status of a message """ - xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "response1.xml.base64")) xml = b64decode(xml) dom = etree.fromstring(xml) status = OneLogin_Saml2_Utils.get_status(dom) - self.assertEqual(OneLogin_Saml2_Constants.STATUS_SUCCESS, status['code']) + self.assertEqual(OneLogin_Saml2_Constants.STATUS_SUCCESS, status["code"]) - xml2 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responder.xml.base64')) + xml2 = self.file_contents(join(self.data_path, "responses", "invalids", "status_code_responder.xml.base64")) xml2 = b64decode(xml2) dom2 = etree.fromstring(xml2) status2 = OneLogin_Saml2_Utils.get_status(dom2) - self.assertEqual(OneLogin_Saml2_Constants.STATUS_RESPONDER, status2['code']) - self.assertEqual('', status2['msg']) + self.assertEqual(OneLogin_Saml2_Constants.STATUS_RESPONDER, status2["code"]) + self.assertEqual("", status2["msg"]) - xml3 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responer_and_msg.xml.base64')) + xml3 = self.file_contents(join(self.data_path, "responses", "invalids", "status_code_responer_and_msg.xml.base64")) xml3 = b64decode(xml3) dom3 = etree.fromstring(xml3) status3 = OneLogin_Saml2_Utils.get_status(dom3) - self.assertEqual(OneLogin_Saml2_Constants.STATUS_RESPONDER, status3['code']) - self.assertEqual('something_is_wrong', status3['msg']) + self.assertEqual(OneLogin_Saml2_Constants.STATUS_RESPONDER, status3["code"]) + self.assertEqual("something_is_wrong", status3["msg"]) - xml_inv = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_status.xml.base64')) + xml_inv = self.file_contents(join(self.data_path, "responses", "invalids", "no_status.xml.base64")) xml_inv = b64decode(xml_inv) dom_inv = etree.fromstring(xml_inv) - with self.assertRaisesRegex(Exception, 'Missing Status on response'): + with self.assertRaisesRegex(Exception, "Missing Status on response"): OneLogin_Saml2_Utils.get_status(dom_inv) - xml_inv2 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_status_code.xml.base64')) + xml_inv2 = self.file_contents(join(self.data_path, "responses", "invalids", "no_status_code.xml.base64")) xml_inv2 = b64decode(xml_inv2) dom_inv2 = etree.fromstring(xml_inv2) - with self.assertRaisesRegex(Exception, 'Missing Status Code on response'): + with self.assertRaisesRegex(Exception, "Missing Status Code on response"): OneLogin_Saml2_Utils.get_status(dom_inv2) def testParseDuration(self): """ Tests the parse_duration method of the OneLogin_Saml2_Utils """ - duration = 'PT1393462294S' + duration = "PT1393462294S" timestamp = 1393876825 parsed_duration = OneLogin_Saml2_Utils.parse_duration(duration, timestamp) @@ -420,17 +386,17 @@ def testParseDuration(self): parsed_duration_2 = OneLogin_Saml2_Utils.parse_duration(duration) self.assertTrue(parsed_duration_2 > parsed_duration) - invalid_duration = 'PT1Y' + invalid_duration = "PT1Y" with self.assertRaises(Exception) as context: OneLogin_Saml2_Utils.parse_duration(invalid_duration) exception = context.exception self.assertIn("Unrecognised ISO 8601 date format", str(exception)) - new_duration = 'P1Y1M' + new_duration = "P1Y1M" parsed_duration_4 = OneLogin_Saml2_Utils.parse_duration(new_duration, timestamp) self.assertEqual(1428091225, parsed_duration_4) - neg_duration = '-P14M' + neg_duration = "-P14M" parsed_duration_5 = OneLogin_Saml2_Utils.parse_duration(neg_duration, timestamp) self.assertEqual(1357243225, parsed_duration_5) @@ -439,26 +405,34 @@ def testParseSAML2Time(self): Tests the parse_SAML_to_time method of the OneLogin_Saml2_Utils """ time = 1386650371 - saml_time = '2013-12-10T04:39:31Z' + saml_time = "2013-12-10T04:39:31Z" self.assertEqual(time, OneLogin_Saml2_Utils.parse_SAML_to_time(saml_time)) with self.assertRaises(Exception) as context: - OneLogin_Saml2_Utils.parse_SAML_to_time('invalidSAMLTime') + OneLogin_Saml2_Utils.parse_SAML_to_time("invalidSAMLTime") exception = context.exception self.assertIn("does not match format", str(exception)) # Now test if toolkit supports miliseconds - saml_time2 = '2013-12-10T04:39:31.120Z' + saml_time2 = "2013-12-10T04:39:31.120Z" self.assertEqual(time, OneLogin_Saml2_Utils.parse_SAML_to_time(saml_time2)) + # Now test if toolkit supports microseconds + saml_time3 = "2013-12-10T04:39:31.120240Z" + self.assertEqual(time, OneLogin_Saml2_Utils.parse_SAML_to_time(saml_time3)) + + # Now test if toolkit supports nanoseconds + saml_time4 = "2013-12-10T04:39:31.120240360Z" + self.assertEqual(time, OneLogin_Saml2_Utils.parse_SAML_to_time(saml_time4)) + def testParseTime2SAML(self): """ Tests the parse_time_to_SAML method of the OneLogin_Saml2_Utils """ time = 1386650371 - saml_time = '2013-12-10T04:39:31Z' + saml_time = "2013-12-10T04:39:31Z" self.assertEqual(saml_time, OneLogin_Saml2_Utils.parse_time_to_SAML(time)) with self.assertRaises(Exception) as context: - OneLogin_Saml2_Utils.parse_time_to_SAML('invalidtime') + OneLogin_Saml2_Utils.parse_time_to_SAML("invalidtime") exception = context.exception self.assertIn("could not convert string to float", str(exception)) @@ -467,18 +441,18 @@ def testGetExpireTime(self): Tests the get_expire_time method of the OneLogin_Saml2_Utils """ self.assertEqual(None, OneLogin_Saml2_Utils.get_expire_time()) - self.assertNotEqual(None, OneLogin_Saml2_Utils.get_expire_time('PT360000S')) + self.assertNotEqual(None, OneLogin_Saml2_Utils.get_expire_time("PT360000S")) - self.assertEqual('1291955971', OneLogin_Saml2_Utils.get_expire_time('PT360000S', '2010-12-10T04:39:31Z')) - self.assertEqual('1291955971', OneLogin_Saml2_Utils.get_expire_time('PT360000S', 1291955971)) + self.assertEqual("1291955971", OneLogin_Saml2_Utils.get_expire_time("PT360000S", "2010-12-10T04:39:31Z")) + self.assertEqual("1291955971", OneLogin_Saml2_Utils.get_expire_time("PT360000S", 1291955971)) - self.assertNotEqual('3311642371', OneLogin_Saml2_Utils.get_expire_time('PT360000S', '2074-12-10T04:39:31Z')) - self.assertNotEqual('3311642371', OneLogin_Saml2_Utils.get_expire_time('PT360000S', 1418186371)) + self.assertNotEqual("3311642371", OneLogin_Saml2_Utils.get_expire_time("PT360000S", "2074-12-10T04:39:31Z")) + self.assertNotEqual("3311642371", OneLogin_Saml2_Utils.get_expire_time("PT360000S", 1418186371)) def _generate_name_id_element(self, name_qualifier): - name_id_value = 'value' - entity_id = 'sp-entity-id' - name_id_format = 'name-id-format' + name_id_value = "value" + entity_id = "sp-entity-id" + name_id_format = "name-id-format" raw_name_id = OneLogin_Saml2_Utils.generate_name_id( name_id_value, @@ -493,8 +467,8 @@ def testNameidGenerationIncludesNameQualifierAttribute(self): """ Tests the inclusion of NameQualifier in the generateNameId method of the OneLogin_Saml2_Utils """ - idp_name_qualifier = 'idp-name-qualifier' - idp_name_qualifier_attribute = ('NameQualifier', idp_name_qualifier) + idp_name_qualifier = "idp-name-qualifier" + idp_name_qualifier_attribute = ("NameQualifier", idp_name_qualifier) name_id = self._generate_name_id_element(idp_name_qualifier) @@ -505,7 +479,7 @@ def testNameidGenerationDoesNotIncludeNameQualifierAttribute(self): Tests the (not) inclusion of NameQualifier in the generateNameId method of the OneLogin_Saml2_Utils """ idp_name_qualifier = None - not_expected_attribute = 'NameQualifier' + not_expected_attribute = "NameQualifier" name_id = self._generate_name_id_element(idp_name_qualifier) @@ -515,27 +489,27 @@ def testGenerateNameIdWithoutFormat(self): """ Tests the generateNameId method of the OneLogin_Saml2_Utils """ - name_id_value = 'ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde' + name_id_value = "ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde" name_id_format = None name_id = OneLogin_Saml2_Utils.generate_name_id(name_id_value, None, name_id_format) - expected_name_id = 'ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde' + expected_name_id = "ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde" self.assertEqual(name_id, expected_name_id) def testGenerateNameIdWithSPNameQualifier(self): """ Tests the generateNameId method of the OneLogin_Saml2_Utils """ - name_id_value = 'ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde' - entity_id = 'http://stuff.com/endpoints/metadata.php' - name_id_format = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' + name_id_value = "ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde" + entity_id = "http://stuff.com/endpoints/metadata.php" + name_id_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" name_id = OneLogin_Saml2_Utils.generate_name_id(name_id_value, entity_id, name_id_format) expected_name_id = 'ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde' self.assertEqual(expected_name_id, name_id) settings_info = self.loadSettingsJSON() - x509cert = settings_info['idp']['x509cert'] + x509cert = settings_info["idp"]["x509cert"] key = OneLogin_Saml2_Utils.format_cert(x509cert) name_id_enc = OneLogin_Saml2_Utils.generate_name_id(name_id_value, entity_id, name_id_format, key) @@ -546,15 +520,15 @@ def testGenerateNameIdWithoutSPNameQualifier(self): """ Tests the generateNameId method of the OneLogin_Saml2_Utils """ - name_id_value = 'ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde' - name_id_format = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' + name_id_value = "ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde" + name_id_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" name_id = OneLogin_Saml2_Utils.generate_name_id(name_id_value, None, name_id_format) expected_name_id = 'ONELOGIN_ce998811003f4e60f8b07a311dc641621379cfde' self.assertEqual(expected_name_id, name_id) settings_info = self.loadSettingsJSON() - x509cert = settings_info['idp']['x509cert'] + x509cert = settings_info["idp"]["x509cert"] key = OneLogin_Saml2_Utils.format_cert(x509cert) name_id_enc = OneLogin_Saml2_Utils.generate_name_id(name_id_value, None, name_id_format, key) @@ -568,18 +542,21 @@ def testCalculateX509Fingerprint(self): settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) cert_path = settings.get_cert_path() - key = self.file_contents(cert_path + 'sp.key') - cert = self.file_contents(cert_path + 'sp.crt') + key = self.file_contents(cert_path + "sp.key") + cert = self.file_contents(cert_path + "sp.crt") self.assertEqual(None, OneLogin_Saml2_Utils.calculate_x509_fingerprint(key)) - self.assertEqual('afe71c28ef740bc87425be13a2263d37971da1f9', OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert)) - self.assertEqual('afe71c28ef740bc87425be13a2263d37971da1f9', OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, 'sha1')) + self.assertEqual("afe71c28ef740bc87425be13a2263d37971da1f9", OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert)) + self.assertEqual("afe71c28ef740bc87425be13a2263d37971da1f9", OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, "sha1")) - self.assertEqual('c51cfa06c7a49767f6eab18238eae1c56708e29264da3d11f538a12cd2c357ba', OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, 'sha256')) + self.assertEqual("c51cfa06c7a49767f6eab18238eae1c56708e29264da3d11f538a12cd2c357ba", OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, "sha256")) - self.assertEqual('bc5826e6f9429247254bae5e3c650e6968a36a62d23075eb168134978d88600559c10830c28711b2c29c7947c0c2eb1d', OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, 'sha384')) + self.assertEqual("bc5826e6f9429247254bae5e3c650e6968a36a62d23075eb168134978d88600559c10830c28711b2c29c7947c0c2eb1d", OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, "sha384")) - self.assertEqual('3db29251b97559c67988ea0754cb0573fc409b6f75d89282d57cfb75089539b0bbdb2dcd9ec6e032549ecbc466439d5992e18db2cf5494ca2fe1b2e16f348dff', OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, 'sha512')) + self.assertEqual( + "3db29251b97559c67988ea0754cb0573fc409b6f75d89282d57cfb75089539b0bbdb2dcd9ec6e032549ecbc466439d5992e18db2cf5494ca2fe1b2e16f348dff", + OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert, "sha512"), + ) def testDeleteLocalSession(self): """ @@ -606,11 +583,11 @@ def testFormatFingerPrint(self): """ Tests the format_finger_print method of the OneLogin_Saml2_Utils """ - finger_print_1 = 'AF:E7:1C:28:EF:74:0B:C8:74:25:BE:13:A2:26:3D:37:97:1D:A1:F9' - self.assertEqual('afe71c28ef740bc87425be13a2263d37971da1f9', OneLogin_Saml2_Utils.format_finger_print(finger_print_1)) + finger_print_1 = "AF:E7:1C:28:EF:74:0B:C8:74:25:BE:13:A2:26:3D:37:97:1D:A1:F9" + self.assertEqual("afe71c28ef740bc87425be13a2263d37971da1f9", OneLogin_Saml2_Utils.format_finger_print(finger_print_1)) - finger_print_2 = 'afe71c28ef740bc87425be13a2263d37971da1f9' - self.assertEqual('afe71c28ef740bc87425be13a2263d37971da1f9', OneLogin_Saml2_Utils.format_finger_print(finger_print_2)) + finger_print_2 = "afe71c28ef740bc87425be13a2263d37971da1f9" + self.assertEqual("afe71c28ef740bc87425be13a2263d37971da1f9", OneLogin_Saml2_Utils.format_finger_print(finger_print_2)) def testDecryptElement(self): """ @@ -620,68 +597,68 @@ def testDecryptElement(self): key = settings.get_sp_key() - xml_nameid_enc = b64decode(self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))) + xml_nameid_enc = b64decode(self.file_contents(join(self.data_path, "responses", "response_encrypted_nameid.xml.base64"))) dom_nameid_enc = etree.fromstring(xml_nameid_enc) - encrypted_nameid_nodes = dom_nameid_enc.find('.//saml:EncryptedID', namespaces=OneLogin_Saml2_Constants.NSMAP) + encrypted_nameid_nodes = dom_nameid_enc.find(".//saml:EncryptedID", namespaces=OneLogin_Saml2_Constants.NSMAP) encrypted_data = encrypted_nameid_nodes[0] decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key) - self.assertEqual('saml:NameID', decrypted_nameid.tag) - self.assertEqual('2de11defd199f8d5bb63f9b7deb265ba5c675c10', decrypted_nameid.text) + self.assertEqual("saml:NameID", decrypted_nameid.tag) + self.assertEqual("2de11defd199f8d5bb63f9b7deb265ba5c675c10", decrypted_nameid.text) - xml_assertion_enc = b64decode(self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion_encrypted_nameid.xml.base64'))) + xml_assertion_enc = b64decode(self.file_contents(join(self.data_path, "responses", "valid_encrypted_assertion_encrypted_nameid.xml.base64"))) dom_assertion_enc = etree.fromstring(xml_assertion_enc) - encrypted_assertion_enc_nodes = dom_assertion_enc.find('.//saml:EncryptedAssertion', namespaces=OneLogin_Saml2_Constants.NSMAP) + encrypted_assertion_enc_nodes = dom_assertion_enc.find(".//saml:EncryptedAssertion", namespaces=OneLogin_Saml2_Constants.NSMAP) encrypted_data_assert = encrypted_assertion_enc_nodes[0] decrypted_assertion = OneLogin_Saml2_Utils.decrypt_element(encrypted_data_assert, key) - self.assertEqual('{%s}Assertion' % OneLogin_Saml2_Constants.NS_SAML, decrypted_assertion.tag) - self.assertEqual('_6fe189b1c241827773902f2b1d3a843418206a5c97', decrypted_assertion.get('ID')) + self.assertEqual("{%s}Assertion" % OneLogin_Saml2_Constants.NS_SAML, decrypted_assertion.tag) + self.assertEqual("_6fe189b1c241827773902f2b1d3a843418206a5c97", decrypted_assertion.get("ID")) - encrypted_nameid_nodes = decrypted_assertion.xpath('./saml:Subject/saml:EncryptedID', namespaces=OneLogin_Saml2_Constants.NSMAP) + encrypted_nameid_nodes = decrypted_assertion.xpath("./saml:Subject/saml:EncryptedID", namespaces=OneLogin_Saml2_Constants.NSMAP) encrypted_data = encrypted_nameid_nodes[0][0] decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key) - self.assertEqual('{%s}NameID' % OneLogin_Saml2_Constants.NS_SAML, decrypted_nameid.tag) - self.assertEqual('457bdb600de717891c77647b0806ce59c089d5b8', decrypted_nameid.text) + self.assertEqual("{%s}NameID" % OneLogin_Saml2_Constants.NS_SAML, decrypted_nameid.tag) + self.assertEqual("457bdb600de717891c77647b0806ce59c089d5b8", decrypted_nameid.text) - key_2_file_name = join(self.data_path, 'misc', 'sp2.key') - f = open(key_2_file_name, 'r') + key_2_file_name = join(self.data_path, "misc", "sp2.key") + f = open(key_2_file_name, "r") key2 = f.read() f.close() # sp.key and sp2.key are equivalent we should be able to decrypt the nameID again decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key2) - self.assertIn('{%s}NameID' % (OneLogin_Saml2_Constants.NS_SAML), decrypted_nameid.tag) - self.assertEqual('457bdb600de717891c77647b0806ce59c089d5b8', decrypted_nameid.text) + self.assertIn("{%s}NameID" % (OneLogin_Saml2_Constants.NS_SAML), decrypted_nameid.tag) + self.assertEqual("457bdb600de717891c77647b0806ce59c089d5b8", decrypted_nameid.text) - key_3_file_name = join(self.data_path, 'misc', 'sp3.key') - f = open(key_3_file_name, 'r') + key_3_file_name = join(self.data_path, "misc", "sp3.key") + f = open(key_3_file_name, "r") key3 = f.read() f.close() # sp.key and sp3.key are equivalent we should be able to decrypt the nameID again decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key3) - self.assertIn('{%s}NameID' % (OneLogin_Saml2_Constants.NS_SAML), decrypted_nameid.tag) - self.assertEqual('457bdb600de717891c77647b0806ce59c089d5b8', decrypted_nameid.text) + self.assertIn("{%s}NameID" % (OneLogin_Saml2_Constants.NS_SAML), decrypted_nameid.tag) + self.assertEqual("457bdb600de717891c77647b0806ce59c089d5b8", decrypted_nameid.text) - key_4_file_name = join(self.data_path, 'misc', 'sp4.key') - f = open(key_4_file_name, 'r') + key_4_file_name = join(self.data_path, "misc", "sp4.key") + f = open(key_4_file_name, "r") key4 = f.read() f.close() with self.assertRaisesRegex(Exception, "(1, 'failed to decrypt')"): OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key4) - xml_nameid_enc_2 = b64decode(self.file_contents(join(self.data_path, 'responses', 'invalids', 'encrypted_nameID_without_EncMethod.xml.base64'))) + xml_nameid_enc_2 = b64decode(self.file_contents(join(self.data_path, "responses", "invalids", "encrypted_nameID_without_EncMethod.xml.base64"))) dom_nameid_enc_2 = parseString(xml_nameid_enc_2) - encrypted_nameid_nodes_2 = dom_nameid_enc_2.getElementsByTagName('saml:EncryptedID') + encrypted_nameid_nodes_2 = dom_nameid_enc_2.getElementsByTagName("saml:EncryptedID") encrypted_data_2 = encrypted_nameid_nodes_2[0].firstChild with self.assertRaisesRegex(Exception, "(1, 'failed to decrypt')"): OneLogin_Saml2_Utils.decrypt_element(encrypted_data_2, key) - xml_nameid_enc_3 = b64decode(self.file_contents(join(self.data_path, 'responses', 'invalids', 'encrypted_nameID_without_keyinfo.xml.base64'))) + xml_nameid_enc_3 = b64decode(self.file_contents(join(self.data_path, "responses", "invalids", "encrypted_nameID_without_keyinfo.xml.base64"))) dom_nameid_enc_3 = parseString(xml_nameid_enc_3) - encrypted_nameid_nodes_3 = dom_nameid_enc_3.getElementsByTagName('saml:EncryptedID') + encrypted_nameid_nodes_3 = dom_nameid_enc_3.getElementsByTagName("saml:EncryptedID") encrypted_data_3 = encrypted_nameid_nodes_3[0].firstChild with self.assertRaisesRegex(Exception, "(1, 'failed to decrypt')"): @@ -695,20 +672,20 @@ def testDecryptElementInplace(self): key = settings.get_sp_key() - xml_nameid_enc = b64decode(self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))) + xml_nameid_enc = b64decode(self.file_contents(join(self.data_path, "responses", "response_encrypted_nameid.xml.base64"))) dom = fromstring(xml_nameid_enc) - encrypted_node = dom.xpath('//saml:EncryptedID/xenc:EncryptedData', namespaces=OneLogin_Saml2_Constants.NSMAP)[0] + encrypted_node = dom.xpath("//saml:EncryptedID/xenc:EncryptedData", namespaces=OneLogin_Saml2_Constants.NSMAP)[0] # can be decrypted twice when copy the node first for _ in range(2): decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_node, key, inplace=False) - self.assertIn('NameID', decrypted_nameid.tag) - self.assertEqual('2de11defd199f8d5bb63f9b7deb265ba5c675c10', decrypted_nameid.text) + self.assertIn("NameID", decrypted_nameid.tag) + self.assertEqual("2de11defd199f8d5bb63f9b7deb265ba5c675c10", decrypted_nameid.text) # can only be decrypted once in place decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_node, key, inplace=True) - self.assertIn('NameID', decrypted_nameid.tag) - self.assertEqual('2de11defd199f8d5bb63f9b7deb265ba5c675c10', decrypted_nameid.text) + self.assertIn("NameID", decrypted_nameid.tag) + self.assertEqual("2de11defd199f8d5bb63f9b7deb265ba5c675c10", decrypted_nameid.text) # can't be decrypted twice since it has been decrypted inplace with self.assertRaisesRegex(Exception, "(1, 'failed to decrypt')"): @@ -722,60 +699,60 @@ def testAddSign(self): key = settings.get_sp_key() cert = settings.get_sp_cert() - xml_authn = b64decode(self.file_contents(join(self.data_path, 'requests', 'authn_request.xml.base64'))) + xml_authn = b64decode(self.file_contents(join(self.data_path, "requests", "authn_request.xml.base64"))) xml_authn_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn, key, cert)) - self.assertIn('', xml_authn_signed) + self.assertIn("", xml_authn_signed) res = parseString(xml_authn_signed) - ds_signature = res.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature.tagName) + ds_signature = res.firstChild.firstChild.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature.tagName) xml_authn_dom = parseString(xml_authn) xml_authn_signed_2 = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn_dom.toxml(), key, cert)) - self.assertIn('', xml_authn_signed_2) + self.assertIn("", xml_authn_signed_2) res_2 = parseString(xml_authn_signed_2) - ds_signature_2 = res_2.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature_2.tagName) + ds_signature_2 = res_2.firstChild.firstChild.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature_2.tagName) xml_authn_signed_3 = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn_dom.firstChild.toxml(), key, cert)) - self.assertIn('', xml_authn_signed_3) + self.assertIn("", xml_authn_signed_3) res_3 = parseString(xml_authn_signed_3) - ds_signature_3 = res_3.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature_3.tagName) + ds_signature_3 = res_3.firstChild.firstChild.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature_3.tagName) xml_authn_etree = etree.fromstring(xml_authn) xml_authn_signed_4 = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn_etree, key, cert)) - self.assertIn('', xml_authn_signed_4) + self.assertIn("", xml_authn_signed_4) res_4 = parseString(xml_authn_signed_4) - ds_signature_4 = res_4.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature_4.tagName) + ds_signature_4 = res_4.firstChild.firstChild.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature_4.tagName) xml_authn_signed_5 = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn_etree, key, cert)) - self.assertIn('', xml_authn_signed_5) + self.assertIn("", xml_authn_signed_5) res_5 = parseString(xml_authn_signed_5) - ds_signature_5 = res_5.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature_5.tagName) + ds_signature_5 = res_5.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature_5.tagName) - xml_logout_req = b64decode(self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml.base64'))) + xml_logout_req = b64decode(self.file_contents(join(self.data_path, "logout_requests", "logout_request.xml.base64"))) xml_logout_req_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_logout_req, key, cert)) - self.assertIn('', xml_logout_req_signed) + self.assertIn("", xml_logout_req_signed) res_6 = parseString(xml_logout_req_signed) - ds_signature_6 = res_6.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature_6.tagName) + ds_signature_6 = res_6.firstChild.firstChild.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature_6.tagName) - xml_logout_res = b64decode(self.file_contents(join(self.data_path, 'logout_responses', 'logout_response.xml.base64'))) + xml_logout_res = b64decode(self.file_contents(join(self.data_path, "logout_responses", "logout_response.xml.base64"))) xml_logout_res_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_logout_res, key, cert)) - self.assertIn('', xml_logout_res_signed) + self.assertIn("", xml_logout_res_signed) res_7 = parseString(xml_logout_res_signed) - ds_signature_7 = res_7.firstChild.firstChild.nextSibling.nextSibling - self.assertIn('ds:Signature', ds_signature_7.tagName) + ds_signature_7 = res_7.firstChild.firstChild.nextSibling.nextSibling.nextSibling + self.assertIn("ds:Signature", ds_signature_7.tagName) - xml_metadata = self.file_contents(join(self.data_path, 'metadata', 'metadata_settings1.xml')) + xml_metadata = self.file_contents(join(self.data_path, "metadata", "metadata_settings1.xml")) xml_metadata_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_metadata, key, cert)) - self.assertIn('', xml_metadata_signed) + self.assertIn("", xml_metadata_signed) res_8 = parseString(xml_metadata_signed) ds_signature_8 = res_8.firstChild.firstChild.nextSibling - self.assertIn('ds:Signature', ds_signature_8.tagName) + self.assertIn("ds:Signature", ds_signature_8.tagName) def testAddSignCheckAlg(self): """ @@ -786,19 +763,19 @@ def testAddSignCheckAlg(self): key = settings.get_sp_key() cert = settings.get_sp_cert() - xml_authn = b64decode(self.file_contents(join(self.data_path, 'requests', 'authn_request.xml.base64'))) + xml_authn = b64decode(self.file_contents(join(self.data_path, "requests", "authn_request.xml.base64"))) xml_authn_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn, key, cert)) - self.assertIn('', xml_authn_signed) - self.assertIn('', xml_authn_signed) - self.assertIn('', xml_authn_signed) + self.assertIn("", xml_authn_signed) + self.assertIn('', xml_authn_signed) + self.assertIn('', xml_authn_signed) xml_authn_signed_2 = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn, key, cert, False, OneLogin_Saml2_Constants.RSA_SHA256, OneLogin_Saml2_Constants.SHA384)) - self.assertIn('', xml_authn_signed_2) + self.assertIn("", xml_authn_signed_2) self.assertIn('', xml_authn_signed_2) self.assertIn('', xml_authn_signed_2) xml_authn_signed_3 = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn, key, cert, False, OneLogin_Saml2_Constants.RSA_SHA384, OneLogin_Saml2_Constants.SHA512)) - self.assertIn('', xml_authn_signed_3) + self.assertIn("", xml_authn_signed_3) self.assertIn('', xml_authn_signed_3) self.assertIn('', xml_authn_signed_3) @@ -808,30 +785,30 @@ def testValidateSign(self): """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) idp_data = settings.get_idp_data() - cert = idp_data['x509cert'] + cert = idp_data["x509cert"] - settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings2.json')) + settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings2.json")) idp_data2 = settings_2.get_idp_data() - cert_2 = idp_data2['x509cert'] + cert_2 = idp_data2["x509cert"] fingerprint_2 = OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert_2) - fingerprint_2_256 = OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert_2, 'sha256') + fingerprint_2_256 = OneLogin_Saml2_Utils.calculate_x509_fingerprint(cert_2, "sha256") try: - self.assertFalse(OneLogin_Saml2_Utils.validate_sign('', cert)) + self.assertFalse(OneLogin_Saml2_Utils.validate_sign("", cert)) except Exception as e: - self.assertEqual('Empty string supplied as input', str(e)) + self.assertEqual("Empty string supplied as input", str(e)) # expired cert - xml_metadata_signed = self.file_contents(join(self.data_path, 'metadata', 'signed_metadata_settings1.xml')) + xml_metadata_signed = self.file_contents(join(self.data_path, "metadata", "signed_metadata_settings1.xml")) self.assertTrue(OneLogin_Saml2_Utils.validate_metadata_sign(xml_metadata_signed, cert)) # expired cert, verified it self.assertFalse(OneLogin_Saml2_Utils.validate_metadata_sign(xml_metadata_signed, cert, validatecert=True)) - xml_metadata_signed_2 = self.file_contents(join(self.data_path, 'metadata', 'signed_metadata_settings2.xml')) + xml_metadata_signed_2 = self.file_contents(join(self.data_path, "metadata", "signed_metadata_settings2.xml")) self.assertTrue(OneLogin_Saml2_Utils.validate_metadata_sign(xml_metadata_signed_2, cert_2)) self.assertTrue(OneLogin_Saml2_Utils.validate_metadata_sign(xml_metadata_signed_2, None, fingerprint_2)) - xml_response_msg_signed = b64decode(self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64'))) + xml_response_msg_signed = b64decode(self.file_contents(join(self.data_path, "responses", "signed_message_response.xml.base64"))) # expired cert self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed, cert)) @@ -839,73 +816,85 @@ def testValidateSign(self): self.assertFalse(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed, cert, validatecert=True)) # modified cert - other_cert_path = join(dirname(__file__), '..', '..', '..', 'certs') - f = open(other_cert_path + '/certificate1', 'r') + other_cert_path = join(dirname(__file__), "..", "..", "..", "certs") + f = open(other_cert_path + "/certificate1", "r") cert_x = f.read() f.close() self.assertFalse(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed, cert_x)) self.assertFalse(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed, cert_x, validatecert=True)) - xml_response_msg_signed_2 = b64decode(self.file_contents(join(self.data_path, 'responses', 'signed_message_response2.xml.base64'))) + xml_response_msg_signed_2 = b64decode(self.file_contents(join(self.data_path, "responses", "signed_message_response2.xml.base64"))) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed_2, cert_2)) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed_2, None, fingerprint_2)) - self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed_2, None, fingerprint_2, 'sha1')) - self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed_2, None, fingerprint_2_256, 'sha256')) + self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed_2, None, fingerprint_2, "sha1")) + self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_msg_signed_2, None, fingerprint_2_256, "sha256")) - xml_response_assert_signed = b64decode(self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response.xml.base64'))) + xml_response_assert_signed = b64decode(self.file_contents(join(self.data_path, "responses", "signed_assertion_response.xml.base64"))) # expired cert self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_assert_signed, cert)) # expired cert, verified it self.assertFalse(OneLogin_Saml2_Utils.validate_sign(xml_response_assert_signed, cert, validatecert=True)) - xml_response_assert_signed_2 = b64decode(self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response2.xml.base64'))) + xml_response_assert_signed_2 = b64decode(self.file_contents(join(self.data_path, "responses", "signed_assertion_response2.xml.base64"))) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_assert_signed_2, cert_2)) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_assert_signed_2, None, fingerprint_2)) - xml_response_double_signed = b64decode(self.file_contents(join(self.data_path, 'responses', 'double_signed_response.xml.base64'))) + xml_response_double_signed = b64decode(self.file_contents(join(self.data_path, "responses", "double_signed_response.xml.base64"))) # expired cert self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_double_signed, cert)) # expired cert, verified it self.assertFalse(OneLogin_Saml2_Utils.validate_sign(xml_response_double_signed, cert, validatecert=True)) - xml_response_double_signed_2 = b64decode(self.file_contents(join(self.data_path, 'responses', 'double_signed_response2.xml.base64'))) + xml_response_double_signed_2 = b64decode(self.file_contents(join(self.data_path, "responses", "double_signed_response2.xml.base64"))) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_double_signed_2, cert_2)) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(xml_response_double_signed_2, None, fingerprint_2)) dom = parseString(xml_response_msg_signed_2) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(dom.toxml(), cert_2)) - dom.firstChild.firstChild.firstChild.nodeValue = 'https://idp.example.com/simplesaml/saml2/idp/metadata.php' + dom.firstChild.firstChild.firstChild.nodeValue = "https://idp.example.com/simplesaml/saml2/idp/metadata.php" - dom.firstChild.getAttributeNode('ID').nodeValue = u'_34fg27g212d63k1f923845324475802ac0fc24530b' + dom.firstChild.getAttributeNode("ID").nodeValue = "_34fg27g212d63k1f923845324475802ac0fc24530b" # Reference validation failed self.assertFalse(OneLogin_Saml2_Utils.validate_sign(dom.toxml(), cert_2)) - invalid_fingerprint = 'afe71c34ef740bc87434be13a2263d31271da1f9' + invalid_fingerprint = "afe71c34ef740bc87434be13a2263d31271da1f9" # Wrong fingerprint self.assertFalse(OneLogin_Saml2_Utils.validate_metadata_sign(xml_metadata_signed_2, None, invalid_fingerprint)) dom_2 = parseString(xml_response_double_signed_2) self.assertTrue(OneLogin_Saml2_Utils.validate_sign(dom_2.toxml(), cert_2)) - dom_2.firstChild.firstChild.firstChild.nodeValue = 'https://example.com/other-idp' + dom_2.firstChild.firstChild.firstChild.nodeValue = "https://example.com/other-idp" # Modified message self.assertFalse(OneLogin_Saml2_Utils.validate_sign(dom_2.toxml(), cert_2)) # Try to validate directly the Assertion dom_3 = parseString(xml_response_double_signed_2) assert_elem_3 = dom_3.firstChild.firstChild.nextSibling.nextSibling.nextSibling - assert_elem_3.setAttributeNS(OneLogin_Saml2_Constants.NS_SAML, 'xmlns:saml', OneLogin_Saml2_Constants.NS_SAML) + assert_elem_3.setAttributeNS(OneLogin_Saml2_Constants.NS_SAML, "xmlns:saml", OneLogin_Saml2_Constants.NS_SAML) self.assertFalse(OneLogin_Saml2_Utils.validate_sign(assert_elem_3.toxml(), cert_2)) # Wrong scheme - no_signed = b64decode(self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_signature.xml.base64'))) + no_signed = b64decode(self.file_contents(join(self.data_path, "responses", "invalids", "no_signature.xml.base64"))) self.assertFalse(OneLogin_Saml2_Utils.validate_sign(no_signed, cert)) - no_key = b64decode(self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_key.xml.base64'))) + no_key = b64decode(self.file_contents(join(self.data_path, "responses", "invalids", "no_key.xml.base64"))) self.assertFalse(OneLogin_Saml2_Utils.validate_sign(no_key, cert)) # Signature Wrapping attack - wrapping_attack1 = b64decode(self.file_contents(join(self.data_path, 'responses', 'invalids', 'signature_wrapping_attack.xml.base64'))) + wrapping_attack1 = b64decode(self.file_contents(join(self.data_path, "responses", "invalids", "signature_wrapping_attack.xml.base64"))) self.assertFalse(OneLogin_Saml2_Utils.validate_sign(wrapping_attack1, cert)) + + def testNormalizeUrl(self): + base_url = "https://blah.com/path" + capital_scheme = "hTTps://blah.com/path" + capital_domain = "https://blAH.Com/path" + capital_path = "https://blah.com/PAth" + capital_all = "HTTPS://BLAH.COM/PATH" + + self.assertIn(base_url, OneLogin_Saml2_Utils.normalize_url(capital_scheme)) + self.assertIn(base_url, OneLogin_Saml2_Utils.normalize_url(capital_domain)) + self.assertNotIn(base_url, OneLogin_Saml2_Utils.normalize_url(capital_path)) + self.assertNotIn(base_url, OneLogin_Saml2_Utils.normalize_url(capital_all)) diff --git a/tests/src/OneLogin/saml2_tests/xml_utils_test.py b/tests/src/OneLogin/saml2_tests/xml_utils_test.py index 507575f1..2135aca3 100644 --- a/tests/src/OneLogin/saml2_tests/xml_utils_test.py +++ b/tests/src/OneLogin/saml2_tests/xml_utils_test.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2010-2018 OneLogin, Inc. -# MIT License import json import unittest +import xmlsec from base64 import b64decode from lxml import etree @@ -13,57 +12,75 @@ class TestOneLoginSaml2Xml(unittest.TestCase): - data_path = join(dirname(__file__), '..', '..', '..', 'data') + data_path = join(dirname(__file__), "..", "..", "..", "data") def loadSettingsJSON(self, filename=None): if filename: - filename = join(dirname(__file__), '..', '..', '..', 'settings', filename) + filename = join(dirname(__file__), "..", "..", "..", "settings", filename) else: - filename = join(dirname(__file__), '..', '..', '..', 'settings', 'settings1.json') + filename = join(dirname(__file__), "..", "..", "..", "settings", "settings1.json") if exists(filename): - stream = open(filename, 'r') + stream = open(filename, "r") settings = json.load(stream) stream.close() return settings else: - raise Exception('Settings json file does not exist') + raise Exception("Settings json file does not exist") def file_contents(self, filename): - f = open(filename, 'r') + f = open(filename, "r") content = f.read() f.close() return content + def testLibxml2(self): + """ + Tests that libxml2 versions used by xmlsec and lxml are compatible + + If this test fails, reinstall lxml without using binary to ensure it is + linked to same version of libxml2 as xmlsec: + pip install --force-reinstall --no-binary lxml lxml + + See https://bugs.launchpad.net/lxml/+bug/1960668 + """ + env = etree.fromstring("") + sig = xmlsec.template.create(env, xmlsec.Transform.EXCL_C14N, xmlsec.Transform.RSA_SHA256, ns="ds") + + ds = etree.QName(sig).namespace + cm = sig.find(".//{%s}CanonicalizationMethod" % ds) + + self.assertIsNotNone(cm) + def testValidateXML(self): """ Tests the validate_xml method of the OneLogin_Saml2_XML """ - metadata_unloaded = '' - res = OneLogin_Saml2_XML.validate_xml(metadata_unloaded, 'saml-schema-metadata-2.0.xsd') + metadata_unloaded = "" + res = OneLogin_Saml2_XML.validate_xml(metadata_unloaded, "saml-schema-metadata-2.0.xsd") self.assertIsInstance(res, str) - self.assertIn('unloaded_xml', res) + self.assertIn("unloaded_xml", res) - metadata_invalid = self.file_contents(join(self.data_path, 'metadata', 'noentity_metadata_settings1.xml')) + metadata_invalid = self.file_contents(join(self.data_path, "metadata", "noentity_metadata_settings1.xml")) - res = OneLogin_Saml2_XML.validate_xml(metadata_invalid, 'saml-schema-metadata-2.0.xsd') + res = OneLogin_Saml2_XML.validate_xml(metadata_invalid, "saml-schema-metadata-2.0.xsd") self.assertIsInstance(res, str) - self.assertIn('invalid_xml', res) + self.assertIn("invalid_xml", res) - metadata_expired = self.file_contents(join(self.data_path, 'metadata', 'expired_metadata_settings1.xml')) - res = OneLogin_Saml2_XML.validate_xml(metadata_expired, 'saml-schema-metadata-2.0.xsd') + metadata_expired = self.file_contents(join(self.data_path, "metadata", "expired_metadata_settings1.xml")) + res = OneLogin_Saml2_XML.validate_xml(metadata_expired, "saml-schema-metadata-2.0.xsd") self.assertIsInstance(res, OneLogin_Saml2_XML._element_class) - metadata_ok = self.file_contents(join(self.data_path, 'metadata', 'metadata_settings1.xml')) - res = OneLogin_Saml2_XML.validate_xml(metadata_ok, 'saml-schema-metadata-2.0.xsd') + metadata_ok = self.file_contents(join(self.data_path, "metadata", "metadata_settings1.xml")) + res = OneLogin_Saml2_XML.validate_xml(metadata_ok, "saml-schema-metadata-2.0.xsd") self.assertIsInstance(res, OneLogin_Saml2_XML._element_class) def testToString(self): """ Tests the to_string method of the OneLogin_Saml2_XML """ - xml = 'test1' + xml = "test1" elem = etree.fromstring(xml) - bxml = xml.encode('utf8') + bxml = xml.encode("utf8") self.assertIs(xml, OneLogin_Saml2_XML.to_string(xml)) self.assertIs(bxml, OneLogin_Saml2_XML.to_string(bxml)) @@ -77,7 +94,7 @@ def testToElement(self): """ Tests the to_etree method of the OneLogin_Saml2_XML """ - xml = 'test1' + xml = "test1" elem = etree.fromstring(xml) xml_expected = etree.tostring(elem) @@ -85,7 +102,7 @@ def testToElement(self): self.assertIsInstance(res, etree._Element) self.assertEqual(xml_expected, etree.tostring(res)) - res = OneLogin_Saml2_XML.to_etree(xml.encode('utf8')) + res = OneLogin_Saml2_XML.to_etree(xml.encode("utf8")) self.assertIsInstance(res, etree._Element) self.assertEqual(xml_expected, etree.tostring(res)) @@ -104,46 +121,46 @@ def testQuery(self): """ Tests the query method of the OneLogin_Saml2_Utils """ - xml = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64')) + xml = self.file_contents(join(self.data_path, "responses", "valid_response.xml.base64")) xml = b64decode(xml) dom = etree.fromstring(xml) - assertion_nodes = OneLogin_Saml2_XML.query(dom, '/samlp:Response/saml:Assertion') + assertion_nodes = OneLogin_Saml2_XML.query(dom, "/samlp:Response/saml:Assertion") self.assertEqual(1, len(assertion_nodes)) assertion = assertion_nodes[0] - self.assertIn('Assertion', assertion.tag) + self.assertIn("Assertion", assertion.tag) - attribute_statement_nodes = OneLogin_Saml2_XML.query(dom, '/samlp:Response/saml:Assertion/saml:AttributeStatement') + attribute_statement_nodes = OneLogin_Saml2_XML.query(dom, "/samlp:Response/saml:Assertion/saml:AttributeStatement") self.assertEqual(1, len(assertion_nodes)) attribute_statement = attribute_statement_nodes[0] - self.assertIn('AttributeStatement', attribute_statement.tag) + self.assertIn("AttributeStatement", attribute_statement.tag) - attribute_statement_nodes_2 = OneLogin_Saml2_XML.query(dom, './saml:AttributeStatement', assertion) + attribute_statement_nodes_2 = OneLogin_Saml2_XML.query(dom, "./saml:AttributeStatement", assertion) self.assertEqual(1, len(attribute_statement_nodes_2)) attribute_statement_2 = attribute_statement_nodes_2[0] self.assertEqual(attribute_statement, attribute_statement_2) - signature_res_nodes = OneLogin_Saml2_XML.query(dom, '/samlp:Response/ds:Signature') + signature_res_nodes = OneLogin_Saml2_XML.query(dom, "/samlp:Response/ds:Signature") self.assertEqual(1, len(signature_res_nodes)) signature_res = signature_res_nodes[0] - self.assertIn('Signature', signature_res.tag) + self.assertIn("Signature", signature_res.tag) - signature_nodes = OneLogin_Saml2_XML.query(dom, '/samlp:Response/saml:Assertion/ds:Signature') + signature_nodes = OneLogin_Saml2_XML.query(dom, "/samlp:Response/saml:Assertion/ds:Signature") self.assertEqual(1, len(signature_nodes)) signature = signature_nodes[0] - self.assertIn('Signature', signature.tag) + self.assertIn("Signature", signature.tag) - signature_nodes_2 = OneLogin_Saml2_XML.query(dom, './ds:Signature', assertion) + signature_nodes_2 = OneLogin_Saml2_XML.query(dom, "./ds:Signature", assertion) self.assertEqual(1, len(signature_nodes_2)) signature2 = signature_nodes_2[0] self.assertNotEqual(signature_res, signature2) self.assertEqual(signature, signature2) - signature_nodes_3 = OneLogin_Saml2_XML.query(dom, './ds:SignatureValue', assertion) + signature_nodes_3 = OneLogin_Saml2_XML.query(dom, "./ds:SignatureValue", assertion) self.assertEqual(0, len(signature_nodes_3)) - signature_nodes_4 = OneLogin_Saml2_XML.query(dom, './ds:Signature/ds:SignatureValue', assertion) + signature_nodes_4 = OneLogin_Saml2_XML.query(dom, "./ds:Signature/ds:SignatureValue", assertion) self.assertEqual(1, len(signature_nodes_4)) - signature_nodes_5 = OneLogin_Saml2_XML.query(dom, './/ds:SignatureValue', assertion) + signature_nodes_5 = OneLogin_Saml2_XML.query(dom, ".//ds:SignatureValue", assertion) self.assertEqual(1, len(signature_nodes_5))