diff --git a/src/middlewared/middlewared/plugins/account_/2fa.py b/src/middlewared/middlewared/plugins/account_/2fa.py index 19292866fb6eb..8c1bea08f8240 100644 --- a/src/middlewared/middlewared/plugins/account_/2fa.py +++ b/src/middlewared/middlewared/plugins/account_/2fa.py @@ -102,7 +102,7 @@ async def translate_username(self, username): return await self.middleware.call('user.query', [['username', '=', user['pw_name']]], {'get': True}) - @accepts(Str('username')) + @accepts(Str('username'), audit='Unset two-factor authentication secret:', audit_extended=lambda username: username) @returns() async def unset_2fa_secret(self, username): """ @@ -132,7 +132,12 @@ async def unset_2fa_secret(self, username): ) @no_authz_required - @api_method(UserRenew2faSecretArgs, UserRenew2faSecretResult) + @api_method( + UserRenew2faSecretArgs, + UserRenew2faSecretResult, + audit='Renew two-factor authentication secret:', + audit_extended=lambda username, options: username + ) @pass_app() async def renew_2fa_secret(self, app, username, twofactor_options): """ diff --git a/src/middlewared/middlewared/plugins/auth_/2fa.py b/src/middlewared/middlewared/plugins/auth_/2fa.py index 56125562eb3ef..ded6eb11155ec 100644 --- a/src/middlewared/middlewared/plugins/auth_/2fa.py +++ b/src/middlewared/middlewared/plugins/auth_/2fa.py @@ -62,7 +62,8 @@ async def two_factor_extend(self, data): 'auth_twofactor_entry', 'auth_twofactor_update', ('rm', {'name': 'id'}), ('attr', {'update': True}), - ) + ), + audit='Update two-factor authentication service configuration' ) async def do_update(self, data): """