fix(security): Correct IndentationError and implement secure password input
This commit is contained in:
parent
d591c299c8
commit
a768db1478
@ -2,20 +2,23 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import getpass
|
||||||
from inwx_config import login, logout # Importiere Login/Logout aus der Konfigurationsdatei
|
from inwx_config import login, logout # Importiere Login/Logout aus der Konfigurationsdatei
|
||||||
from inwx_dns_functions import get_dns_info, add_record, update_record, delete_record # Importiere DNS-Funktionen
|
from inwx_dns_functions import get_dns_info, add_record, update_record, delete_record # Importiere DNS-Funktionen
|
||||||
|
|
||||||
|
# 1. Login-Daten abfragen (kann auch über Umgebungsvariablen INWX_USER/INWX_PASS gesetzt werden)
|
||||||
def main_menu():
|
def main_menu():
|
||||||
"""Hauptmenü der CLI-Anwendung."""
|
"""Hauptmenü der CLI-Anwendung."""
|
||||||
|
|
||||||
# 1. Login-Daten abfragen (kann auch über Umgebungsvariablen INWX_USER/INWX_PASS gesetzt werden)
|
# 1. Login-Daten abfragen
|
||||||
INWX_USER = os.getenv('INWX_USER')
|
INWX_USER = os.getenv('INWX_USER')
|
||||||
INWX_PASS = os.getenv('INWX_PASS')
|
INWX_PASS = os.getenv('INWX_PASS')
|
||||||
|
|
||||||
if not INWX_USER:
|
if not INWX_USER:
|
||||||
INWX_USER = input("Gib deinen INWX-Benutzernamen ein: ")
|
INWX_USER = input("Gib deinen INWX-Benutzernamen ein: ")
|
||||||
if not INWX_PASS:
|
if not INWX_PASS:
|
||||||
INWX_PASS = input("Gib dein INWX-Passwort ein: ")
|
# **WICHTIGE KORREKTUR HIER:** Verwende getpass.getpass()
|
||||||
|
INWX_PASS = getpass.getpass("Gib dein INWX-Passwort ein: ")
|
||||||
|
|
||||||
if not login(INWX_USER, INWX_PASS):
|
if not login(INWX_USER, INWX_PASS):
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user