Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Aug 7, 2024
1 parent 071ac66 commit 5ec95e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/middlewared/middlewared/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,10 @@ class FakeApplication:

def fake_app():
return FakeApplication()


def dump_credentials(credentials):
return {
"credentials": credentials.class_name(),
"credentials_data": credentials.dump(),
}
9 changes: 1 addition & 8 deletions src/middlewared/middlewared/plugins/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from middlewared.auth import (SessionManagerCredentials, UserSessionManagerCredentials,
UnixSocketSessionManagerCredentials, LoginPasswordSessionManagerCredentials,
ApiKeySessionManagerCredentials, TrueNasNodeSessionManagerCredentials,
TokenSessionManagerCredentials)
TokenSessionManagerCredentials, dump_credentials)
from middlewared.schema import accepts, Any, Bool, Datetime, Dict, Int, List, Password, Patch, Ref, returns, Str
from middlewared.service import (
Service, filterable, filterable_returns, filter_list, no_auth_required, no_authz_required,
Expand Down Expand Up @@ -144,13 +144,6 @@ def _app_on_close(self, app):
self.logout(app)


def dump_credentials(credentials):
return {
"credentials": credentials.class_name(),
"credentials_data": credentials.dump(),
}


class Session:
def __init__(self, manager, credentials, app):
self.manager = manager
Expand Down

0 comments on commit 5ec95e9

Please sign in to comment.