Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m31s
Foundation / postgres-tools (push) Successful in 27s
Foundation / server-image (push) Successful in 4m33s
Foundation / image (push) Successful in 5m39s
The Regions page opens the next region in place of the one DEV serves: the admin API reads the region overlay, its kustomization, the grant broker and the portal deployment from main at one commit, rewrites only the region id, routes, genesis commit and seeded wildlife range (refusing files whose layout differs), commits them in one Gitea multi-file commit as aevolution-bot, then starts a full Argo sync of exactly that commit. The page follows the sync until the region is live, across the portal's own restart. Credentials come from Secret aevolution-admin mounted read-only as files (--deploy-config); without it the feature stays off. A small OpenSSL HTTPS client talks to Gitea (verified) and argocd-server (verification per ARGOCD_TLS_VERIFY). The portal's NetworkPolicy gains egress to the node's ingress for Gitea and to the argocd-server pods, as approved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.8 KiB
C++
47 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
// ADR-0131: a small, bounded JSON reader for access-token claims and the realm's JWKS.
|
|
// It accepts RFC 8259 JSON within the bounds below and nothing else (no comments, no
|
|
// trailing commas, no duplicate-key resolution beyond "first wins").
|
|
namespace evo::serialization {
|
|
inline constexpr std::size_t max_json_bytes = std::size_t{16} * 1024;
|
|
inline constexpr std::size_t max_json_depth = 16;
|
|
|
|
class JsonValue {
|
|
public:
|
|
enum class Kind : std::uint8_t { null, boolean, number, string, array, object };
|
|
[[nodiscard]] Kind kind() const noexcept {
|
|
return kind_;
|
|
}
|
|
// Typed views; nullopt or nullptr when the value has another kind.
|
|
[[nodiscard]] std::optional<bool> boolean() const;
|
|
[[nodiscard]] std::optional<std::string_view> string() const;
|
|
// Integers only (no fraction or exponent), within 0..2^63-1.
|
|
[[nodiscard]] std::optional<std::uint64_t> integer() const;
|
|
[[nodiscard]] const JsonValue* member(std::string_view name) const;
|
|
[[nodiscard]] const std::vector<JsonValue>* array() const;
|
|
|
|
// Whole-document parse; nullopt for anything malformed or out of bounds. `limit` bounds
|
|
// the text: access tokens and keys keep the default; a service's answer may allow more.
|
|
[[nodiscard]] static std::optional<JsonValue> parse(std::string_view text,
|
|
std::size_t limit = max_json_bytes);
|
|
|
|
private:
|
|
friend class JsonParser;
|
|
Kind kind_{Kind::null};
|
|
bool boolean_{};
|
|
std::string text_; // String value, or the number's literal.
|
|
std::vector<JsonValue> items_;
|
|
std::vector<std::pair<std::string, JsonValue>> members_;
|
|
};
|
|
} // namespace evo::serialization
|