This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/core/forms/rules.py

37 lines
980 B
Python

"""passbook rule forms"""
from django import forms
from passbook.core.models import FieldMatcherRule, WebhookRule
class FieldMatcherRuleForm(forms.ModelForm):
"""FieldMatcherRule Form"""
class Meta:
model = FieldMatcherRule
fields = ['name', 'action', 'negate', 'order',
'user_field', 'match_action', 'value', ]
widgets = {
'name': forms.TextInput(),
'user_field': forms.TextInput(),
'value': forms.TextInput(),
}
class WebhookRuleForm(forms.ModelForm):
"""WebhookRuleForm Form"""
class Meta:
model = WebhookRule
fields = ['url', 'method', 'json_body', 'json_headers',
'result_jsonpath', 'result_json_value', ]
widgets = {
'json_body': forms.TextInput(),
'json_headers': forms.TextInput(),
'result_jsonpath': forms.TextInput(),
'result_json_value': forms.TextInput(),
}