Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
control_host_enrollment.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <chrono>
7#include <cstddef>
8#include <cstdint>
9#include <functional>
10#include <memory>
11#include <optional>
12#include <string>
13#include <string_view>
14
15namespace pulp::inspect {
16
17inline constexpr std::size_t kControlMaximumHostEnrollments = 1024;
18inline constexpr auto kControlMaximumHostEnrollmentTtl = std::chrono::seconds(30);
19
26
28 std::string enrollment_id;
29 std::chrono::steady_clock::time_point expires_at;
30};
31
36
42 public:
48
49 std::int64_t expected_process_id() const;
51 std::uint64_t broker_generation() const;
52 std::chrono::steady_clock::time_point expires_at() const;
54
55 private:
56 struct Impl;
57 explicit ControlHostEnrollmentPlan(std::unique_ptr<Impl> impl);
59 std::unique_ptr<Impl> impl_;
60};
61
65
72 public:
75 using Clock = std::function<std::chrono::steady_clock::time_point()>;
76
79 Clock clock = [] { return std::chrono::steady_clock::now(); });
83
89 const VerifiedControlPeerIdentity& preobserved_child,
90 std::uint64_t current_broker_generation,
91 std::chrono::steady_clock::time_point expires_at);
92 std::optional<ControlHostEnrollmentPlan> consume(std::string_view enrollment_id);
93 std::size_t sweep();
94 std::size_t size() const;
95
96 private:
97 struct Impl;
98 std::unique_ptr<Impl> impl_;
99};
100
101} // namespace pulp::inspect
const ControlTrustedHostSnapshot & snapshot() const
ControlHostEnrollmentPlan(ControlHostEnrollmentPlan &&) noexcept
std::chrono::steady_clock::time_point expires_at() const
const ControlPeerExpectation & expected_peer() const
friend class ControlHostEnrollmentStore
Definition control_host_enrollment.hpp:58
std::function< std::chrono::steady_clock::time_point()> Clock
Invoked under the store mutex; it must be bounded, non-blocking, and non-reentrant.
Definition control_host_enrollment.hpp:75
ControlHostEnrollmentStore(const ControlHostEnrollmentStore &)=delete
ControlHostEnrollmentResult create(ControlTrustedHostSnapshot snapshot, const VerifiedControlPeerIdentity &preobserved_child, std::uint64_t current_broker_generation, std::chrono::steady_clock::time_point expires_at)
preobserved_child must come from kernel evidence on an endpoint-owned private rendezvous.
ControlHostEnrollmentStore & operator=(const ControlHostEnrollmentStore &)=delete
ControlHostEnrollmentStore(ControlHostEnrollmentStoreConfig config={}, Clock clock=[] { return std::chrono::steady_clock::now();})
std::optional< ControlHostEnrollmentPlan > consume(std::string_view enrollment_id)
Immutable broker-owned launch material.
Definition control_trusted_host_inventory.hpp:94
Copyable proof minted only by the broker's trusted OS peer verifier.
Definition control_identity.hpp:63
Definition agent_context.hpp:7
constexpr std::size_t kControlMaximumHostEnrollments
Definition control_host_enrollment.hpp:17
@ EntropyUnavailable
Definition control_connection_admission.hpp:46
constexpr auto kControlMaximumHostEnrollmentTtl
Definition control_host_enrollment.hpp:18
ControlHostEnrollmentStatus
Definition control_host_enrollment.hpp:20
@ Created
Definition control_host_enrollment.hpp:21
@ InvalidRequest
Definition control_host_enrollment.hpp:22
@ ResourceExhausted
Definition control_admission.hpp:26
@ InvalidRequest
Definition control_admission.hpp:17
STL namespace.
Definition control_host_enrollment.hpp:32
ControlHostEnrollmentStatus status
Definition control_host_enrollment.hpp:33
std::optional< ControlHostEnrollmentTicket > ticket
Definition control_host_enrollment.hpp:34
Definition control_host_enrollment.hpp:62
std::size_t maximum_enrollments
Definition control_host_enrollment.hpp:63
Definition control_host_enrollment.hpp:27
std::string enrollment_id
Definition control_host_enrollment.hpp:28
std::chrono::steady_clock::time_point expires_at
Definition control_host_enrollment.hpp:29
Exact broker-owned peer expectation.
Definition control_peer.hpp:12