Skip to content

Commit 3adf499

Browse files
committed
help_text
1 parent 9f7c3b3 commit 3adf499

File tree

17 files changed

+806
-55
lines changed

17 files changed

+806
-55
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.16 on 2024-11-21 11:14
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('dab_activitystream', '0003_alter_entry_options'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='entry',
18+
name='created',
19+
field=models.DateTimeField(auto_now_add=True, help_text='The date/time this resource was created.'),
20+
),
21+
migrations.AlterField(
22+
model_name='entry',
23+
name='created_by',
24+
field=models.ForeignKey(default=None, editable=False, help_text='The user who created this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_created+', to=settings.AUTH_USER_MODEL),
25+
),
26+
]

ansible_base/authentication/authenticator_plugins/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _field_required(field):
2424
class BaseAuthenticatorConfiguration(serializers.Serializer):
2525
documentation_url = None
2626
ADDITIONAL_UNVERIFIED_ARGS = JSONField(
27-
help_text=_("Any additional fields that this authenticator can take, they are not validated and passed directly back to the authenticator"),
27+
help_text=_("Any additional fields that this authenticator can take. They are not validated and passed directly back to the authenticator."),
2828
required=False,
2929
allow_null=True,
3030
ui_field_label=_('Additional Authenticator Fields'),

ansible_base/authentication/authenticator_plugins/oidc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OpenIdConnectConfiguration(BaseAuthenticatorConfiguration):
3939
#################################
4040

4141
OIDC_ENDPOINT = URLField(
42-
help_text=_("The URL for your OIDC provider including the path up to /.well-known/openid-configuration"),
42+
help_text=_("The URL for your OIDC provider including the path up to /.well-known/openid-configuration."),
4343
allow_null=False,
4444
ui_field_label=_('OIDC Provider URL'),
4545
)
@@ -122,7 +122,7 @@ class OpenIdConnectConfiguration(BaseAuthenticatorConfiguration):
122122
)
123123

124124
JWT_DECODE_OPTIONS = DictField(
125-
help_text=_("OIDC JWT decoding options for token validation and processing"),
125+
help_text=_("OIDC JWT decoding options for token validation and processing."),
126126
default=None,
127127
allow_null=True,
128128
ui_field_label=_('OIDC JWT Decode Options.'),
@@ -165,7 +165,7 @@ class OpenIdConnectConfiguration(BaseAuthenticatorConfiguration):
165165
)
166166

