mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-19 10:33:29 +00:00
Cover public setup script access
This commit is contained in:
parent
b57fdd2085
commit
11e28689b2
1 changed files with 14 additions and 0 deletions
|
|
@ -2723,6 +2723,20 @@ func TestPathTraversalBlockedForNonAPIPaths(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestSetupScriptIsPublicEvenWhenAuthConfigured(t *testing.T) {
|
||||
cfg := newTestConfigWithTokens(t)
|
||||
cfg.AuthUser = "admin"
|
||||
cfg.AuthPass = "hashed"
|
||||
router := NewRouter(cfg, nil, nil, nil, nil, "1.0.0")
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/setup-script", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
router.Handler().ServeHTTP(rec, req)
|
||||
if rec.Code != http.StatusBadRequest {
|
||||
t.Fatalf("expected 400 for missing params on public setup script, got %d", rec.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOIDCLoginBypassesAuth(t *testing.T) {
|
||||
cfg := newTestConfigWithTokens(t)
|
||||
cfg.AuthUser = "admin"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue