trust-store 2.0.3
Provides a common implementation of a trust store to be used by trusted helpers.
cached_agent.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */
18
19#ifndef CORE_TRUST_CACHED_AGENT_H_
20#define CORE_TRUST_CACHED_AGENT_H_
21
22#include <core/trust/agent.h>
23
24namespace core
25{
26namespace trust
27{
30{
31public:
33 typedef std::shared_ptr<CachedAgent> Ptr;
34
49
52 {
54 std::shared_ptr<Agent> agent;
56 std::shared_ptr<Store> store;
58 std::shared_ptr<Reporter> reporter;
59 };
60
66 CachedAgent(const Configuration& configuration);
68 virtual ~CachedAgent() = default;
70
73
74private:
76 Configuration configuration;
77};
78}
79}
80
81#endif // CORE_TRUST_CACHED_AGENT_H_
Abstracts user-prompting functionality.
Definition agent.h:34
std::shared_ptr< CachedAgent > Ptr
To save some typing.
Request::Answer authenticate_request_with_parameters(const core::trust::Agent::RequestParameters &parameters) override
From core::trust::Agent.
CachedAgent(const Configuration &configuration)
CachedAgent creates a new agent instance.
Contains functionality for implementing Ubuntu's trust model.
Definition agent.h:31
Definition agent.h:29
Summarizes all parameters for processing a trust request.
Definition agent.h:66
std::shared_ptr< Store > store
The store caching user answers to trust prompts.
std::shared_ptr< Agent > agent
The actual agent implementation for prompting the user.
std::shared_ptr< Reporter > reporter
The reporter implementation.
Abstract capturer of internal events for post-mortem debugging/analysis purposes.
virtual void report_cached_answer_found(const core::trust::Agent::RequestParameters &, const core::trust::Request &)
Invoked whenever the implementation was able to resolve a cached request.
virtual void report_user_prompted_for_trust(const core::trust::Agent::RequestParameters &, const core::trust::Request::Answer &)
Invoked whenever the implementation called out to an agent to prompt the user for trust.
The Request struct encapsulates information about a trust request answered by the user.
Definition request.h:55
Answer
Enumerates the possible answers given by a user.
Definition request.h:66
#define CORE_TRUST_DLL_PUBLIC
Definition visibility.h:26