Add HTTP Basic authentication to the agent's API. Update OpenAPI specification to include security requirements and modify the server handler to enforce authentication. Introduce default admin credentials for access control.
This commit is contained in:
@@ -14,10 +14,16 @@ func TestSpec(t *testing.T) {
|
||||
if _, ok := paths["/api/v1/status"]; !ok {
|
||||
t.Fatal("missing /api/v1/status")
|
||||
}
|
||||
if _, ok := spec["security"]; !ok {
|
||||
t.Fatal("missing security")
|
||||
}
|
||||
components, ok := spec["components"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatal("missing components")
|
||||
}
|
||||
if _, ok := components["securitySchemes"]; !ok {
|
||||
t.Fatal("missing securitySchemes")
|
||||
}
|
||||
schemas, ok := components["schemas"].(map[string]any)
|
||||
if !ok || len(schemas) < 10 {
|
||||
t.Fatalf("expected schemas, got %d", len(schemas))
|
||||
|
||||
Reference in New Issue
Block a user