Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SAML user does not exist logging call #185

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8ef067f
all changes from integrated code
jpmanthorp Dec 2, 2022
baae797
update metadata url code to use current domain as a prefix
jpmanthorp Dec 5, 2022
b5c0044
create migrations folder
jpmanthorp Dec 5, 2022
9212854
fixed bugs
jpmanthorp Dec 5, 2022
9bdf3f3
bug fix
jpmanthorp Dec 5, 2022
32696ca
minor changes
jpmanthorp Dec 16, 2022
75a12fc
use named temp file
jpmanthorp Dec 28, 2022
25b0bc5
attemtp to build metadata store
jpmanthorp Dec 28, 2022
e537268
import metadata store from different module and use different parsing…
jpmanthorp Dec 28, 2022
d2ebdca
correctly initialize a metadata store and then parse the metadata fil…
jpmanthorp Dec 29, 2022
fe45ac0
use inmemory metadata object to actually parse
jpmanthorp Dec 29, 2022
a5e112b
tmp file approach:
jpmanthorp Dec 29, 2022
e027f9d
seek back to start of temp file
jpmanthorp Dec 29, 2022
7a18586
cleanup
jpmanthorp Dec 29, 2022
a17e11e
hide attributes map accesses
jpmanthorp Dec 29, 2022
c903ae4
use context manager for tmp file
jpmanthorp Dec 29, 2022
34975b0
dont encode metadata contents
jpmanthorp Dec 29, 2022
1b07860
change helper method into a context provider
jpmanthorp Dec 29, 2022
075ed6d
uncommented preexisting code
jpmanthorp Jan 3, 2023
4f19e9f
Merge pull request #1 from passth/supportDynamicMetadata
jpmanthorp Jan 5, 2023
94c9117
move saml attributes inside of new user creation
jpmanthorp Jan 5, 2023
03b9715
Merge pull request #2 from passth/jm/moveSamlAttribVars
alexandrelaplante Jan 6, 2023
cbef237
add new model fields for gradual rollout
jpmanthorp Mar 8, 2023
41dff9e
set defaults and added new migration files
jpmanthorp Mar 8, 2023
cdc504d
add in help text for new field
jpmanthorp Mar 8, 2023
fd1df73
Merge pull request #3 from passth/jm-optionalSaml
jpmanthorp Mar 8, 2023
46c1090
add print statements for next url
jpmanthorp Mar 30, 2023
841ca60
update data that is printed
jpmanthorp Mar 30, 2023
7773b69
print session key
jpmanthorp Mar 30, 2023
65c153c
attempt to use relay states
jpmanthorp Mar 30, 2023
7f75597
bug fix
jpmanthorp Mar 30, 2023
9ce477d
dont print out data, add explanatory comment
jpmanthorp Mar 31, 2023
563eb46
Merge pull request #4 from passth/jm-printSessionNextUrl
jpmanthorp Mar 31, 2023
32ff85f
Add missing migration to package
vincepassthrough Apr 18, 2023
7679aa2
Merge pull request #5 from passth/vw-fix-missing-migration
vincepassthrough Apr 19, 2023
fe3115e
Make scheme https
vincepassthrough Aug 30, 2023
6ca2278
Merge pull request #6 from passth/vw-whitelabel-fix
vincepassthrough Aug 30, 2023
20d8759
add print statements
alexandrelaplante Sep 29, 2023
4a422f5
more prints
alexandrelaplante Sep 29, 2023
85ce50a
lower
alexandrelaplante Sep 29, 2023
84cf045
use logging
alexandrelaplante Sep 29, 2023
f7f2dfe
Merge pull request #7 from passth/al/print-statements
alexandrelaplante Sep 29, 2023
b0774cf
Allow blank metadata
vincepassthrough Oct 9, 2023
b47d4be
Polish and add migration
vincepassthrough Oct 9, 2023
06b8f83
Merge pull request #8 from passth/vw-blank-metadata
vincepassthrough Oct 9, 2023
f4e872c
manually format the string ourselves
jpmanthorp Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions django_saml2_auth/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.16 on 2022-12-05 18:09

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='SamlMetaData',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('updated_at', models.DateTimeField(auto_now=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('metadata_contents', models.TextField()),
('email_domain', models.TextField(unique=True)),
],
),
]
25 changes: 25 additions & 0 deletions django_saml2_auth/migrations/0002_auto_20230308_1725.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.18 on 2023-03-08 17:25

from django.db import migrations, models
import passthrough.operations


class Migration(migrations.Migration):

dependencies = [
("django_saml2_auth", "0001_initial"),
]

operations = [
passthrough.operations.LockTimeout(),
migrations.AddField(
model_name="samlmetadata",
name="enable_optional_saml",
field=models.BooleanField(blank=True, null=True),
),
migrations.AddField(
model_name="samlmetadata",
name="enable_saml",
field=models.BooleanField(blank=True, null=True),
),
]
25 changes: 25 additions & 0 deletions django_saml2_auth/migrations/0003_auto_20230308_1726.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.18 on 2023-03-08 17:26

from django.db import migrations, models
import passthrough.operations


class Migration(migrations.Migration):

dependencies = [
("django_saml2_auth", "0002_auto_20230308_1725"),
]

operations = [
passthrough.operations.LockTimeout(),
migrations.AlterField(
model_name="samlmetadata",
name="enable_optional_saml",
field=models.BooleanField(blank=True, default=False, null=True),
),
migrations.AlterField(
model_name="samlmetadata",
name="enable_saml",
field=models.BooleanField(blank=True, default=False, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.18 on 2023-03-14 22:35

from django.db import migrations, models
import passthrough.operations


class Migration(migrations.Migration):

dependencies = [
("django_saml2_auth", "0003_auto_20230308_1726"),
]

operations = [
passthrough.operations.LockTimeout(),
migrations.AlterField(
model_name="samlmetadata",
name="enable_optional_saml",
field=models.BooleanField(
blank=True,
default=False,
help_text="when False, SAML is forced if it is enabled. When True, SAML is optional when it is enabled.",
null=True,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.20 on 2023-10-09 14:16

from django.db import migrations, models
import passthrough.operations


class Migration(migrations.Migration):

dependencies = [
('django_saml2_auth', '0004_alter_samlmetadata_enable_optional_saml'),
]

operations = [
passthrough.operations.LockTimeout(),
migrations.AlterField(
model_name='samlmetadata',
name='metadata_contents',
field=models.TextField(blank=True),
),
]
Empty file.
31 changes: 31 additions & 0 deletions django_saml2_auth/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from django.db import models
from uuid import uuid4

class SamlMetaData(models.Model):
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
updated_at = models.DateTimeField(
auto_now=True,
null=True,
blank=True,
)
created_at = models.DateTimeField(auto_now_add=True)
metadata_contents = models.TextField(blank=True)
email_domain = models.TextField(unique=True)

enable_saml = models.BooleanField(
blank=True,
null=True,
default=False,
)
enable_optional_saml = models.BooleanField(
blank=True,
null=True,
default=False,
help_text=(
"when False, SAML is forced if it is enabled. "
"When True, SAML is optional when it is enabled."
),
)

def __str__(self):
return f"<SAML Metadata: {self.email_domain}>"
3 changes: 2 additions & 1 deletion django_saml2_auth/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.conf.urls import url
from django.urls import path
from . import views

app_name = 'django_saml2_auth'

urlpatterns = [
url(r'^acs/$', views.acs, name="acs"),
path("<uuid:metadata_id>/acs/", views.acs, name="acs"),
url(r'^welcome/$', views.welcome, name="welcome"),
url(r'^denied/$', views.denied, name="denied"),
]
Loading