Skip to content

Commit 50f1755

Browse files
authored
Merge pull request #1 from reciprocity/ds/INFRA-831
chore(INFRA-831): move application to a new namespace (python3_saml) to avoid conflicting with onelogin
2 parents 52d2ac8 + 0750c1c commit 50f1755

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+209
-206
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ PYTEST=pytest
55
COVERAGE=coverage
66
COVERAGE_CONFIG=tests/coverage.rc
77
COVERALLS=coveralls
8-
MAIN_SOURCE=src/onelogin/saml2
8+
MAIN_SOURCE=src/python3_saml/saml2
99
DEMOS=demo-django demo-flask demo-tornado demo_pyramid
10-
TESTS=tests/src/OneLogin/saml2_tests
10+
TESTS=tests/src/Python3Saml/saml2_tests
1111
SOURCES=$(MAIN_SOURCE) $(DEMOS) $(TESTS)
1212

1313
install-req:

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The toolkit is hosted on GitHub. You can download it from:
112112
* Latest release: https://github.com/saml-toolkits/python3-saml/releases/latest
113113
* Master repo: https://github.com/saml-toolkits/python3-saml/tree/master
114114

115-
Find the core of the library at ``src/onelogin/saml2`` folder.
115+
Find the core of the library at ``src/python3_saml/saml2`` folder.
116116

117117
#### Option 2. Download from pypi ####
118118

@@ -165,7 +165,7 @@ In order to avoid them, the SP can keep a list of SAML Messages or Assertion IDs
165165
to be stored the amount of time of the SAML Message life time, so
166166
we don't need to store all processed message/assertion Ids, but the most recent ones.
167167

168-
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
168+
The OneLogin_Saml2_Auth class contains the `get_last_request_id`, `get_last_message_id` and `get_last_assertion_id` methods to retrieve the IDs
169169

170170
Checking that the ID of the current Message/Assertion does not exists in the list of the ones already processed will prevent replay attacks.
171171

@@ -181,7 +181,7 @@ Let's start describing them:
181181

182182
#### src ####
183183

184-
This folder contains the heart of the toolkit, **onelogin/saml2** folder contains the new version of
184+
This folder contains the heart of the toolkit, **python3_saml/saml2** folder contains the new version of
185185
the classes and methods that are described in a later section.
186186

187187
#### demo-django ####
@@ -240,12 +240,12 @@ make pytest
240240
```
241241
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:
242242
```
243-
pytest tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test
243+
pytest tests/src/Python3Saml/saml2_tests/auth_test.py::Python3Saml_Saml2_Auth_Test
244244
```
245245

246246
Or for an specific method:
247247
```
248-
pytest tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testBuildRequestSignature
248+
pytest tests/src/Python3Saml/saml2_tests/auth_test.py::Python3Saml_Saml2_Auth_Test::testBuildRequestSignature
249249
```
250250

251251

@@ -325,7 +325,7 @@ This is the ``settings.json`` file:
325325
},
326326
// Specifies the constraints on the name identifier to be used to
327327
// represent the requested subject.
328-
// Take a look on src/onelogin/saml2/constants.py to see the NameIdFormat that are supported.
328+
// Take a look on src/python3_saml/saml2/constants.py to see the NameIdFormat that are supported.
329329
"NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
330330
// Usually X.509 cert and privateKey of the SP are provided by files placed at
331331
// the certs folder. But we can also provide them with the following parameters
@@ -609,9 +609,9 @@ In order to use the toolkit library you need to import the file that contains th
609609
on the top of your python file.
610610

611611
``` python
612-
from onelogin.saml2.auth import OneLogin_Saml2_Auth
613-
from onelogin.saml2.settings import OneLogin_Saml2_Settings
614-
from onelogin.saml2.utils import OneLogin_Saml2_Utils
612+
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
613+
from python3_saml.saml2.settings import OneLogin_Saml2_Settings
614+
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
615615
```
616616

617617
#### The Request ####
@@ -678,7 +678,7 @@ An explanation of some advanced request parameters:
678678
In order to send an ``AuthNRequest`` to the IdP:
679679

680680
```python
681-
from onelogin.saml2.auth import OneLogin_Saml2_Auth
681+
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
682682

683683
req = prepare_request_for_toolkit(request)
684684
auth = OneLogin_Saml2_Auth(req) # Constructor of the SP, loads settings.json

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# python3-saml changelog
2+
### 2.0.0 (Oct 29, 2025)
3+
- Move namespace from onelogin to python3_saml to avoid conflicts with onelogin
4+
25
### 1.16.0 (Oct 9, 2023)
36
- [#364](https://github.com/SAML-Toolkits/python3-saml/commit/d1bfaeb17a786735827b8252b91deafde29dabd8) Improve get_metadata method from Parser, allowing to set headers
47
- Fix WantAuthnRequestsSigned parser

demo-django/demo/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError
44
from django.shortcuts import render
55

6-
from onelogin.saml2.auth import OneLogin_Saml2_Auth
7-
from onelogin.saml2.settings import OneLogin_Saml2_Settings
8-
from onelogin.saml2.utils import OneLogin_Saml2_Utils
6+
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
7+
from python3_saml.saml2.settings import OneLogin_Saml2_Settings
8+
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
99

1010

1111
def init_saml_auth(req):

demo-flask/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from flask import Flask, request, render_template, redirect, session, make_response
44

5-
from onelogin.saml2.auth import OneLogin_Saml2_Auth
6-
from onelogin.saml2.utils import OneLogin_Saml2_Utils
5+
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
6+
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
77

88

99
app = Flask(__name__)

demo-tornado/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import tornado.httpserver
55
import tornado.httputil
66

7-
from onelogin.saml2.auth import OneLogin_Saml2_Auth
8-
from onelogin.saml2.utils import OneLogin_Saml2_Utils
7+
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
8+
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
99

1010
# Global session info
1111
session = {}

demo_pyramid/demo_pyramid/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
)
88
from pyramid.view import view_config
99

10-
from onelogin.saml2.auth import OneLogin_Saml2_Auth
11-
from onelogin.saml2.utils import OneLogin_Saml2_Utils
10+
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
11+
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
1212

1313
SAML_PATH = os.path.join(os.path.dirname(__file__), "saml")
1414

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ lint = [
5858
package-dir = {"" = "src"}
5959

6060
[tool.setuptools.package-data]
61-
"onelogin.saml2.schemas" = ["*.xsd"]
61+
"python3_saml.saml2.schemas" = ["*.xsd"]
6262

6363
[tool.pytest.ini_options]
6464
minversion = "4.6.11"
@@ -99,7 +99,7 @@ branch = true
9999

100100
[tool.coverage.paths]
101101
source = [
102-
"src/onelogin/saml2"
102+
"src/python3_saml/saml2"
103103
]
104104

105105
[tool.coverage.report]

0 commit comments

Comments
 (0)