Fastly Compute C++ SDK
Loading...
Searching...
No Matches
secret_store.h
Go to the documentation of this file.
1#ifndef FASTLY_SECRET_STORE_H
2#define FASTLY_SECRET_STORE_H
3
4#include <fastly/error.h>
5#include <fastly/sdk-sys.h>
6#include <optional>
7#include <string>
8#include <string_view>
9#include <vector>
10
12
13class SecretStore;
14
21class Secret {
22 friend SecretStore;
23
24public:
38 fastly::expected<Secret> from_bytes(std::vector<uint8_t> data);
39
57 std::string plaintext();
58
59private:
60 rust::Box<fastly::sys::secret_store::Secret> s;
61 Secret(rust::Box<fastly::sys::secret_store::Secret> secret)
62 : s(std::move(secret)) {};
63};
64
70class SecretStore {
71public:
72 static fastly::expected<SecretStore> open(std::string_view name);
73
79
81
83 fastly::expected<bool> contains(std::string_view key);
84
85private:
86 rust::Box<fastly::sys::secret_store::SecretStore> ss;
87 SecretStore(rust::Box<fastly::sys::secret_store::SecretStore> s)
88 : ss(std::move(s)) {};
89};
90
91} // namespace fastly::secret_store
92
93namespace fastly {
95}
96
97#endif
Definition secret_store.h:70
static fastly::expected< SecretStore > open(std::string_view name)
fastly::expected< std::optional< Secret > > get(std::string_view key)
fastly::expected< bool > contains(std::string_view key)
Return true if the secret store contains a secret with the given.
fastly::expected< Secret > from_bytes(std::vector< uint8_t > data)
tl::expected< T, FastlyError > expected
Definition error.h:25
Definition secret_store.h:11
Definition backend.h:13