#pragma once #include "evo/network/dev_grant.hpp" #include #include #include #include #include #include // Dev-only session credentials (ADR-0083): a self-signed dev CA, a server // certificate/key for one name, and a 32-byte grant HMAC key. Generated on an // operator machine for the dev namespace Secret; refused for stage and World0. namespace evo::network { struct DevCredentials { std::string authority_pem; // Public: given to dev clients. std::string server_certificate_pem; // Public. std::string server_key_pem; // Secret. std::array grant_key{}; // Secret. }; [[nodiscard]] std::expected generate_dev_credentials(DeploymentEnvironment environment, std::string_view server_name, std::uint32_t days, std::chrono::system_clock::time_point now); // Lowercase hex, 64 digits; surrounding whitespace is ignored when parsing. [[nodiscard]] std::string format_grant_key(std::span key); [[nodiscard]] std::expected, GrantError> parse_grant_key(std::string_view text); // Random 64-bit nonzero grant ids from the PSA RNG. [[nodiscard]] std::expected random_grant_id(); } // namespace evo::network