hobo/hobo/franceconnect/forms.py

62 lines
2.4 KiB
Python

# hobo - portal to configure and deploy applications
# Copyright (C) 2015-2019 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django import forms
from django.utils.translation import ugettext_lazy as _
class SettingsForm(forms.Form):
platform = forms.ChoiceField(
label=_('Platform'),
choices=[
('prod', _('Production')),
('test', _('Integration')),
],
)
client_id = forms.CharField(
label=_('Client ID'),
help_text=_(
'See <a href="https://partenaires.franceconnect.gouv.fr/fcp/fournisseur-service">'
'FranceConnect partners site</a> for getting client ID and secret.'
),
widget=forms.TextInput(attrs={'size': 64}),
)
client_secret = forms.CharField(label=_('Client Secret'), widget=forms.TextInput(attrs={'size': 64}))
scopes = forms.MultipleChoiceField(
label=_('Scopes'),
choices=[
('given_name', _('given name (given_name)')),
('gender', _('gender (gender)')),
('birthdate', _('birthdate (birthdate)')),
('birthcountry', _('birthcountry (birthcountry)')),
('birthplace', _('birthplace (birthplace)')),
('family_name', _('family name (family_name)')),
('email', _('email (email)')),
('preferred_username', _('usual family name (preferred_username)')),
('address', _('address (address)')),
('phone', _('phone (phone)')),
('identite_pivot', _('identite_pivot (identite_pivot)')),
('profile', _('profile (profile)')),
('birth', _('birth profile (birth)')),
],
widget=forms.CheckboxSelectMultiple,
help_text=_('These scopes will be requested in addition to openid'),
)
class EnableForm(forms.Form):
pass