167167
RESPONSE_TYPE = CharField(
168-
help_text=_("The reponse type the OIDC endpoint should return. Common values are 'code', 'id_token' and 'token'."),
168+
help_text=_("The response type the OIDC endpoint should return. Common values are 'code', 'id_token' and 'token'."),
169169
default="code",
170170
allow_null=True,
171171
ui_field_label=_("Response Type"),

ansible_base/authentication/authenticator_plugins/saml.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class SAMLConfiguration(BaseAuthenticatorConfiguration):
9292
SECURITY_CONFIG = JSONField(
9393
default={},
9494
help_text=_(
95-
"A dict of key value pairs that are passed to the underlying python-saml security setting https://github.com/onelogin/python-saml#settings"
95+
"A dict of key value pairs that are passed to the underlying python-saml security setting https://github.com/onelogin/python-saml#settings."
9696
),
9797
ui_field_label=_('SAML Security Config'),
9898
)
@@ -108,7 +108,7 @@ class SAMLConfiguration(BaseAuthenticatorConfiguration):
108108
)
109109
IDP_X509_CERT = PublicCert(
110110
allow_null=False,
111-
help_text=_("The public cert used for secrets coming from the IdP."),
111+
help_text=_("The public certificate used for secrets coming from the IdP."),
112112
ui_field_label=_('IdP Public Cert'),
113113
)
114114
IDP_ENTITY_ID = CharField(
@@ -119,34 +119,34 @@ class SAMLConfiguration(BaseAuthenticatorConfiguration):
119119
IDP_GROUPS = CharField(
120120
allow_null=True,
121121
required=False,
122-
help_text=_("The field in the assertion which represents the users groups."),
122+
help_text=_("The field in the assertion which represents the user's groups."),
123123
ui_field_label=_('Groups'),
124124
)
125125
IDP_ATTR_EMAIL = CharField(
126126
allow_null=True,
127-
help_text=_("The field in the assertion which represents the users email."),
127+
help_text=_("The field in the assertion which represents the user's email."),
128128
ui_field_label=_('User Email'),
129129
)
130130
IDP_ATTR_USERNAME = CharField(
131131
allow_null=True,
132132
required=False,
133-
help_text=_("The field in the assertion which represents the users username."),
133+
help_text=_("The field in the assertion which represents the user's username."),
134134
ui_field_label=_('Username'),
135135
)
136136
IDP_ATTR_LAST_NAME = CharField(
137137
allow_null=True,
138-
help_text=_("The field in the assertion which represents the users last name."),
138+
help_text=_("The field in the assertion which represents the user's last name."),
139139
ui_field_label=_('User Last Name'),
140140
)
141141
IDP_ATTR_FIRST_NAME = CharField(
142142
allow_null=True,
143-
help_text=_("The field in the assertion which represents the users first name."),
143+
help_text=_("The field in the assertion which represents the user's first name."),
144144
ui_field_label=_('User First Name'),
145145
)
146146
IDP_ATTR_USER_PERMANENT_ID = CharField(
147147
allow_null=True,
148148
required=False,
149-
help_text=_("The field in the assertion which represents the users permanent id (overrides IDP_ATTR_USERNAME)"),
149+
help_text=_("The field in the assertion which represents the user's permanent id (overrides IDP_ATTR_USERNAME)"),
150150
ui_field_label=_('User Permanent ID'),
151151
)
152152
CALLBACK_URL = URLField(
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Generated by Django 4.2.16 on 2024-11-21 11:14
2+
3+
import ansible_base.authentication.models.authenticator
4+
from django.conf import settings
5+
from django.db import migrations, models
6+
import django.db.models.deletion
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
13+
('dab_authentication', '0014_authenticator_auto_migrate_users_to'),
14+
]
15+
16+
operations = [
17+
migrations.AlterField(
18+
model_name='authenticator',
19+
name='category',
20+
field=models.CharField(default=None, help_text='The base type of this authenticator.', max_length=30),
21+
),
22+
migrations.AlterField(
23+
model_name='authenticator',
24+
name='configuration',
25+
field=models.JSONField(blank=True, default=dict, help_text='The required configuration for this source.'),
26+
),
27+
migrations.AlterField(
28+
model_name='authenticator',
29+
name='create_objects',
30+
field=models.BooleanField(default=True, help_text='Allow authenticator to create objects (users, teams, organizations).'),
31+
),
32+
migrations.AlterField(
33+
model_name='authenticator',
34+
name='created',
35+
field=models.DateTimeField(auto_now_add=True, help_text='The date/time this resource was created.'),
36+
),
37+
migrations.AlterField(
38+
model_name='authenticator',
39+
name='created_by',
40+
field=models.ForeignKey(default=None, editable=False, help_text='The user who created this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_created+', to=settings.AUTH_USER_MODEL),
41+
),
42+
migrations.AlterField(
43+
model_name='authenticator',
44+
name='enabled',
45+
field=models.BooleanField(default=False, help_text='Should this authenticator be enabled.'),
46+
),
47+
migrations.AlterField(
48+
model_name='authenticator',
49+
name='modified',
50+
field=models.DateTimeField(auto_now=True, help_text='The date/time this resource was created.'),
51+
),
52+
migrations.AlterField(
53+
model_name='authenticator',
54+
name='modified_by',
55+
field=models.ForeignKey(default=None, editable=False, help_text='The user who last modified this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_modified+', to=settings.AUTH_USER_MODEL),
56+
),
57+
migrations.AlterField(
58+
model_name='authenticator',
59+
name='name',
60+
field=models.CharField(help_text='The name of this resource.', max_length=512, unique=True),
61+
),
62+
migrations.AlterField(
63+
model_name='authenticator',
64+
name='order',
65+
field=models.IntegerField(default=ansible_base.authentication.models.authenticator.get_next_authenticator_order, help_text='The order in which an authenticator will be tried. This only pertains to username/password authenticators.'),
66+
),
67+
migrations.AlterField(
68+
model_name='authenticator',
69+
name='remove_users',
70+
field=models.BooleanField(default=True, help_text='When a user authenticates from this source should they be removed from any other groups they were previously added to.'),
71+
),
72+
migrations.AlterField(
73+
model_name='authenticator',
74+
name='slug',
75+
field=models.SlugField(default=None, editable=False, help_text='An immutable identifier for the authenticator.', max_length=1024, unique=True),
76+
),
77+
migrations.AlterField(
78+
model_name='authenticator',
79+
name='type',
80+
field=models.CharField(editable=False, help_text='The type of authentication service this is.', max_length=256),
81+
),
82+
migrations.AlterField(
83+
model_name='authenticatormap',
84+
name='authenticator',
85+
field=models.ForeignKey(help_text='The authenticator this mapping belongs to.', on_delete=django.db.models.deletion.CASCADE, related_name='authenticator_maps', to='dab_authentication.authenticator'),
86+
),
87+
migrations.AlterField(
88+
model_name='authenticatormap',
89+
name='created',
90+
field=models.DateTimeField(auto_now_add=True, help_text='The date/time this resource was created.'),
91+
),
92+
migrations.AlterField(
93+
model_name='authenticatormap',
94+
name='created_by',
95+
field=models.ForeignKey(default=None, editable=False, help_text='The user who created this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_created+', to=settings.AUTH_USER_MODEL),
96+
),
97+
migrations.AlterField(
98+
model_name='authenticatormap',
99+
name='map_type',
100+
field=models.CharField(choices=[('allow', 'allow'), ('is_superuser', 'is_superuser'), ('role', 'role'), ('organization', 'organization'), ('team', 'team')], default='team', help_text='What will the map grant the user? System access (allow) a team or organization membership, the superuser flag or a role in the system.', max_length=17),
101+
),
102+
migrations.AlterField(
103+
model_name='authenticatormap',
104+
name='modified',
105+
field=models.DateTimeField(auto_now=True, help_text='The date/time this resource was created.'),
106+
),
107+
migrations.AlterField(
108+
model_name='authenticatormap',
109+
name='modified_by',
110+
field=models.ForeignKey(default=None, editable=False, help_text='The user who last modified this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_modified+', to=settings.AUTH_USER_MODEL),
111+
),
112+
migrations.AlterField(
113+
model_name='authenticatormap',
114+
name='name',
115+
field=models.CharField(help_text='The name of this resource.', max_length=512),
116+
),
117+
migrations.AlterField(
118+
model_name='authenticatormap',
119+
name='order',
120+
field=models.PositiveIntegerField(default=0, help_text='The order in which this rule should be processed, smaller numbers are of higher precedence. Items with the same order will be executed in random order.'),
121+
),
122+
migrations.AlterField(
123+
model_name='authenticatormap',
124+
name='organization',
125+
field=models.CharField(blank=True, default=None, help_text='An organization name this rule works on.', max_length=512, null=True),
126+
),
127+
migrations.AlterField(
128+
model_name='authenticatormap',
129+
name='revoke',
130+
field=models.BooleanField(default=False, help_text='Should we revoke the permission if a user does not meet this rule.'),
131+
),
132+
migrations.AlterField(
133+
model_name='authenticatormap',
134+
name='role',
135+
field=models.CharField(blank=True, default=None, help_text='The role this map will grant the authenticating user to the targeted object.', max_length=512, null=True),
136+
),
137+
migrations.AlterField(
138+
model_name='authenticatormap',
139+
name='team',
140+
field=models.CharField(blank=True, default=None, help_text='A team name this rule works on.', max_length=512, null=True),
141+
),
142+
migrations.AlterField(
143+
model_name='authenticatormap',
144+
name='triggers',
145+
field=models.JSONField(blank=True, default=dict, help_text='Trigger information for this rule.'),
146+
),
147+
migrations.AlterField(
148+
model_name='authenticatormap',
149+
name='revoke',
150+
field=models.BooleanField(default=False, help_text='Revoke the permission if a user does not meet this rule.'),
151+
),
152+
]

ansible_base/authentication/models/authenticator.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ def get_next_authenticator_order():
1717

1818
class Authenticator(UniqueNamedCommonModel):
1919
ignore_relations = ['authenticator_users']
20-
enabled = fields.BooleanField(default=False, help_text="Should this authenticator be enabled")
21-
create_objects = fields.BooleanField(default=True, help_text="Allow authenticator to create objects (users, teams, organizations)")
20+
enabled = fields.BooleanField(default=False, help_text="Should this authenticator be enabled.")
21+
create_objects = fields.BooleanField(default=True, help_text="Allow authenticator to create objects (users, teams, organizations).")
2222
remove_users = fields.BooleanField(
23-
default=True, help_text="When a user authenticates from this source should they be removed from any other groups they were previously added to"
23+
default=True, help_text="When a user authenticates from this source should they be removed from any other groups they were previously added to."
2424
)
25-
configuration = prevent_search(JSONField(default=dict, help_text="The required configuration for this source", blank=True))
25+
configuration = prevent_search(JSONField(default=dict, help_text="The required configuration for this source.", blank=True))
2626
type = fields.CharField(
2727
editable=False,
2828
max_length=256,
29-
help_text="The type of authentication service this is",
29+
help_text="The type of authentication service this is.",
3030
)
3131
order = fields.IntegerField(
3232
default=get_next_authenticator_order,
33-
help_text="The order in which an authenticator will be tried. This only pertains to username/password authenticators",
33+
help_text="The order in which an authenticator will be tried. This only pertains to username/password authenticators.",
3434
)
35-
slug = fields.SlugField(max_length=1024, default=None, editable=False, unique=True, help_text="An immutable identifier for the authenticator")
36-
category = fields.CharField(max_length=30, default=None, help_text="The base type of this authenticator")
35+
slug = fields.SlugField(max_length=1024, default=None, editable=False, unique=True, help_text="An immutable identifier for the authenticator.")
36+
category = fields.CharField(max_length=30, default=None, help_text="The base type of this authenticator.")
3737

3838
auto_migrate_users_to = ForeignKey(
3939
"Authenticator",

ansible_base/authentication/models/authenticator_map.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class Meta:
2727
Authenticator,
2828
null=False,
2929
on_delete=models.CASCADE,
30-
help_text=_("The authenticator this mapping belongs to"),
30+
help_text=_("The authenticator this mapping belongs to."),
3131
related_name="authenticator_maps",
3232
)
3333
revoke = models.BooleanField(
3434
null=False,
3535
default=False,
36-
help_text=_("If a user does not meet this rule should we revoke the permission"),
36+
help_text=_("Revoke the permission if a user does not meet this rule."),
3737
)
3838

3939
map_type = models.CharField(
@@ -47,44 +47,44 @@ class Meta:
4747
('organization', 'organization'),
4848
('team', 'team'),
4949
],
50-
help_text=_('What will the map grant the user? System access (allow) a team or organization membership, the superuser flag or a role in the system'),
50+
help_text=_('What will the map grant the user? System access (allow) a team or organization membership, the superuser flag or a role in the system.'),
5151
)
5252

