Skip to content

Commit

Permalink
Remove deprecated user.set_root_password method (#14140)
Browse files Browse the repository at this point in the history
We don't currently consume this endpoint and have already marked
it as deprecated. Remove it completely to eliminate an endpoint
that allows unauthenticated access.
  • Loading branch information
anodos325 authored Aug 6, 2024
1 parent 0b49a5b commit e298e65
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/middlewared/middlewared/plugins/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,21 +1193,6 @@ async def has_local_administrator_set_up(self):
"""
return len(await self.middleware.call('privilege.local_administrators')) > 0

@no_auth_required
@accepts(
Password('password'),
Dict('options')
)
@returns()
@pass_app()
async def set_root_password(self, app, password, options):
"""
Deprecated method. Use `user.setup_local_administrator`
"""
warnings.warn("`user.set_root_password` has been deprecated. Use `user.setup_local_administrator`",
DeprecationWarning)
return await self.setup_local_administrator(app, 'root', password, options)

@no_auth_required
@accepts(
Str('username', enum=['root', 'truenas_admin']),
Expand Down

0 comments on commit e298e65

Please sign in to comment.