Skip to content

Commit ef3b6ab

Browse files
authored
Refactor auth_handler to use dependency injection (archlinux#4171)
1 parent 2421e53 commit ef3b6ab

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

archinstall/lib/authentication/authentication_handler.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,3 @@ def _configure_u2f_mapping(
126126
existing_keys = all_keys
127127

128128
u2f_auth_file.write_text(existing_keys)
129-
130-
131-
auth_handler = AuthenticationHandler()

archinstall/scripts/guided.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from archinstall.lib.applications.application_handler import application_handler
66
from archinstall.lib.args import arch_config_handler
7-
from archinstall.lib.authentication.authentication_handler import auth_handler
7+
from archinstall.lib.authentication.authentication_handler import AuthenticationHandler
88
from archinstall.lib.configuration import ConfigurationOutput
99
from archinstall.lib.disk.filesystem import FilesystemHandler
1010
from archinstall.lib.disk.utils import disk_layouts
@@ -54,6 +54,7 @@ def ask_user_questions(mirror_list_handler: MirrorListHandler) -> None:
5454
def perform_installation(
5555
mountpoint: Path,
5656
mirror_list_handler: MirrorListHandler,
57+
auth_handler: AuthenticationHandler,
5758
) -> None:
5859
"""
5960
Performs the installation steps on a block device.
@@ -219,7 +220,11 @@ def guided() -> None:
219220
fs_handler = FilesystemHandler(arch_config_handler.config.disk_config)
220221
fs_handler.perform_filesystem_operations()
221222

222-
perform_installation(arch_config_handler.args.mountpoint, mirror_list_handler)
223+
perform_installation(
224+
arch_config_handler.args.mountpoint,
225+
mirror_list_handler,
226+
AuthenticationHandler(),
227+
)
223228

224229

225230
guided()

0 commit comments

Comments
 (0)