fix: add apiToken to security quick-setup payload
The /api/security/quick-setup endpoint requires username, password, AND apiToken fields. Added a dummy 64-char hex API token for the test.
This commit is contained in:
parent
9de9119429
commit
c9e28b0ac2
1 changed files with 3 additions and 0 deletions
|
|
@ -102,9 +102,12 @@ func waitForHealth(t *testing.T, client *http.Client, baseURL string, timeout ti
|
||||||
|
|
||||||
func setupCredentials(t *testing.T, client *http.Client, baseURL, bootstrapToken, username, password string) {
|
func setupCredentials(t *testing.T, client *http.Client, baseURL, bootstrapToken, username, password string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
// Generate a dummy API token for tests (64 hex chars)
|
||||||
|
apiToken := "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
||||||
payload := map[string]interface{}{
|
payload := map[string]interface{}{
|
||||||
"username": username,
|
"username": username,
|
||||||
"password": password,
|
"password": password,
|
||||||
|
"apiToken": apiToken,
|
||||||
"setupToken": bootstrapToken,
|
"setupToken": bootstrapToken,
|
||||||
}
|
}
|
||||||
req, err := http.NewRequest("POST", baseURL+"/api/security/quick-setup", nil)
|
req, err := http.NewRequest("POST", baseURL+"/api/security/quick-setup", nil)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue