Skip to content

Commit 67084b6

Browse files
committed
WIP
1 parent f53976e commit 67084b6

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/scripts/before_install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ services:
7979
image: "docker.io/pulp/pulp-fixtures:latest"
8080
env:
8181
BASE_URL: "http://pulp-fixtures:8080"
82+
- name: "saml2-idp"
83+
image: "ghcr.io/pfrest/mock-saml2-idp:latest"
84+
env:
85+
SP_ENTITY_ID: "http://pulp"
86+
SP_ACS_LOCATION: "http://pulp/saml/acs/"
8287
VARSYAML
8388

8489
if [ "$TEST" = "s3" ]; then

ci_requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
1+
pulpcore[saml2]
2+
djangosaml2

pulpcore/app/settings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@
160160
"pulpcore.backends.ObjectRolePermissionBackend",
161161
]
162162

163+
if True: # SAML2
164+
INSTALLED_APPS.append("djangosaml2")
165+
MIDDLEWARE.append("djangosaml2.middleware.SamlSessionMiddleware")
166+
AUTHENTICATION_BACKENDS.append("djangosaml2.backends.Saml2Backend")
167+
LOGIN_URL = "/saml2/login/"
168+
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
169+
163170
ROOT_URLCONF = "pulpcore.app.urls"
164171

165172
TEMPLATES = [

pulpcore/app/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ class NoSchema(p.callback.cls):
245245
path("", include("social_django.urls", namespace=settings.SOCIAL_AUTH_URL_NAMESPACE))
246246
)
247247

248+
if "djangosaml2" in settings.INSTALLED_APPS:
249+
urlpatterns.append(path("saml2/", include("djangosaml2.urls", namespace="saml2")))
250+
248251
#: The Pulp Platform v3 API router, which can be used to manually register ViewSets with the API.
249252
root_router = PulpDefaultRouter()
250253

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ s3 = ["django-storages[boto3]==1.14.6"]
7373
google = ["django-storages[google]==1.14.6"]
7474
azure = ["django-storages[azure]==1.14.6"]
7575
prometheus = ["django-prometheus"]
76+
saml2 = ["djangosaml2>=1.12.0,<1.13"]
7677
kafka = [
7778
# Pinned because project warns "things might (and will) break with every update"
7879
"cloudevents==1.11.0",

0 commit comments

Comments
 (0)