mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
The endpoint is only active if there are no users in the datastore.
While the endpoint is active, it also disables all the other API endpoints, and /config returns `{"require_setup":true}`
for #378
16 lines
296 B
Go
16 lines
296 B
Go
package service
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
func decodeSetupRequest(ctx context.Context, r *http.Request) (interface{}, error) {
|
|
var req setupRequest
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
return nil, err
|
|
}
|
|
return req, nil
|
|
}
|