providers/saml: add custom help text for templates, add docs for User Object reference
This commit is contained in:
parent
9400b01a55
commit
bc4b7ef44d
|
@ -0,0 +1,20 @@
|
||||||
|
# Passbook User Object
|
||||||
|
|
||||||
|
The User object has the following attributes:
|
||||||
|
|
||||||
|
- `username`: User's Username
|
||||||
|
- `email` User's E-Mail
|
||||||
|
- `name` User's Display Name
|
||||||
|
- `is_staff` Boolean field if user is staff
|
||||||
|
- `is_active` Boolean field if user is active
|
||||||
|
- `date_joined` Date User joined/was created
|
||||||
|
- `password_change_date` Date Password was last changed
|
||||||
|
- `attributes` Dynamic Attributes
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
List all the User's Group Names
|
||||||
|
|
||||||
|
```jinja2
|
||||||
|
[{% for group in user.groups.all() %}'{{ group.name }}',{% endfor %}]
|
||||||
|
```
|
|
@ -19,6 +19,9 @@ nav:
|
||||||
- Rancher: integrations/services/rancher/index.md
|
- Rancher: integrations/services/rancher/index.md
|
||||||
- Harbor: integrations/services/harbor/index.md
|
- Harbor: integrations/services/harbor/index.md
|
||||||
- Sentry: integrations/services/sentry/index.md
|
- Sentry: integrations/services/sentry/index.md
|
||||||
|
- Reference:
|
||||||
|
- Property Mappings:
|
||||||
|
- User Object: reference/property-mappings/user-object.md
|
||||||
|
|
||||||
repo_name: "BeryJu.org/passbook"
|
repo_name: "BeryJu.org/passbook"
|
||||||
repo_url: https://github.com/BeryJu/passbook
|
repo_url: https://github.com/BeryJu/passbook
|
||||||
|
|
|
@ -59,6 +59,8 @@ class SAMLProviderForm(forms.ModelForm):
|
||||||
class SAMLPropertyMappingForm(forms.ModelForm):
|
class SAMLPropertyMappingForm(forms.ModelForm):
|
||||||
"""SAML Property Mapping form"""
|
"""SAML Property Mapping form"""
|
||||||
|
|
||||||
|
template_name = "saml/idp/property_mapping_form.html"
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
model = SAMLPropertyMapping
|
model = SAMLPropertyMapping
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{% extends "generic/form.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block beneath_form %}
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="col-sm-2 control-label" for="friendly_name-2">
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<p>
|
||||||
|
Expression using <a href="https://jinja.palletsprojects.com/en/2.11.x/templates/">Jinja</a>. Following variables are available:
|
||||||
|
<ul>
|
||||||
|
<li><code>user</code>: Passbook User Object (<a href="https://beryju.github.io/passbook/reference/property-mappings/user-object/">Reference</a>)</li>
|
||||||
|
<li><code>request</code>: Django HTTP Request Object (<a href="https://docs.djangoproject.com/en/3.0/ref/request-response/#httprequest-objects">Reference</a>) </li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
|
@ -50,6 +50,8 @@ class LDAPSourceForm(forms.ModelForm):
|
||||||
class LDAPPropertyMappingForm(forms.ModelForm):
|
class LDAPPropertyMappingForm(forms.ModelForm):
|
||||||
"""LDAP Property Mapping form"""
|
"""LDAP Property Mapping form"""
|
||||||
|
|
||||||
|
template_name = "ldap/property_mapping_form.html"
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
model = LDAPPropertyMapping
|
model = LDAPPropertyMapping
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{% extends "generic/form.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block beneath_form %}
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="col-sm-2 control-label" for="friendly_name-2">
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<p>
|
||||||
|
Expression using <a href="https://jinja.palletsprojects.com/en/2.11.x/templates/">Jinja</a>. Following variables are available:
|
||||||
|
<ul>
|
||||||
|
<li><code>ldap</code>: A Dictionary of all values retrieved from LDAP.</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Reference in New Issue