Coverage for cas_server/migrations/0001_squashed_0013_auto_20170329_1748.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-18 09:41 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-18 09:41 +0000
1# -*- coding: utf-8 -*-
2# Generated by Django 1.10.8 on 2018-04-29 17:40
3from __future__ import unicode_literals
5import cas_server.utils
6from django.db import migrations, models
7import django.db.models.deletion
8import django.utils.timezone
11class Migration(migrations.Migration):
13 replaces = [('cas_server', '0001_squashed_0021_auto_20150611_2102'), ('cas_server', '0002_auto_20151212_1300'), ('cas_server', '0003_auto_20151212_1721'), ('cas_server', '0004_auto_20151218_1032'), ('cas_server', '0005_auto_20160616_1018'), ('cas_server', '0006_auto_20160706_1727'), ('cas_server', '0007_auto_20160723_2252'), ('cas_server', '0008_newversionwarning'), ('cas_server', '0009_auto_20160814_0619'), ('cas_server', '0010_auto_20160824_2112'), ('cas_server', '0011_auto_20161007_1258'), ('cas_server', '0012_auto_20170328_1610'), ('cas_server', '0013_auto_20170329_1748')]
15 initial = True
17 dependencies = [
18 ('sessions', '0001_initial'),
19 ]
21 operations = [
22 migrations.CreateModel(
23 name='Proxy',
24 fields=[
25 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
26 ('url', models.CharField(max_length=255)),
27 ],
28 options={
29 'ordering': ('-pk',),
30 },
31 ),
32 migrations.CreateModel(
33 name='ProxyGrantingTicket',
34 fields=[
35 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
36 ('attributs', models.TextField(blank=True, default=None, null=True)),
37 ('validate', models.BooleanField(default=False)),
38 ('service', models.TextField()),
39 ('creation', models.DateTimeField(auto_now_add=True)),
40 ('renew', models.BooleanField(default=False)),
41 ('value', models.CharField(default=cas_server.utils.gen_pgt, max_length=255, unique=True)),
42 ],
43 options={
44 'abstract': False,
45 },
46 ),
47 migrations.CreateModel(
48 name='ProxyTicket',
49 fields=[
50 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
51 ('attributs', models.TextField(blank=True, default=None, null=True)),
52 ('validate', models.BooleanField(default=False)),
53 ('service', models.TextField()),
54 ('creation', models.DateTimeField(auto_now_add=True)),
55 ('renew', models.BooleanField(default=False)),
56 ('value', models.CharField(default=cas_server.utils.gen_pt, max_length=255, unique=True)),
57 ],
58 options={
59 'abstract': False,
60 },
61 ),
62 migrations.CreateModel(
63 name='ServicePattern',
64 fields=[
65 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
66 ('pos', models.IntegerField(default=100)),
67 ('pattern', models.CharField(max_length=255, unique=True)),
68 ('user_field', models.CharField(blank=True, default=b'', help_text=b"Nom de l'attribut transmit comme username, vide = login", max_length=255)),
69 ('usernames', models.CharField(blank=True, default=b'', help_text=b"Liste d'utilisateurs accept\xc3\xa9s s\xc3\xa9par\xc3\xa9 par des virgules, vide = tous les utilisateur", max_length=255)),
70 ('attributs', models.CharField(blank=True, default=b'', help_text=b"Liste des nom d'attributs \xc3\xa0 transmettre au service, s\xc3\xa9par\xc3\xa9 par une virgule. vide = aucun", max_length=255)),
71 ('proxy', models.BooleanField(default=False, help_text=b"Un ProxyGrantingTicket peut \xc3\xaatre d\xc3\xa9livr\xc3\xa9 au service pour s'authentifier en temps que l'utilisateur sur d'autres services")),
72 ('filter', models.CharField(blank=True, default=b'', help_text=b'Une lambda fonction pour filtrer sur les utilisateur o\xc3\xb9 leurs attribut, arg1: username, arg2:attrs_dict. vide = pas de filtre', max_length=255)),
73 ],
74 options={
75 'ordering': ('pos',),
76 },
77 ),
78 migrations.CreateModel(
79 name='ServiceTicket',
80 fields=[
81 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
82 ('attributs', models.TextField(blank=True, default=None, null=True)),
83 ('validate', models.BooleanField(default=False)),
84 ('service', models.TextField()),
85 ('creation', models.DateTimeField(auto_now_add=True)),
86 ('renew', models.BooleanField(default=False)),
87 ('value', models.CharField(default=cas_server.utils.gen_st, max_length=255, unique=True)),
88 ],
89 options={
90 'abstract': False,
91 },
92 ),
93 migrations.CreateModel(
94 name='User',
95 fields=[
96 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
97 ('username', models.CharField(max_length=30)),
98 ('date', models.DateTimeField(auto_now=True)),
99 ('session_key', models.CharField(blank=True, max_length=40, null=True)),
100 ],
101 ),
102 migrations.AddField(
103 model_name='serviceticket',
104 name='user',
105 field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='serviceticket', to='cas_server.User'),
106 ),
107 migrations.AddField(
108 model_name='proxyticket',
109 name='user',
110 field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='proxyticket', to='cas_server.User'),
111 ),
112 migrations.AddField(
113 model_name='proxygrantingticket',
114 name='user',
115 field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='proxygrantingticket', to='cas_server.User'),
116 ),
117 migrations.AddField(
118 model_name='proxy',
119 name='proxy_ticket',
120 field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='proxies', to='cas_server.ProxyTicket'),
121 ),
122 migrations.AddField(
123 model_name='proxygrantingticket',
124 name='service_pattern',
125 field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='proxygrantingticket', to='cas_server.ServicePattern'),
126 preserve_default=False,
127 ),
128 migrations.AddField(
129 model_name='proxyticket',
130 name='service_pattern',
131 field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='proxyticket', to='cas_server.ServicePattern'),
132 preserve_default=False,
133 ),
134 migrations.AddField(
135 model_name='serviceticket',
136 name='service_pattern',
137 field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='serviceticket', to='cas_server.ServicePattern'),
138 preserve_default=False,
139 ),
140 migrations.CreateModel(
141 name='ReplaceAttributName',
142 fields=[
143 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
144 ('name', models.CharField(help_text="nom d'un attributs \xe0 transmettre au service", max_length=255)),
145 ('replace', models.CharField(blank=True, help_text="nom sous lequel l'attribut sera pr\xe9sent\xe9 au service. vide = inchang\xe9", max_length=255)),
146 ('service_pattern', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attributs', to='cas_server.ServicePattern')),
147 ],
148 ),
149 migrations.RemoveField(
150 model_name='servicepattern',
151 name='attributs',
152 ),
153 migrations.CreateModel(
154 name='FilterAttributValue',
155 fields=[
156 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
157 ('attribut', models.CharField(help_text='Name of the attribute which must verify pattern', max_length=255, verbose_name='attribute')),
158 ('pattern', models.CharField(help_text='a regular expression', max_length=255, validators=[cas_server.utils.regexpr_validator], verbose_name='pattern')),
159 ('service_pattern', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filters', to='cas_server.ServicePattern')),
160 ],
161 ),
162 migrations.CreateModel(
163 name='ReplaceAttributValue',
164 fields=[
165 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
166 ('attribut', models.CharField(help_text='Name of the attribute for which the value must be replace', max_length=255, verbose_name='attribute')),
167 ('pattern', models.CharField(help_text='An regular expression maching whats need to be replaced', max_length=255, validators=[cas_server.utils.regexpr_validator], verbose_name='pattern')),
168 ('replace', models.CharField(blank=True, help_text='replace expression, groups are capture by \\1, \\2 \u2026', max_length=255, verbose_name='replace')),
169 ('service_pattern', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replacements', to='cas_server.ServicePattern')),
170 ],
171 ),
172 migrations.RemoveField(
173 model_name='servicepattern',
174 name='filter',
175 ),
176 migrations.CreateModel(
177 name='Username',
178 fields=[
179 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
180 ('value', models.CharField(help_text='username allowed to connect to the service', max_length=255, verbose_name='username')),
181 ('service_pattern', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usernames', to='cas_server.ServicePattern')),
182 ],
183 ),
184 migrations.RemoveField(
185 model_name='servicepattern',
186 name='usernames',
187 ),
188 migrations.AddField(
189 model_name='servicepattern',
190 name='restrict_users',
191 field=models.BooleanField(default=False, help_text='Limit username allowed to connect to the list provided bellow', verbose_name='restrict username'),
192 ),
193 migrations.AddField(
194 model_name='servicepattern',
195 name='name',
196 field=models.CharField(blank=True, help_text='A name for the service', max_length=255, null=True, unique=True, verbose_name='name'),
197 ),
198 migrations.AlterUniqueTogether(
199 name='replaceattributname',
200 unique_together=set([('name', 'replace', 'service_pattern')]),
201 ),
202 migrations.AddField(
203 model_name='servicepattern',
204 name='single_log_out',
205 field=models.BooleanField(default=False, help_text='Enable SLO for the service', verbose_name='single log out'),
206 ),
207 migrations.AlterField(
208 model_name='replaceattributname',
209 name='name',
210 field=models.CharField(help_text='name of an attribut to send to the service', max_length=255, verbose_name='name'),
211 ),
212 migrations.AlterField(
213 model_name='replaceattributname',
214 name='replace',
215 field=models.CharField(blank=True, help_text='name under which the attribut will be showto the service. empty = default name of the attribut', max_length=255, verbose_name='replace'),
216 ),
217 migrations.AlterField(
218 model_name='servicepattern',
219 name='pattern',
220 field=models.CharField(max_length=255, unique=True, verbose_name='pattern'),
221 ),
222 migrations.AlterField(
223 model_name='servicepattern',
224 name='pos',
225 field=models.IntegerField(default=100, verbose_name='position'),
226 ),
227 migrations.AlterField(
228 model_name='servicepattern',
229 name='proxy',
230 field=models.BooleanField(default=False, help_text='A ProxyGrantingTicket can be delivered to the service in order to authenticate for the user on a backend service', verbose_name='proxy'),
231 ),
232 migrations.AlterField(
233 model_name='servicepattern',
234 name='user_field',
235 field=models.CharField(blank=True, default=b'', help_text='Name of the attribut to transmit as username, empty = login', max_length=255, verbose_name='user field'),
236 ),
237 migrations.AddField(
238 model_name='proxygrantingticket',
239 name='single_log_out',
240 field=models.BooleanField(default=False),
241 ),
242 migrations.AddField(
243 model_name='proxyticket',
244 name='single_log_out',
245 field=models.BooleanField(default=False),
246 ),
247 migrations.AddField(
248 model_name='serviceticket',
249 name='single_log_out',
250 field=models.BooleanField(default=False),
251 ),
252 migrations.AddField(
253 model_name='servicepattern',
254 name='proxy_callback',
255 field=models.BooleanField(default=False, help_text='can be used as a proxy callback to deliver PGT', verbose_name='proxy callback'),
256 ),
257 migrations.AlterField(
258 model_name='servicepattern',
259 name='proxy',
260 field=models.BooleanField(default=False, help_text='Proxy tickets can be delivered to the service', verbose_name='proxy'),
261 ),
262 migrations.AddField(
263 model_name='servicepattern',
264 name='single_log_out_callback',
265 field=models.CharField(blank=True, default=b'', help_text='URL where the SLO request will be POST. empty = service url\nThis is usefull for non HTTP proxied services.', max_length=255, verbose_name='single log out callback'),
266 ),
267 migrations.AlterField(
268 model_name='replaceattributname',
269 name='name',
270 field=models.CharField(help_text='name of an attribut to send to the service, use * for all attributes', max_length=255, verbose_name='name'),
271 ),
272 migrations.AlterUniqueTogether(
273 name='user',
274 unique_together=set([('username', 'session_key')]),
275 ),
276 migrations.AlterField(
277 model_name='servicepattern',
278 name='pattern',
279 field=models.CharField(help_text="A regular expression matching services. Will usually looks like '^https://some\\.server\\.com/path/.*$'.As it is a regular expression, special character must be escaped with a '\\'.", max_length=255, unique=True, verbose_name='pattern'),
280 ),
281 migrations.AlterModelOptions(
282 name='servicepattern',
283 options={'ordering': ('pos',), 'verbose_name': 'Service pattern', 'verbose_name_plural': 'Services patterns'},
284 ),
285 migrations.AlterModelOptions(
286 name='user',
287 options={'verbose_name': 'User', 'verbose_name_plural': 'Users'},
288 ),
289 migrations.AlterField(
290 model_name='servicepattern',
291 name='pos',
292 field=models.IntegerField(default=100, help_text='service patterns are sorted using the position attribute', verbose_name='position'),
293 ),
294 migrations.CreateModel(
295 name='FederatedIendityProvider',
296 fields=[
297 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
298 ('suffix', models.CharField(help_text='Suffix append to backend CAS returner username: `returned_username`@`suffix`', max_length=30, unique=True, verbose_name='suffix')),
299 ('server_url', models.CharField(max_length=255, verbose_name='server url')),
300 ('cas_protocol_version', models.CharField(choices=[(b'1', b'CAS 1.0'), (b'2', b'CAS 2.0'), (b'3', b'CAS 3.0'), (b'CAS_2_SAML_1_0', b'SAML 1.1')], default=b'3', help_text='Version of the CAS protocol to use when sending requests the the backend CAS', max_length=30, verbose_name='CAS protocol version')),
301 ('verbose_name', models.CharField(help_text='Name for this identity provider displayed on the login page', max_length=255, verbose_name='verbose name')),
302 ('pos', models.IntegerField(default=100, help_text='Identity provider are sorted using the (position, verbose name, suffix) attributes', verbose_name='position')),
303 ('display', models.BooleanField(default=True, help_text='Display the provider on the login page', verbose_name='display')),
304 ],
305 options={
306 'verbose_name': 'identity provider',
307 'verbose_name_plural': 'identity providers',
308 },
309 ),
310 migrations.CreateModel(
311 name='FederatedUser',
312 fields=[
313 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
314 ('username', models.CharField(max_length=124)),
315 ('provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cas_server.FederatedIendityProvider')),
316 ('ticket', models.CharField(max_length=255)),
317 ('last_update', models.DateTimeField(auto_now=True)),
318 ('_attributs', models.TextField(blank=True, default=None, null=True)),
319 ],
320 ),
321 migrations.AlterUniqueTogether(
322 name='federateduser',
323 unique_together=set([('username', 'provider')]),
324 ),
325 migrations.CreateModel(
326 name='FederateSLO',
327 fields=[
328 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
329 ('username', models.CharField(max_length=30)),
330 ('session_key', models.CharField(blank=True, max_length=40, null=True)),
331 ('ticket', models.CharField(db_index=True, max_length=255)),
332 ],
333 ),
334 migrations.AlterUniqueTogether(
335 name='federateslo',
336 unique_together=set([('username', 'session_key', 'ticket')]),
337 ),
338 migrations.AlterField(
339 model_name='federatediendityprovider',
340 name='cas_protocol_version',
341 field=models.CharField(choices=[(b'1', b'CAS 1.0'), (b'2', b'CAS 2.0'), (b'3', b'CAS 3.0'), (b'CAS_2_SAML_1_0', b'SAML 1.1')], default=b'3', help_text='Version of the CAS protocol to use when sending requests the the backend CAS.', max_length=30, verbose_name='CAS protocol version'),
342 ),
343 migrations.AlterField(
344 model_name='federatediendityprovider',
345 name='display',
346 field=models.BooleanField(default=True, help_text='Display the provider on the login page.', verbose_name='display'),
347 ),
348 migrations.AlterField(
349 model_name='federatediendityprovider',
350 name='pos',
351 field=models.IntegerField(default=100, help_text='Position of the identity provider on the login page. Identity provider are sorted using the (position, verbose name, suffix) attributes.', verbose_name='position'),
352 ),
353 migrations.AlterField(
354 model_name='federatediendityprovider',
355 name='suffix',
356 field=models.CharField(help_text='Suffix append to backend CAS returner username: ``returned_username`` @ ``suffix``.', max_length=30, unique=True, verbose_name='suffix'),
357 ),
358 migrations.AlterField(
359 model_name='federatediendityprovider',
360 name='verbose_name',
361 field=models.CharField(help_text='Name for this identity provider displayed on the login page.', max_length=255, verbose_name='verbose name'),
362 ),
363 migrations.RemoveField(
364 model_name='proxygrantingticket',
365 name='attributs',
366 ),
367 migrations.RemoveField(
368 model_name='proxyticket',
369 name='attributs',
370 ),
371 migrations.RemoveField(
372 model_name='serviceticket',
373 name='attributs',
374 ),
375 migrations.AddField(
376 model_name='proxygrantingticket',
377 name='_attributs',
378 field=models.TextField(blank=True, default=None, null=True),
379 ),
380 migrations.AddField(
381 model_name='proxyticket',
382 name='_attributs',
383 field=models.TextField(blank=True, default=None, null=True),
384 ),
385 migrations.AddField(
386 model_name='serviceticket',
387 name='_attributs',
388 field=models.TextField(blank=True, default=None, null=True),
389 ),
390 migrations.AlterField(
391 model_name='federatediendityprovider',
392 name='suffix',
393 field=models.CharField(help_text='Suffix append to backend CAS returned username: ``returned_username`` @ ``suffix``.', max_length=30, unique=True, verbose_name='suffix'),
394 ),
395 migrations.CreateModel(
396 name='NewVersionWarning',
397 fields=[
398 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
399 ('version', models.CharField(max_length=255)),
400 ],
401 ),
402 migrations.AlterField(
403 model_name='replaceattributname',
404 name='name',
405 field=models.CharField(help_text='name of an attribute to send to the service, use * for all attributes', max_length=255, verbose_name='name'),
406 ),
407 migrations.AlterField(
408 model_name='replaceattributname',
409 name='replace',
410 field=models.CharField(blank=True, help_text='name under which the attribute will be showto the service. empty = default name of the attribut', max_length=255, verbose_name='replace'),
411 ),
412 migrations.AlterField(
413 model_name='servicepattern',
414 name='user_field',
415 field=models.CharField(blank=True, default=b'', help_text='Name of the attribute to transmit as username, empty = login', max_length=255, verbose_name='user field'),
416 ),
417 migrations.AlterField(
418 model_name='replaceattributname',
419 name='replace',
420 field=models.CharField(blank=True, help_text='name under which the attribute will be show to the service. empty = default name of the attribut', max_length=255, verbose_name='replace'),
421 ),
422 migrations.AlterField(
423 model_name='servicepattern',
424 name='pattern',
425 field=models.CharField(help_text="A regular expression matching services. Will usually looks like '^https://some\\.server\\.com/path/.*$'.As it is a regular expression, special character must be escaped with a '\\'.", max_length=255, unique=True, validators=[cas_server.utils.regexpr_validator], verbose_name='pattern'),
426 ),
427 migrations.CreateModel(
428 name='UserAttributes',
429 fields=[
430 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
431 ('_attributs', models.TextField(blank=True, default=None, null=True)),
432 ('username', models.CharField(max_length=155, unique=True)),
433 ],
434 options={
435 'verbose_name': 'User attributes cache',
436 'verbose_name_plural': 'User attributes caches',
437 },
438 ),
439 migrations.AlterModelOptions(
440 name='federateduser',
441 options={'verbose_name': 'Federated user', 'verbose_name_plural': 'Federated users'},
442 ),
443 migrations.AddField(
444 model_name='user',
445 name='last_login',
446 field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
447 preserve_default=False,
448 ),
449 migrations.AlterField(
450 model_name='federatediendityprovider',
451 name='cas_protocol_version',
452 field=models.CharField(choices=[('1', 'CAS 1.0'), ('2', 'CAS 2.0'), ('3', 'CAS 3.0'), ('CAS_2_SAML_1_0', 'SAML 1.1')], default='3', help_text='Version of the CAS protocol to use when sending requests the the backend CAS.', max_length=30, verbose_name='CAS protocol version'),
453 ),
454 migrations.AlterField(
455 model_name='servicepattern',
456 name='single_log_out_callback',
457 field=models.CharField(blank=True, default='', help_text='URL where the SLO request will be POST. empty = service url\nThis is usefull for non HTTP proxied services.', max_length=255, verbose_name='single log out callback'),
458 ),
459 migrations.AlterField(
460 model_name='servicepattern',
461 name='user_field',
462 field=models.CharField(blank=True, default='', help_text='Name of the attribute to transmit as username, empty = login', max_length=255, verbose_name='user field'),
463 ),
464 migrations.AlterField(
465 model_name='user',
466 name='username',
467 field=models.CharField(max_length=250),
468 ),
469 ]