feat(doos): add container runtime, audit cases, example demo and tests
- New rootless doos container runtime: sandbox, cgroup, network, images, hardening, davmount, CLI plus molo integration - 18 CVE audit reproductions with READMEs and Makefiles - Example DoosDemo routes, IndexCatalog, static assets, spec update - CLI serve on 0.0.0.0:8000, arg parser, dev server improvements - Runtime HTTP fixes, supervisor isolation backend - Tests for doos, example doos routes, CLI serve; suite count 261 to 265
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// One row of the index page: a display name and the route that demonstrates it.
|
||||
struct FeatureRow {
|
||||
std::string name;
|
||||
std::string route;
|
||||
};
|
||||
|
||||
// A themed section of the index page. A route belongs to the first group that
|
||||
// lists its path prefix; routes matching no group fall into "Other".
|
||||
struct FeatureGroup {
|
||||
std::string id;
|
||||
std::string title;
|
||||
std::string blurb;
|
||||
std::string key_hint; // non-empty: the demos need these credentials
|
||||
std::vector<std::string> prefixes;
|
||||
};
|
||||
|
||||
// Groups the feature rows and renders the index sections (SPEC.md, index).
|
||||
class IndexCatalog {
|
||||
public:
|
||||
IndexCatalog();
|
||||
|
||||
// Display name for a registered feature ("ai-openai" -> "AI OpenAI").
|
||||
static std::string pretty_name(const std::string& feature);
|
||||
|
||||
// HTML for the jump chips and one table per non-empty group. Everything
|
||||
// dynamic is escaped; the result is safe to insert unescaped.
|
||||
std::string render(const std::vector<std::pair<std::string, std::string>>& rows,
|
||||
std::size_t* feature_count, std::size_t* group_count) const;
|
||||
|
||||
private:
|
||||
const FeatureGroup& group_for(const std::string& route) const;
|
||||
|
||||
std::vector<FeatureGroup> groups_;
|
||||
FeatureGroup other_;
|
||||
};
|
||||
|
||||
} // namespace molo::example::app
|
||||
Reference in New Issue
Block a user