From 221b6389cd303579d7509753d4b4cf85b253be7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 12 May 2022 15:12:42 +0200 Subject: [PATCH] Allow users to rename their 2FA token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: #819 Signed-off-by: Aurélien Bompard --- news/819.feature | 1 + noggin/controller/user.py | 31 + noggin/form/edit_user.py | 9 + noggin/templates/user-settings-otp.html | 24 +- .../test_user_settings_otp_rename.yaml | 1517 +++++++++++++++++ noggin/tests/unit/controller/test_user_otp.py | 28 + 6 files changed, 1608 insertions(+), 2 deletions(-) create mode 100644 news/819.feature create mode 100644 noggin/tests/unit/controller/cassettes/test_user_otp/test_user_settings_otp_rename.yaml diff --git a/news/819.feature b/news/819.feature new file mode 100644 index 000000000..1e72e5d64 --- /dev/null +++ b/news/819.feature @@ -0,0 +1 @@ +Allow users to rename their 2FA token diff --git a/noggin/controller/user.py b/noggin/controller/user.py index a4e1e8d7c..53ac50380 100644 --- a/noggin/controller/user.py +++ b/noggin/controller/user.py @@ -27,6 +27,7 @@ UserSettingsConfirmOTPForm, UserSettingsEmailForm, UserSettingsKeysForm, + UserSettingsOTPNameChange, UserSettingsOTPStatusChange, UserSettingsProfileForm, ) @@ -402,6 +403,36 @@ def user_settings_otp(ipa, username): ) +@bp.route('/user//settings/otp/rename/', methods=['POST']) +@with_ipa() +@require_self +def user_settings_otp_rename(ipa, username): + form = UserSettingsOTPNameChange() + + if form.validate_on_submit(): + try: + ipa.otptoken_mod( + a_ipatokenuniqueid=form.token.data, + o_description=form.description.data, + ) + except python_freeipa.exceptions.BadRequest as e: + if e.message != "no modifications to be performed": + flash(_('Cannot rename the token.'), 'danger') + current_app.logger.error( + f'Something went wrong renaming an OTP token for user {username}: {e}' + ) + except python_freeipa.exceptions.FreeIPAError as e: + flash(_('Cannot rename the token.'), 'danger') + current_app.logger.error( + f'Something went wrong renaming an OTP token for user {username}: {e}' + ) + + for field_errors in form.errors.values(): + for error in field_errors: + flash(error, 'danger') + return redirect(url_for('.user_settings_otp', username=username)) + + @bp.route('/user//settings/otp/disable/', methods=['POST']) @with_ipa() @require_self diff --git a/noggin/form/edit_user.py b/noggin/form/edit_user.py index 6e46c485f..03a25e259 100644 --- a/noggin/form/edit_user.py +++ b/noggin/form/edit_user.py @@ -210,6 +210,15 @@ class UserSettingsOTPStatusChange(BaseForm): ) +class UserSettingsOTPNameChange(BaseForm): + token = HiddenField( + 'token', validators=[DataRequired(message=_('Token must not be empty'))] + ) + description = StringField( + validators=[Optional()], + ) + + class UserSettingsAgreementSign(BaseForm): agreement = HiddenField( 'agreement', validators=[DataRequired(message=_('Agreement must not be empty'))] diff --git a/noggin/templates/user-settings-otp.html b/noggin/templates/user-settings-otp.html index ac146cad7..7daddc103 100644 --- a/noggin/templates/user-settings-otp.html +++ b/noggin/templates/user-settings-otp.html @@ -85,7 +85,17 @@
{{ _("OTP Tokens") }}
-
{{token.description if token.description}}
+
+ {{token.description if token.description}} + +
+
+
+ + + +
+
{{token.uniqueid}}
@@ -129,7 +139,7 @@
{{ _("OTP Tokens") }}
$('#otp-qrcode').hide().qrcode("{{ otp_uri|safe }}"); $('#otp-toggle').click(function() { $('#otp-qrcode').slideToggle("fast"); - }) + }); }); {% endif %} @@ -141,4 +151,14 @@
{{ _("OTP Tokens") }}
{% endif %} + + {% endblock %} diff --git a/noggin/tests/unit/controller/cassettes/test_user_otp/test_user_settings_otp_rename.yaml b/noggin/tests/unit/controller/cassettes/test_user_otp/test_user_settings_otp_rename.yaml new file mode 100644 index 000000000..c2a2f2f36 --- /dev/null +++ b/noggin/tests/unit/controller/cassettes/test_user_otp/test_user_settings_otp_rename.yaml @@ -0,0 +1,1517 @@ +interactions: +- request: + body: user=admin&password=password + headers: + Accept: + - text/plain + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '28' + Content-Type: + - application/x-www-form-urlencoded + Referer: + - https://ipa.noggin.test/ipa/session/login_password + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/login_password + response: + body: + string: !!binary | + H4sIAAAAAAAAAwAAAP//AwAAAAAAAAAAAA== + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - text/plain; charset=UTF-8 + Date: + - Thu, 12 May 2022 13:10:25 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=MagBearerToken=%2bS6oC4DWDNultk2dI4IYw9mDjrXijeOpzgEQNo%2b1dfxFjPhF0vYbnpp1cEoysA8oEl7%2b23IHZN%2fzhckEgNqAlKkwrighziWGB451DhdhyB%2fAeFejMuWz3OWOTKxrOqfZIM806oFvuBwvM6ykOlqf2JzN3y0nXj%2bh%2bdm9wuWElu0FjmkhvgGB2h2ZsQf2jp6W;path=/ipa;httponly;secure; + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "ping", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=%2bS6oC4DWDNultk2dI4IYw9mDjrXijeOpzgEQNo%2b1dfxFjPhF0vYbnpp1cEoysA8oEl7%2b23IHZN%2fzhckEgNqAlKkwrighziWGB451DhdhyB%2fAeFejMuWz3OWOTKxrOqfZIM806oFvuBwvM6ykOlqf2JzN3y0nXj%2bh%2bdm9wuWElu0FjmkhvgGB2h2ZsQf2jp6W + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqFYqLs3NTSyqBLKVPAMcFYpTi8pSixSAuDgzP0/BRM9Sz0JP + wTHAEy5kpGdkYqpUq6OglFpUlF8E1JhXmpMD5GamINgFRZl5yZkFiTkgcxNTcjPzHPz83d09/fRC + XINDlIAqoMaB5MGWKNUCAAAA//8DAMf44NuXAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:26 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_add", "params": [["dummy"], {"givenname": "Dummy", "sn": + "User", "cn": "Dummy User", "loginshell": "/bin/bash", "mail": "dummy@unit.tests", + "userpassword": "dummy_password", "random": false, "noprivate": false, "all": + true, "raw": false, "no_members": false, "fascreationtime": "2022-05-12T13:10:25Z", + "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '340' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=%2bS6oC4DWDNultk2dI4IYw9mDjrXijeOpzgEQNo%2b1dfxFjPhF0vYbnpp1cEoysA8oEl7%2b23IHZN%2fzhckEgNqAlKkwrighziWGB451DhdhyB%2fAeFejMuWz3OWOTKxrOqfZIM806oFvuBwvM6ykOlqf2JzN3y0nXj%2bh%2bdm9wuWElu0FjmkhvgGB2h2ZsQf2jp6W + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA5RU227aQBD9FeTnQDCYKFSKVNJG9CKFSpA8pKnQeHewt6x33b0QaJR/787aQCJF + jSI/eHzmsmfPzPgxMWi9dMmHzuNzk6nw+pl89lW169xYNMmvk07Cha0l7BRU+JpbKOEESNv4biJW + INP2tWCd/0bmmATbuJ2ukwDXaKxWZGlTgBJ/wQmtQB5xodAF30vAU1lK11ZsgTHtlaPvtclrIxQT + NUjw2xZygq3R1VoKtmvRENAwaj+sLfc1V2D3ZnDMbTk12tez1Q+ff8edJbzCemZEIdSVcmbXRqrI + CpwztpGnBq/EH4+CxxvjkJ8hsPMuT1dZN02RdccD5N3RYJT1+wDj8TCPiXSJQOhBG47bWpgoCZV4 + TJZLDg6dqHC5DEgy6A8G/VE6SIdpfzC6S57a/CCzqx84K0EV+L5U3DoDIRT2aTlYPMuapMnk2+Xl + MBWsGm/4p3F5N03rfH05W/T5l/lN5m+vbhe3k8lFUy3IVIGCAjlGnUgFpi44TcZJMAoS1pLVttCe + cHahdBGUJcuhdc1UCa58lYemUIk0O+tn4UnPo9P/z1nqCrkwodG6JXBK0GnksFebgdJKMJCHSY/u + j9ez6fTrdW9xNV/E0DAZzGBsB+n4Dl19OwPHYwuxQfVysyIudbi8LVHKhm0u1GnoQBmdFQj5jF8Y + L9cjkexhbvbD/8ZNbLPvh+2sw78AzQaJ5SqsNJJ0YJf7OQywM36PrnHnID9iFZL8erWMDY2VafhD + xYYYp9NIg2Pro/ONzj+F1A1ITxdplSPqwYDYy2TCOfIOlercNwH3ScxCYzSNg/JS0ibyo31QiAoA + r4R6IQ4dGZg1C5dkvXHvPHn6BwAA//8DADN1eXs2BQAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:26 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "session_logout", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=%2bS6oC4DWDNultk2dI4IYw9mDjrXijeOpzgEQNo%2b1dfxFjPhF0vYbnpp1cEoysA8oEl7%2b23IHZN%2fzhckEgNqAlKkwrighziWGB451DhdhyB%2fAeFejMuWz3OWOTKxrOqfZIM806oFvuBwvM6ykOlqf2JzN3y0nXj%2bh%2bdm9wuWElu0FjmkhvgGB2h2ZsQf2jp6W + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqEYw80pzcmp1FJRSi4ryi6B8IDczBcEuKMrMS84sSMwBCikl + puRm5jn4+bu7e/rphbgGhygBVZSlFhVn5ueB5E30LPUslGoBAAAA//8DAFS1MxltAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=97 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=;Max-Age=0;path=/ipa;httponly;secure; + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: user=dummy&new_password=dummy_password&old_password=dummy_password + headers: + Accept: + - text/plain + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/change_password + response: + body: + string: !!binary | + H4sIAAAAAAAAA0TOUQqAIAwG4PdO4Qma9Tw8Q9AJTC0D02hGdPtmCT2MwfbtZ+jzFlSD3mnLLa85 + ONVLKcbTGEeE8I0ahEqmZO9y0KlBE13psMJ4HRcn6DuZz8C4Y7NzUT5SXH57aaretgh1y+nFQs2G + 96kHAAD//wMAiLUc4ZsAAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - text/html; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + X-IPA-Pwchange-Result: + - ok + status: + code: 200 + message: Success +- request: + body: user=dummy&password=dummy_password + headers: + Accept: + - text/plain + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '34' + Content-Type: + - application/x-www-form-urlencoded + Referer: + - https://ipa.noggin.test/ipa/session/login_password + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/login_password + response: + body: + string: !!binary | + H4sIAAAAAAAAAwMAAAAAAAAAAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Length: + - '20' + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - text/plain; charset=UTF-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk;path=/ipa;httponly;secure; + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "otptoken_add", "params": [[null], {"type": "totp", "description": + "dummy''s token", "ipatokenowner": "dummy", "ipatokenotpalgorithm": "sha1", + "ipatokenotpdigits": 6, "ipatokentotpclockoffset": 0, "ipatokentotptimestep": + 30, "ipatokenhotpcounter": 0, "qrcode": false, "no_qrcode": false, "all": true, + "raw": false, "no_members": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '367' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4xS227TQBD9FWsl0pdcGnvrtJEsMGlIWhH34jSFUoTWu4OzYK/NXoqiqv/Orl1o + Ql76NqMzZ+bMnHlEEpQpNBp7j9shr4mufoKodE2KvJJcr0sLfEFqTYboa9fbrmA851o1cLiDaQtq + XoLSUDdwcLjL/S1ANgAzZbnZwYzgvwxw1sBZCBkbjoIeoyO/h3086mXfCfSOKDlmYYCDgLWTq+wH + UE0Lolo9f7uh/1S5XFd1w2GgqORWaCVetBworyW6CiO5RZA7htHr8WDgWgyaunfJxWx2lvSX03Q5 + fo3Mt1wpAzJq2G/w4Ra/o4BK0JH/+SiZLVZ+kp5Pg8Vi8ekG38Z45U/Pkrt0dY4nkzj9EJ9eTS/f + n85H8fXqej75GOKrTmtEFHb+eRal83jYqUHyikX2+m7tTQ1um+XF8tLlJREkB5Ztvhm15wZzJ9nz + JHrNol0qInumLqORqPKcCxdp+wvoyTZ+IIVxMoQpCpsqO5HIjRsWMwbMs+JaA7x7dI8aCkhZyRdK + 8xrPcS25oFZl4Rrs+eK2fACpWoMR7p/0j9HTHwAAAP//AwAubyVE+wIAAA== + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "ping", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqFYqLs3NTSyqBLKVPAMcFYpTi8pSixSAuDgzP0/BRM9Sz0JP + wTHAEy5kpGdkYqpUq6OglFpUlF8E1JhXmpMD5GamINgFRZl5yZkFiTkgc1OAVlQ6+Pm7u3v66YW4 + BocoAVVAjQPJgy1RqgUAAAD//wMAY6TlOJcAAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_find", "params": [[null], {"whoami": true, "all": true, + "raw": false, "no_members": true, "pkey_only": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '148' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4xTyW7bMBD9FUPnyBG1eAkQoIcGRlEgKZDk0qAwKHIssaZIlUsS18i/d0gptoMG + aaGDhm8Wzsx73CcGrJcuuZjsj+bDPmEq/JPPvut2k3sLJvlxNkm4sL2kO0U7eM8tlHCCSjv47iPW + ANP2veANtcwAdUIrJ4Z6+2S95tRBOK/XiCR5ludZRXJSkCyvvicvIVPXP4E5JqkdCjvdJwj3YKxW + wdKmoUr8jrWpPOJCgUPfW8CHhkK6tuKZMqa9cuG8NXVvhGKip5L65xFygm3B9VoKthtRDBg6Gg/W + tq81ccZXEx23tl0Z7fubzTdff4WdDXgH/Y0RjVBXypndGKliV9Q5Y4fF9tQr8cuD4HFiKPgMKFuk + nGzKlBBg6TIHnlZ5VWYZpctlUcfEMAQ29KQNh+demLiSD1a9IFlc9XxcNebjml3/xFlLVfM/LL2m + xjEsMG+E2wkOyPJG4C5C/7cpSas0J2leVot5ucS0tFjM83lGSJYWs2VZzGbFLE+rjCziIFLjimwL + UsYC57VQ5zW1bXR6wZXv6rE4KWdZid+Y2XzkPCX5oGoehPrp+ma1+nI9vbu6vYuhdngRB/024hHU + 25cQ8Y4KeVIGeXNTB9YNTLa6Ay4MqkUj23GUAJ3zQ74fOT4i2CSjSivB/tmksqOCpWZbjNvga4Qg + bnzbYB6Bn2AdhK3ozboJooxFg84wbmiVh4FDO5fxrjOmLqMzGOMt9oyzS6Ub5CZYYcyB/OEVXUwI + 2s54xVAvp3dbrEjjAhIyCVUnHXWsxZgX9IIxOtClvJRBSfxoH9gKqX/vACMescVB5Ek5XU4Xycsf + AAAA//8DAOd/fBLlBAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_show", "params": [["dummy"], {"rights": false, "all": + true, "raw": false, "no_members": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '133' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4xUyW7bMBD9lUDnyNbqpUCAHhoERYG4QJJLg8KgyLE8NUWqXJKoQf69JEVvQJAW + Pnj4ZuG8pye9Jgq05Sb5dPF6GlLh/h6TL7brhosHDSr5eXmRMNQ9J4MgHbyXRoEGCddj7iFgLVCp + 3yuWzS+ghnKix7SRfeLgHpSWwkdStUTgH2JQCsKPOAowLncOWD/Wt0uNL4RSaYXx551qeoWCYk84 + sS8RMkh3YHrJkQ4RdQXjRvGg9XY/c0P0PnSJO729UdL2q81323yDQXu8g36lsEVxLYwaYqUIWxFj + lB7l6YkV+NsCssAYSjYDQhcpyzdVmudA02UBLK2LusoyQpbLsgmNnoRb6FkqBi89qiCJH/GarNeM + GDDYwXrtkKTIiiJb5Fle5lkx/5G8xX4ns+mfGd0S0cIHrXVenLUGGhqoVWgGZCAMbtBp4fe/S/O0 + Tos8Lap6Ma+Wri0tF/NinuV5lpazZVXOZuWsSOssXwQiNjJn3gqjPZAJ2zVxYl7Nssr9YnmLTyDO + zRZwLp3Seguch8S0QTFtiN6GpB6de/CZI0+JkAIp4YdZYYHPt6ubm6+3k/vru/tQ6h40VRDU9bL8 + h0x1lMl+RKMjyE9udR4wEwPajK7Yyg4YKuc86ZwT+HhoetTo1MP/YCB09D6XdOfqNu5tBH8J0eu9 + hRxslN2jOxgMaY5Y7z4CoJ6AnXR34KnJzbr1xg/Xey+7upEC85J7Da7CVpdUXIWkD+I++pLRKyFb + 9+B85Oknb671iXDrCUVL+OfnAhKUEJZzXwNKSRXP3pLsGB90OYw4k8Rf4PYY35akmiwni+TtLwAA + AP//AwCvnGSQ8wQAAA== + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "otptoken_find", "params": [[null], {"ipatokenowner": "dummy", + "all": true, "raw": false, "no_members": true, "pkey_only": false, "version": + "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '162' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4yRMU/DMBCF/0rkhaWpSBPaghSJBVUsLRLZEEKOfU0Njh3sMyiq+t/xJUJt6cJ2 + 9rt3/t55zxz4oJHdJftj+bJnquNoP8BY7LhurFO4a0lhfscz9jpJTjukahT6QZ6faRhFVC14hG6Q + 8+tz77cBNwgytG1/pgWjPgMoOcj1HGqZLfJUisUsLWbFIq23HNIbwZdynhd5LseXbf0OAoXmfuT5 + ncb+UNEZbTd4JHjhVAS15shy5ZPRSB3YdxAlVm2qJ3K23PAGZN2/BX8RQNKUixjlfyJMhCkj3ESK + 0timUYYqjOtjB5osbDD0PxkhuWAER6D9bLn2EO98ZOCup+ezJKKOCZKWo9jFxkNsAecsAZugNa1E + HuvOKSMitib/EOd+vVmtHtfT6uG5othf4Py4JFZMb6dLdvgBAAD//wMAbq2QJUACAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:27 GMT + Keep-Alive: + - timeout=30, max=97 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "ping", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqFYqLs3NTSyqBLKVPAMcFYpTi8pSixSAuDgzP0/BRM9Sz0JP + wTHAEy5kpGdkYqpUq6OglFpUlF8E1JhXmpMD5GamINgFRZl5yZkFiTkgc1OAVlQ6+Pm7u3v66YW4 + BocoAVVAjQPJgy1RqgUAAAD//wMAY6TlOJcAAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_find", "params": [[null], {"whoami": true, "all": true, + "raw": false, "no_members": true, "pkey_only": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '148' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4xTyW7bMBD9FUPnyBG1eAkQoIcGRlEgKZDk0qAwKHIssaZIlUsS18i/d0gptoMG + aaGDhm8Wzsx73CcGrJcuuZjsj+bDPmEq/JPPvut2k3sLJvlxNkm4sL2kO0U7eM8tlHCCSjv47iPW + ANP2veANtcwAdUIrJ4Z6+2S95tRBOK/XiCR5ludZRXJSkCyvvicvIVPXP4E5JqkdCjvdJwj3YKxW + wdKmoUr8jrWpPOJCgUPfW8CHhkK6tuKZMqa9cuG8NXVvhGKip5L65xFygm3B9VoKthtRDBg6Gg/W + tq81ccZXEx23tl0Z7fubzTdff4WdDXgH/Y0RjVBXypndGKliV9Q5Y4fF9tQr8cuD4HFiKPgMKFuk + nGzKlBBg6TIHnlZ5VWYZpctlUcfEMAQ29KQNh+demLiSD1a9IFlc9XxcNebjml3/xFlLVfM/LL2m + xjEsMG+E2wkOyPJG4C5C/7cpSas0J2leVot5ucS0tFjM83lGSJYWs2VZzGbFLE+rjCziIFLjimwL + UsYC57VQ5zW1bXR6wZXv6rE4KWdZid+Y2XzkPCX5oGoehPrp+ma1+nI9vbu6vYuhdngRB/024hHU + 25cQ8Y4KeVIGeXNTB9YNTLa6Ay4MqkUj23GUAJ3zQ74fOT4i2CSjSivB/tmksqOCpWZbjNvga4Qg + bnzbYB6Bn2AdhK3ozboJooxFg84wbmiVh4FDO5fxrjOmLqMzGOMt9oyzS6Ub5CZYYcyB/OEVXUwI + 2s54xVAvp3dbrEjjAhIyCVUnHXWsxZgX9IIxOtClvJRBSfxoH9gKqX/vACMescVB5Ek5XU4Xycsf + AAAA//8DAOd/fBLlBAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "otptoken_mod", "params": [["b6ebd173-dc72-4247-bfae-5ca8d63433d6"], + {"description": "the new name", "rights": false, "all": true, "raw": false, + "no_members": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '198' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4yRT08CMRDFv0rTM0uEXQFNSLwY4kEwcW9iTLczLNVuu/YPZEP47rYlRpDL3qb7 + 5s383uyBGrReOnpPDuelaJnTX6i0a5mstRFu2wThjdotG9H3ATnvAFELZ5M8udBcEJ1o0Dpsk5zf + JF1Xn8gdl8yeXL/99J83vp1ukwfQciPCOK2Sx22RKNwTxRq8WOqV+PYoIHVVE6xgNM0z4NNxVoyL + aVZtGGa3nM1gkhd5DpfIeq/QJCv4pumS5roWwydarsqXiNQwxWqEqvvw9qoZIt4VzLwPyICreUg9 + AD5Xuq6FipUL16PHMHjHpE8YvTIFgw1MzHTR8qxBbAQCCQlIAiPrXnPWNO1GY3QMqryU8VjwV7dG + KB7iyrgnneFhuVosnpbD8vG1jBw7NPb012gxvBvO6PEHAAD//wMAvk1SGXYCAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "ping", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqFYqLs3NTSyqBLKVPAMcFYpTi8pSixSAuDgzP0/BRM9Sz0JP + wTHAEy5kpGdkYqpUq6OglFpUlF8E1JhXmpMD5GamINgFRZl5yZkFiTkgc1OAVlQ6+Pm7u3v66YW4 + BocoAVVAjQPJgy1RqgUAAAD//wMAY6TlOJcAAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_find", "params": [[null], {"whoami": true, "all": true, + "raw": false, "no_members": true, "pkey_only": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '148' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4xTyW7bMBD9FUPnyBG1eAkQoIcGRlEgKZDk0qAwKHIssaZIlUsS18i/d0jJdoIG + aeGDR28Wvpl5s08MWC9dcjHZn8yHfcJU+E8++67bTe4tmOTH2SThwvaS7hTt4D23UMIJKu3gu49Y + A0zb94I31DID1AmtnBjq7ZP1mlMH4Xu9RiTJszzPKpKTgmR59T15CZm6/gnMMUntUNjpPkG4B2O1 + CpY2DVXid6xN5QkXChz63gI+EArp2opnypj2yoXvral7IxQTPZXUP4+QE2wLrtdSsN2IYsDAaPyw + tj3UxB4PJjpubbsy2vc3m2++/go7G/AO+hsjGqGulDO7MVJFVtQ5Y4fB9tQr8cuD4LFjKPgMKFuk + nGzKlBBg6TIHnlZ5VWYZpctlUcfE0AQSetKGw3MvTBzJB6NekCyOej6OGvNxzK5/4qylqvmfLR1S + YxsWmDfC7QQH3PJG4CwC/9uUpFWakzQvq8W8XGJaWizm+TwjJEuL2bIsZrNilqdVRhbHRg7bOMqP + B0V9ur5Zrb5cT++ubu8OoYwqrQT7Z2gjuPJdPbIi5Swr8Tc+2eoOuDC4WI2LCQHnATqPpWKE/yi9 + EY+g3l7KIenEKCJS4/ptC1IOr9RCndfUttHZUSFfdYAycFMH1g3CsMOZHo9K2VHBUrMtujZ4jRDE + jbcN5hH4K6yDQF1v1k0QZawTdIZxQ20eage6l/HpM6YuozMY4yv2jLNLpRvkH6zAa1j+cEUXE4K2 + M14x1Mvrty1WpHGqCZmEqpOOOtZizAt6wRgdZqq8lEFJ/GQfRRBS/14qRjwixUHkSTldThfJyx8A + AAD//wMAudkmZ+UEAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_show", "params": [["dummy"], {"rights": false, "all": + true, "raw": false, "no_members": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '133' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4xU22rcMBD9leDneOPrXgqBPjSEUkgKSV4ayjKWZnenK0uuLknckH+vJHtvENKy + Dzs6c9HMmSO/JhqNEzb5dPZ6bDLp/x6TL65t+7MHgzr5eX6WcDKdgF5Ci++5SZIlEGbwPURsjUyZ + 94JV8wuZZQLM4LaqSzzcoTZKBkvpNUj6A5aUBHHASaL1vlPAhbIhXRl6AcaUkzact7rpNElGHQhw + LyNkiW3RdkoQ60fUBwwdjQdjNruaKzA70zvuzOZaK9fdrr675hv2JuAtdrea1iSvpNX9GCljV2Ct + NgM9HThJvx0SjxNjyacIbJ7yfFWleY4sXRTI07qoqywDWCzKJiaGIXxDz0pzfOlIR0pCiddkueRg + 0VKLy6VHkiIrimyeZ3mZZ8XsR/I25nuabffM2QbkGj9IrfPiJDWOYZA5TbYnjtLSijwXof+7NE/r + tMjToqrns2rh09JyPitmWZ5naTldVOV0Wk6LtM7y+SAG4tK1zZifV9Os8r+98wnlqbQi7ka6+B4R + yjNtNihEdFw0JC8aMJvobIHEIf6zZ9xOLBprdlQykEoSA7G/a4i8ub2+/nozub+6u4+hG9UiJ+0l + ofxK40UBujj0cSyufxRzH01uhse2fxpecExj3HJYz3+sqx7XJc2ofaHY1ket/GvEMAuY5U5CHrba + 7dAt9haaA9b5jwDqJ+RH2S2GztVquQ7Cj70GLfu4gVQe+g8jXsbhz5m8jM5gjP2Yc84upVr7xQUr + LCR586lPIFwYcNxuIMMbEAmXTogQg1orPZ6DJPnB3tO/L3HCfLjA9zG8lqSaLCbz5O0vAAAA//8D + APW89nXzBAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "otptoken_find", "params": [[null], {"ipatokenowner": "dummy", + "all": true, "raw": false, "no_members": true, "pkey_only": false, "version": + "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '162' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4yRzU4DIRSFX4Ww7jROZ2yrSRM3pnHTmjg7YwwDtzMoPyNcbCZN312gMVq7cXfh + nAPfgQN14INCeksOP+PzgcqBoX0HY3FgqrNOYq+TQn3PSvoyIb8dQnYSfZbnZxpGEaUGjzBkubrK + um3fgCNXzJ9S3376J5vWaIecEeC5k/E4a3IGeyAG9sQwDWeXBiM/AkiRXe0cWlEuqkLwxayoZ/Wi + aHcMimvOlmJe1VUlzpHt3oDLURG0HrOG4wBxizbb5jEhaWZYB6IdX4O/MIuEdwGz+g/IhJtVbD0R + fGVs10mTJoyvR4/pZG6DSd9TJiQXDGcIqeWOKQ9xz0cG5sZ0fUkiKskERDPkfTQeowWcswnYBKVS + afEzD04aHrFVyuc6d5vtev2wmTb3T02q/QnOn16f1tOb6ZIevwAAAP//AwCVwa3sPwIAAA== + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=97 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: user=admin&password=password + headers: + Accept: + - text/plain + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '28' + Content-Type: + - application/x-www-form-urlencoded + Referer: + - https://ipa.noggin.test/ipa/session/login_password + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/login_password + response: + body: + string: !!binary | + H4sIAAAAAAAAAwMAAAAAAAAAAAA= + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Length: + - '20' + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - text/plain; charset=UTF-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=MagBearerToken=WMIq6uhv75ZA3Hcss0G9i%2bTbQqZkknC%2be4p2srXnKL3G9%2fgY518bBK%2bt7fhsJxMWZ%2bX2TT0tvq40YDObI98Y19OZpRL9MDUGtw%2bE9lHn%2b1r4fW5LrZ1r7EC5zF1%2bhgC31fWUUY4PYJ2Lw2mnPpa89%2b5%2bm9CCi8Wp1GFuoIhvRFvSAZUSf%2bv8HXbgi4futBNd;path=/ipa;httponly;secure; + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "ping", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=WMIq6uhv75ZA3Hcss0G9i%2bTbQqZkknC%2be4p2srXnKL3G9%2fgY518bBK%2bt7fhsJxMWZ%2bX2TT0tvq40YDObI98Y19OZpRL9MDUGtw%2bE9lHn%2b1r4fW5LrZ1r7EC5zF1%2bhgC31fWUUY4PYJ2Lw2mnPpa89%2b5%2bm9CCi8Wp1GFuoIhvRFvSAZUSf%2bv8HXbgi4futBNd + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqFYqLs3NTSyqBLKVPAMcFYpTi8pSixSAuDgzP0/BRM9Sz0JP + wTHAEy5kpGdkYqpUq6OglFpUlF8E1JhXmpMD5GamINgFRZl5yZkFiTkgcxNTcjPzHPz83d09/fRC + XINDlIAqoMaB5MGWKNUCAAAA//8DAMf44NuXAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "otptoken_del", "params": [["b6ebd173-dc72-4247-bfae-5ca8d63433d6"], + {"continue": false, "version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '121' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=WMIq6uhv75ZA3Hcss0G9i%2bTbQqZkknC%2be4p2srXnKL3G9%2fgY518bBK%2bt7fhsJxMWZ%2bX2TT0tvq40YDObI98Y19OZpRL9MDUGtw%2bE9lHn%2b1r4fW5LrZ1r7EC5zF1%2bhgC31fWUUY4PYJ2Lw2mnPpa89%2b5%2bm9CCi8Wp1GFuoIhvRFvSAZUSf%2bv8HXbgi4futBNd + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA4yOvQ6CMBSFX6W5syWRVkAnBw1xARPZlKHQS9JYCinUxBDe3XbS0e07OTk/C1ic + nJ7hQJZf7ITSKD3e63VD4CW0w6CgSbCR25RR2aYx5TFPadMJpLtWZDJhnDGZQO0jk+t7Yd8+BCfU + OKMkZXUl8/BEQx5/9TwAwjhaO1jfY5zWXir55dEq06pR6DAjZK/MsSjz/FJE1flWQXiOdlKDCT6P + 9lEG6wcAAP//AwB8/30J8wAAAA== + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "session_logout", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=WMIq6uhv75ZA3Hcss0G9i%2bTbQqZkknC%2be4p2srXnKL3G9%2fgY518bBK%2bt7fhsJxMWZ%2bX2TT0tvq40YDObI98Y19OZpRL9MDUGtw%2bE9lHn%2b1r4fW5LrZ1r7EC5zF1%2bhgC31fWUUY4PYJ2Lw2mnPpa89%2b5%2bm9CCi8Wp1GFuoIhvRFvSAZUSf%2bv8HXbgi4futBNd + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqEYw80pzcmp1FJRSi4ryi6B8IDczBcEuKMrMS84sSMwBCikl + puRm5jn4+bu7e/rphbgGhygBVZSlFhVn5ueB5E30LPUslGoBAAAA//8DAFS1MxltAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=97 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=;Max-Age=0;path=/ipa;httponly;secure; + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "session_logout", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zr%2fzgrvv98tfCWAzTZHDw0PcUAaJ478ktx8Wjq5Gq8QB%2fLE8szN5yMA1sZ9aXBk2ZGZ5iHoqTosxR1O4GdLkNVn%2fmq8sq0jnBaYIN5TdW8MMWkC2ye54D%2fJtO8vewGUTR4UdC87CaXpuhXXA2bp8Haz5W2wBVaKGe%2fGPlEXv6%2fxLymC%2flBxhWQcjShQAngGk + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqEYw80pzcmp1FJRSi4ryi6B8IDczBcEuKMrMS84sSMwBCiml + lObmVjr4+bu7e/rphbgGhygBVZSlFhVn5ueB5E30LPUslGoBAAAA//8DAPDpNvptAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=;Max-Age=0;path=/ipa;httponly;secure; + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: user=admin&password=password + headers: + Accept: + - text/plain + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '28' + Content-Type: + - application/x-www-form-urlencoded + Referer: + - https://ipa.noggin.test/ipa/session/login_password + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/login_password + response: + body: + string: !!binary | + H4sIAAAAAAAAAwAAAP//AwAAAAAAAAAAAA== + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - text/plain; charset=UTF-8 + Date: + - Thu, 12 May 2022 13:10:28 GMT + Keep-Alive: + - timeout=30, max=100 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=MagBearerToken=zd0AtXcPzuW2wO3lG2F3orKWNAf4cLbXnGujqj5Z5t4qYaSYH73ic%2bMwosF1tZFwlYZTQ1rPzbd3wbmKLQo9HQiDRmI53IMOkLEVmmrodgKM52jfOqVeyuI43DAZMGjF7UtPZOPZ%2fdMvv3JgY10OUlv1qPptgF8Y8IFaKYOvMMFnjdRYEvocfU4f8z9p2TO4;path=/ipa;httponly;secure; + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "ping", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zd0AtXcPzuW2wO3lG2F3orKWNAf4cLbXnGujqj5Z5t4qYaSYH73ic%2bMwosF1tZFwlYZTQ1rPzbd3wbmKLQo9HQiDRmI53IMOkLEVmmrodgKM52jfOqVeyuI43DAZMGjF7UtPZOPZ%2fdMvv3JgY10OUlv1qPptgF8Y8IFaKYOvMMFnjdRYEvocfU4f8z9p2TO4 + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqFYqLs3NTSyqBLKVPAMcFYpTi8pSixSAuDgzP0/BRM9Sz0JP + wTHAEy5kpGdkYqpUq6OglFpUlF8E1JhXmpMD5GamINgFRZl5yZkFiTkgcxNTcjPzHPz83d09/fRC + XINDlIAqoMaB5MGWKNUCAAAA//8DAMf44NuXAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:29 GMT + Keep-Alive: + - timeout=30, max=99 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "user_del", "params": [["dummy"], {"continue": false, "version": + "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '86' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zd0AtXcPzuW2wO3lG2F3orKWNAf4cLbXnGujqj5Z5t4qYaSYH73ic%2bMwosF1tZFwlYZTQ1rPzbd3wbmKLQo9HQiDRmI53IMOkLEVmmrodgKM52jfOqVeyuI43DAZMGjF7UtPZOPZ%2fdMvv3JgY10OUlv1qPptgF8Y8IFaKYOvMMFnjdRYEvocfU4f8z9p2TO4 + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA0yNsQ7CMAxEfyXyjDIxABMDqGIpQ7vRDhExkiUnrZwGqar673XUAbZ357vzAoIp + 8wQXs/zjxxGjV3z168HA13HGosDnEGbo1UtKTmZ14YaME3qTE4rp9kwHUJooMohmYmZWSf7Ho1B8 + 0+i4TDgfKF7rZ1U9atvemxbKW5REQyz3oz3bE6wbAAAA//8DAP7cm4+wAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:29 GMT + Keep-Alive: + - timeout=30, max=98 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +- request: + body: '{"method": "session_logout", "params": [[], {"version": "2.235"}]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/json + Cookie: + - ipa_session=MagBearerToken=zd0AtXcPzuW2wO3lG2F3orKWNAf4cLbXnGujqj5Z5t4qYaSYH73ic%2bMwosF1tZFwlYZTQ1rPzbd3wbmKLQo9HQiDRmI53IMOkLEVmmrodgKM52jfOqVeyuI43DAZMGjF7UtPZOPZ%2fdMvv3JgY10OUlv1qPptgF8Y8IFaKYOvMMFnjdRYEvocfU4f8z9p2TO4 + Referer: + - https://ipa.noggin.test/ipa + User-Agent: + - python-requests/2.27.1 + method: POST + uri: https://ipa.noggin.test/ipa/session/json + response: + body: + string: !!binary | + H4sIAAAAAAAAA6pWKkotLs0pUbJSqEYw80pzcmp1FJRSi4ryi6B8IDczBcEuKMrMS84sSMwBCikl + puRm5jn4+bu7e/rphbgGhygBVZSlFhVn5ueB5E30LPUslGoBAAAA//8DAFS1MxltAAAA + headers: + Cache-Control: + - no-cache, private + Connection: + - Keep-Alive + Content-Encoding: + - gzip + Content-Security-Policy: + - frame-ancestors 'none' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 12 May 2022 13:10:29 GMT + Keep-Alive: + - timeout=30, max=97 + Server: + - Apache/2.4.51 (Fedora) OpenSSL/1.1.1l mod_wsgi/4.9.0 Python/3.10 mod_auth_gssapi/1.6.3 + Set-Cookie: + - ipa_session=;Max-Age=0;path=/ipa;httponly;secure; + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Frame-Options: + - DENY + status: + code: 200 + message: Success +version: 1 diff --git a/noggin/tests/unit/controller/test_user_otp.py b/noggin/tests/unit/controller/test_user_otp.py index 931a63b9f..0884ab1bd 100644 --- a/noggin/tests/unit/controller/test_user_otp.py +++ b/noggin/tests/unit/controller/test_user_otp.py @@ -694,3 +694,31 @@ def test_user_settings_otp_enable(client, logged_in_dummy_user, dummy_user_with_ tokenlist = page.select("div.list-group .list-group-item.text-muted") # check we are showing 0 disabled tokens assert len(tokenlist) == 0 + + +@pytest.mark.vcr() +def test_user_settings_otp_rename(client, logged_in_dummy_user_with_otp): + """Test renaming an otp token""" + # add another OTP Token + result = client.get("/user/dummy/settings/otp/") + + page = BeautifulSoup(result.data, "html.parser") + tokenlist = page.select("div.list-group .list-group-item") + assert len(tokenlist) == 1 + + # grab the id of the first token + tokenid = tokenlist[0].select(".text-monospace")[0].get_text(strip=True) + + # disable that token + result = client.post( + "/user/dummy/settings/otp/rename/", + data={"token": tokenid, "description": "the new name"}, + follow_redirects=True, + ) + + page = BeautifulSoup(result.data, "html.parser") + tokenlist = page.select("div.list-group .list-group-item") + assert len(tokenlist) == 1 + + desc = tokenlist[0].select(".otp-description")[0].get_text(strip=True) + assert desc == "the new name"