5353
role = models.CharField(
5454
max_length=512,
5555
null=True,
5656
default=None,
5757
blank=True,
58-
help_text=_("The role this map will grant the authenticating user to the targeted object"),
58+
help_text=_("The role this map will grant the authenticating user to the targeted object."),
5959
)
6060

6161
team = models.CharField(
6262
max_length=512,
6363
null=True,
6464
default=None,
6565
blank=True,
66-
help_text=_('A team name this rule works on'),
66+
help_text=_('A team name this rule works on.'),
6767
)
6868
organization = models.CharField(
6969
max_length=512,
7070
null=True,
7171
default=None,
7272
blank=True,
73-
help_text=(_('An organization name this rule works on')),
73+
help_text=(_('An organization name this rule works on.')),
7474
)
7575
triggers = models.JSONField(
7676
null=False,
7777
default=dict,
7878
blank=True,
79-
help_text=_("Trigger information for this rule"),
79+
help_text=_("Trigger information for this rule."),
8080
)
8181
order = models.PositiveIntegerField(
8282
null=False,
8383
default=0,
8484
help_text=(
8585
_(
8686
"The order in which this rule should be processed, smaller numbers are of higher precedence. "
87-
"Items with the same order will be executed in random order"
87+
"Items with the same order will be executed in random order."
8888
)
8989
),
9090
)

0 commit comments

Comments
 (0)