This commit is contained in:
2026-05-05 19:51:14 +02:00
parent 17ba07b592
commit 48ef85bec5
17 changed files with 7968 additions and 1393663 deletions

View File

@@ -1,31 +1,32 @@
*** Settings ***
Resource ${CURDIR}/common.resource
Library Collections
*** Keywords ***
Login As Admin
# Check setup status.
${response}= GET ${BACKEND_URL}/api/setup/status
${response}= GET ${BACKEND_URL}/api/v1/setup
${body}= Set Variable ${response.json()}
IF ${body}[setup_complete] == ${false}
IF ${body}[completed] == ${false}
# Complete the setup wizard with the dev master password ("Hallo123!").
${password}= Set Variable Hallo123!
${hashed}= Evaluate "sha256('${password}'.encode()).hexdigest()" modules=hashlib
${setup_payload}= Create Dictionary password=${hashed}
POST ${BACKEND_URL}/api/setup/complete json=${setup_payload}
${setup_payload}= Create Dictionary
... master_password=Hallo123!
... database_path=bangui.db
... fail2ban_socket=/var/run/fail2ban/fail2ban.sock
... timezone=UTC
... session_duration_minutes=60
POST ${BACKEND_URL}/api/v1/setup json=${setup_payload}
# Retry login after setup.
${response}= GET ${BACKEND_URL}/api/auth/login
${response}= POST ${BACKEND_URL}/api/v1/auth/login
END
# Perform login.
${password}= Set Variable Hallo123!
${hashed}= Evaluate "sha256('${password}'.encode()).hexdigest()" modules=hashlib
${login_payload}= Create Dictionary password=${hashed}
${response}= POST ${BACKEND_URL}/api/auth/login json=${login_payload}
${login_payload}= Create Dictionary password=Hallo123!
${response}= POST ${BACKEND_URL}/api/v1/auth/login json=${login_payload}
# Store session cookie for subsequent requests.
${cookies}= Get Cookies
${session_cookie}= Get Cookie Value bangui_session
Set Browser Variables session_cookie=${session_cookie}
${session_cookie}= Get Cookie bangui_session
Set Suite Variable ${session_cookie} ${session_cookie}
Log Logged in as admin.