@ -57,6 +57,9 @@ class ProxyProviderSerializer(ModelSerializer):
|
||||
"internal_host_ssl_validation",
|
||||
"certificate",
|
||||
"skip_path_regex",
|
||||
"basic_auth_enabled",
|
||||
"basic_auth_password_attribute",
|
||||
"basic_auth_user_attribute",
|
||||
]
|
||||
|
||||
|
||||
@ -97,6 +100,9 @@ class ProxyOutpostConfigSerializer(ModelSerializer):
|
||||
"cookie_secret",
|
||||
"certificate",
|
||||
"skip_path_regex",
|
||||
"basic_auth_enabled",
|
||||
"basic_auth_password_attribute",
|
||||
"basic_auth_user_attribute",
|
||||
]
|
||||
|
||||
@swagger_serializer_method(serializer_or_field=OpenIDConnectConfigurationSerializer)
|
||||
|
||||
@ -37,9 +37,14 @@ class ProxyProviderForm(forms.ModelForm):
|
||||
"external_host",
|
||||
"certificate",
|
||||
"skip_path_regex",
|
||||
"basic_auth_enabled",
|
||||
"basic_auth_user_attribute",
|
||||
"basic_auth_password_attribute",
|
||||
]
|
||||
widgets = {
|
||||
"name": forms.TextInput(),
|
||||
"internal_host": forms.TextInput(),
|
||||
"external_host": forms.TextInput(),
|
||||
"basic_auth_user_attribute": forms.TextInput(),
|
||||
"basic_auth_password_attribute": forms.TextInput(),
|
||||
}
|
||||
|
||||
@ -66,6 +66,31 @@ class ProxyProvider(OutpostModel, OAuth2Provider):
|
||||
),
|
||||
)
|
||||
|
||||
basic_auth_enabled = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name=_("Set HTTP-Basic Authentication"),
|
||||
help_text=_(
|
||||
"Set a custom HTTP-Basic Authentication header based on values from passbook."
|
||||
),
|
||||
)
|
||||
basic_auth_user_attribute = models.TextField(
|
||||
blank=True,
|
||||
verbose_name=_("HTTP-Basic Username"),
|
||||
help_text=_(
|
||||
(
|
||||
"User Attribute used for the user part of the HTTP-Basic Header. "
|
||||
"If not set, the user's Email address is used."
|
||||
)
|
||||
),
|
||||
)
|
||||
basic_auth_password_attribute = models.TextField(
|
||||
blank=True,
|
||||
verbose_name=_("HTTP-Basic Password"),
|
||||
help_text=_(
|
||||
("User Attribute used for the password part of the HTTP-Basic Header.")
|
||||
),
|
||||
)
|
||||
|
||||
certificate = models.ForeignKey(
|
||||
CertificateKeyPair, on_delete=models.SET_NULL, null=True, blank=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user