0001-manager-search-events-by-authentication-method-57932.patch
src/authentic2/manager/journal_views.py | ||
---|---|---|
94 | 94 |
), |
95 | 95 |
) |
96 | 96 | |
97 |
def search_by_how(self, lexem): |
|
98 |
yield Q(data__how=lexem) |
|
99 | ||
100 |
@classmethod |
|
101 |
def search_by_how_documentation(cls): |
|
102 |
return _( |
|
103 |
'You can use <tt>how:fc</tt> to find all events related to FranceConnect. Other possible values are "saml", "oidc" and "password".' |
|
104 |
) |
|
105 | ||
97 | 106 | |
98 | 107 |
EVENT_TYPE_CHOICES = ( |
99 | 108 |
('', _('All')), |
tests/test_manager_journal.py | ||
---|---|---|
71 | 71 |
user=user, |
72 | 72 |
session=session1, |
73 | 73 |
service=service, |
74 |
how="franceconnect",
|
|
74 |
how="fc",
|
|
75 | 75 |
) |
76 | 76 |
make("user.logout", user=user, session=session1) |
77 | 77 | |
... | ... | |
320 | 320 |
'user': '-', |
321 | 321 |
}, |
322 | 322 |
{ |
323 |
'message': 'registration using franceconnect',
|
|
323 |
'message': 'registration using FranceConnect',
|
|
324 | 324 |
'timestamp': 'Jan. 1, 2020, 1 a.m.', |
325 | 325 |
'type': 'user.registration', |
326 | 326 |
'user': 'Johnny doe', |
... | ... | |
608 | 608 | |
609 | 609 |
assert content == [ |
610 | 610 |
{ |
611 |
'message': 'registration using franceconnect',
|
|
611 |
'message': 'registration using FranceConnect',
|
|
612 | 612 |
'timestamp': 'Jan. 1, 2020, 1 a.m.', |
613 | 613 |
'type': 'user.registration', |
614 | 614 |
'user': 'Johnny doe', |
... | ... | |
1065 | 1065 |
text_content(response.pyquery('tbody tr td.journal-list--message-column')[0]).strip() |
1066 | 1066 |
== 'creation of user "Johnny doe"' |
1067 | 1067 |
) |
1068 |
assert text_content(response.pyquery('tbody tr td.journal-list--session-column')[0]).strip() == 'API' |
|
1068 | ||
1069 |
response.form.set('search', 'how:fc') |
|
1070 |
response = response.form.submit() |
|
1071 |
table_content = [text_content(p) for p in response.pyquery('tbody td.journal-list--message-column')] |
|
1072 |
assert table_content == ['registration using FranceConnect'] |
|
1073 | ||
1074 |
response.form.set('search', 'how:saml') |
|
1075 |
response = response.form.submit() |
|
1076 |
table_content = [text_content(p) for p in response.pyquery('tbody td.journal-list--message-column')] |
|
1077 |
assert table_content == ['login using SAML'] |
|
1069 | 1078 | |
1070 | 1079 |
response.form.set('search', '') |
1071 | 1080 |
response.form['event_type'].select(text='Profile changes') |
1072 |
- |