libzypp 17.37.17
userrequest.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#include "userrequest.h"
10
11namespace zyppng {
12
14 UserData d( CTYPE.data() );
15 d.set( FILE.data(), p );
16 return d;
17 }
18
20 UserData d( CTYPE.data() );
21 d.set( FILE.data(), p );
22 d.set( NAME.data(), name );
23 return d;
24 }
25
26 UserData AcceptWrongDigestRequest::makeData(const zypp::Pathname &p, const std::string &requested, const std::string &found) {
27 UserData d( CTYPE.data() );
28 d.set( FILE.data(), p );
29 d.set( NAME_REQUESTED.data(), requested );
30 d.set( NAME_FOUND.data(), found );
31 return d;
32 }
33
34 ZYPP_IMPL_PRIVATE_CONSTR_ARGS(TrustKeyRequest, std::string label, KeyTrust trust, UserData userData )
35 : UserRequest( std::move(userData) )
36 , _label( std::move(label) )
37 , _answer(trust)
38 { }
39
41 { _answer = sel; }
42
45
46 const std::string TrustKeyRequest::label() const
47 { return _label; }
48
51
52 UserData AcceptKeyRequest::makeData(const zypp::PublicKey &key, const zypp::KeyContext &keycontext)
53 {
54 UserData d( CTYPE.data() );
55 d.set( KEY.data(), key );
56 d.set( KEY_CONTEXT.data(), keycontext );
57 return d;
58 }
59
60 UserData VerifyInfoEvent::makeData(const std::string &file_r, const zypp::PublicKeyData &keyData_r, const zypp::KeyContext &keycontext)
61 {
62 UserData d( CTYPE.data() );
63 d.set( FILE.data(), file_r );
64 d.set( KEY_DATA.data(), keyData_r );
65 d.set( KEY_CONTEXT.data(), keycontext );
66 return d;
67 }
68
69 UserData AcceptUnsignedFileRequest::makeData(const std::string &file, const zypp::KeyContext &keycontext)
70 {
71 UserData d( CTYPE.data() );
72 d.set( FILE.data(), file );
73 d.set( KEY_CONTEXT.data(), keycontext );
74 return d;
75 }
76
77 UserData AcceptUnknownKeyRequest::makeData(const std::string &file, const std::string &id, const zypp::KeyContext &keycontext)
78 {
79 UserData d( CTYPE.data() );
80 d.set( KEYID.data(), id );
81 d.set( FILE.data(), file );
82 d.set( KEY_CONTEXT.data(), keycontext );
83 return d;
84 }
85
86 UserData AcceptFailedVerificationRequest::makeData(const std::string &file, const zypp::PublicKey &key, const zypp::KeyContext &keycontext)
87 {
88 UserData d( CTYPE.data() );
89 d.set( KEY.data(), key );
90 d.set( FILE.data(), file );
91 d.set( KEY_CONTEXT.data(), keycontext );
92 return d;
93 }
94
95 UserData AcceptPackageKeyRequest::makeData(const zypp::PublicKey &key_r, const zypp::KeyContext &keycontext_r)
96 {
97 UserData d( CTYPE.data() );
98 d.set( KEY.data(), key_r );
99 d.set( KEY_CONTEXT.data(), keycontext_r );
100 return d;
101 }
102
103 UserData NonImportedKeysInfoEvent::makeData(const std::set<zypp::Edition> &keys_r)
104 {
105 UserData d( CTYPE.data() );
106 d.set( KEYS.data(), &keys_r );
107 return d;
108 }
109
110 UserData KeyAutoImportInfoEvent::makeData(const std::list<zypp::PublicKeyData> &keyDataList_r, const zypp::PublicKeyData &keySigning_r, const zypp::KeyContext &keyContext_r)
111 {
112 UserData d( CTYPE.data() );
113 d.set( KEY_DATA_LIST.data(), &keyDataList_r );
114 d.set( KEY_DATA.data(), keySigning_r );
115 d.set( KEY_CONTEXT.data(), keyContext_r );
116 return d;
117 }
118}
bool set(const std::string &key_r, AnyType val_r)
Set the value for key (nonconst version always returns true).
Definition UserData.h:119
void setChoice(const KeyTrust sel)
const std::string label() const
KeyTrust choice() const
UserRequestType type() const override
Definition Arch.h:364
constexpr std::string_view FILE("file")
constexpr std::string_view KEY_CONTEXT("key-context")
UserData makeData(const std::string &file, const zypp::PublicKey &key, const zypp::KeyContext &keycontext=zypp::KeyContext())
constexpr std::string_view KEY("key")
constexpr std::string_view CTYPE("keyring/accept-failed-verification")
constexpr std::string_view KEY("key")
constexpr std::string_view CTYPE("keyring/accept-key")
UserData makeData(const zypp::PublicKey &key, const zypp::KeyContext &keycontext=zypp::KeyContext())
constexpr std::string_view KEY_CONTEXT("key-context")
UserData makeData(const zypp::Pathname &p)
constexpr std::string_view CTYPE("digest/accept-no-digest")
constexpr std::string_view FILE("file")
constexpr std::string_view CTYPE("keyring/accept-package-key")
UserData makeData(const zypp::PublicKey &key_r, const zypp::KeyContext &keycontext_r=zypp::KeyContext())
constexpr std::string_view KEY("key")
constexpr std::string_view KEY_CONTEXT("key-context")
UserData makeData(const zypp::Pathname &p, const std::string &name)
constexpr std::string_view CTYPE("digest/accept-unknown-digest")
constexpr std::string_view NAME("name")
constexpr std::string_view FILE("file")
UserData makeData(const std::string &file, const std::string &id, const zypp::KeyContext &keycontext=zypp::KeyContext())
constexpr std::string_view KEY_CONTEXT("key-context")
constexpr std::string_view FILE("file")
constexpr std::string_view CTYPE("keyring/accept-unknown-key")
constexpr std::string_view KEYID("keyid")
constexpr std::string_view CTYPE("keyring/accept-unsigned-file")
constexpr std::string_view KEY_CONTEXT("key-context")
constexpr std::string_view FILE("file")
UserData makeData(const std::string &file, const zypp::KeyContext &keycontext=zypp::KeyContext())
UserData makeData(const zypp::Pathname &p, const std::string &requested, const std::string &found)
constexpr std::string_view CTYPE("digest/accept-unknown-digest")
constexpr std::string_view NAME_FOUND("found")
constexpr std::string_view NAME_REQUESTED("requested")
constexpr std::string_view FILE("file")
constexpr std::string_view CTYPE("keyring/auto-import-key-info")
constexpr std::string_view KEY_DATA_LIST("key-data-list")
UserData makeData(const std::list< zypp::PublicKeyData > &keyDataList_r, const zypp::PublicKeyData &keySigning_r, const zypp::KeyContext &keyContext_r)
constexpr std::string_view KEY_DATA("key-data")
constexpr std::string_view KEY_CONTEXT("key-context")
constexpr std::string_view KEYS("keys")
constexpr std::string_view CTYPE("keyring/keys-not-imported")
UserData makeData(const std::set< zypp::Edition > &keys_r)
constexpr std::string_view FILE("file")
UserData makeData(const std::string &file_r, const zypp::PublicKeyData &keyData_r, const zypp::KeyContext &keycontext=zypp::KeyContext())
constexpr std::string_view KEY_DATA("key-data")
constexpr std::string_view KEY_CONTEXT("key-context")
constexpr std::string_view CTYPE("keyring/info-verify")
UserRequestType
Definition userrequest.h:34
zypp::callback::UserData UserData
Definition userrequest.h:18
#define ZYPP_IMPL_PRIVATE_CONSTR_ARGS(Class,...)
Definition zyppglobal.h:224