2019-11-07 16:02:56 +00:00
|
|
|
"""passbook SAML SP Forms"""
|
|
|
|
|
|
|
|
from django import forms
|
2019-11-07 16:28:59 +00:00
|
|
|
from django.contrib.admin.widgets import FilteredSelectMultiple
|
|
|
|
from django.utils.translation import gettext as _
|
2019-11-07 16:02:56 +00:00
|
|
|
|
2019-11-07 16:28:59 +00:00
|
|
|
from passbook.admin.forms.source import SOURCE_FORM_FIELDS
|
2019-11-07 16:02:56 +00:00
|
|
|
from passbook.sources.saml.models import SAMLSource
|
|
|
|
|
|
|
|
|
|
|
|
class SAMLSourceForm(forms.ModelForm):
|
|
|
|
"""SAML Provider form"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = SAMLSource
|
2019-12-31 11:51:16 +00:00
|
|
|
fields = SOURCE_FORM_FIELDS + [
|
2020-02-20 20:33:45 +00:00
|
|
|
"issuer",
|
2019-12-31 11:51:16 +00:00
|
|
|
"idp_url",
|
|
|
|
"idp_logout_url",
|
|
|
|
"auto_logout",
|
2020-03-03 22:35:38 +00:00
|
|
|
"signing_kp",
|
2019-12-31 11:51:16 +00:00
|
|
|
]
|
2019-11-07 16:02:56 +00:00
|
|
|
widgets = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"name": forms.TextInput(),
|
|
|
|
"policies": FilteredSelectMultiple(_("policies"), False),
|
2020-02-20 20:33:45 +00:00
|
|
|
"issuer": forms.TextInput(),
|
2019-12-31 11:51:16 +00:00
|
|
|
"idp_url": forms.TextInput(),
|
|
|
|
"idp_logout_url": forms.TextInput(),
|
2019-11-07 16:02:56 +00:00
|
|
|
}
|