-
Notifications
You must be signed in to change notification settings - Fork 0
/
consts.go
209 lines (156 loc) · 6.93 KB
/
consts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package gokwallet
// KwalletD Dbus returns.
const (
DbusSuccess int32 = 0
DbusFailure int32 = 1
)
type kwalletdEnumType int32
// KwalletD Dbus enums for WalletItem types.
const (
KwalletdEnumTypeUnknown kwalletdEnumType = iota // UnknownItem (0)
KwalletdEnumTypePassword // Password (1)
KwalletdEnumTypeStream // Blob (2)
KwalletdEnumTypeMap // Map (3)
KwalletdEnumTypeUnused = 0xffff // 65535
)
// KWalletD Dbus interfaces.
const (
// DbusService is the Dbus service bus identifier.
DbusService string = "org.kde.kwalletd5"
// DbusServiceBase is the base identifier used by interfaces.
DbusServiceBase string = "org.kde"
)
// gokwallet defaults.
const (
// DefaultWalletName is the name of the default Wallet to use.
DefaultWalletName string = "kdewallet"
// DefaultAppID is the default name for the application (see WalletManager.AppID).
DefaultAppID string = "GoKwallet"
// DefaultWindowID is 0; we aren't guaranteed to have a window, so we pass 0 (per upstream headers' comments).
DefaultWindowID int64 = 0
)
var (
DefaultRecurseOpts *RecurseOpts = &RecurseOpts{
All: false,
Wallets: true,
Folders: true,
AllWalletItems: false,
Passwords: false,
Maps: false,
Blobs: false,
UnknownItems: false,
}
)
// WalletManager interface.
const (
/*
DbusInterfaceWM is the Dbus interface for working with a WalletManager.
*/
DbusInterfaceWM string = DbusServiceBase + ".KWallet"
// Methods
// DbusWMChangePassword changes the password for a Wallet.
DbusWMChangePassword string = DbusInterfaceWM + ".changePassword"
// DbusWMClose closes an App (WalletManager) or Wallet.
DbusWMClose string = DbusInterfaceWM + ".close"
// DbusWMCloseAllWallets closes all WalletManager.Wallets.
DbusWMCloseAllWallets string = DbusInterfaceWM + ".closeAllWallets"
// DbusWMCreateFolder creates a Folder.
DbusWMCreateFolder string = DbusInterfaceWM + ".createFolder"
// DbusWMDeleteWallet deletes/removes a Wallet.
DbusWMDeleteWallet string = DbusInterfaceWM + ".deleteWallet"
// DbusWMDisconnectApp disconnects a WalletManager (or other App).
DbusWMDisconnectApp string = DbusInterfaceWM + ".disconnectApplication"
// DbusWMEntriesList returns a *map* of the WalletItem objects in a Folder (with their entry name as the map key).
DbusWMEntriesList string = DbusInterfaceWM + ".entriesList"
// DbusWMEntryList returns a *slice* of WalletItem names in a Folder.
DbusWMEntryList string = DbusInterfaceWM + ".entryList"
// DbusWMEntryType returns the type of a WalletItem.
DbusWMEntryType string = DbusInterfaceWM + ".entryType"
// DbusWMFolderNotExist indicates if a Folder exists within a Wallet or not.
DbusWMFolderNotExist string = DbusInterfaceWM + ".folderDoesNotExist"
// DbusWMFolderList lists the Folder objects (as Folder.Name) in a Wallet.
DbusWMFolderList string = DbusInterfaceWM + ".folderList"
// DbusWMHasEntry indicates if a Folder has a WalletItem or not.
DbusWMHasEntry string = DbusInterfaceWM + ".hasEntry"
// DbusWMHasFolder indicates if a Wallet has a Folder or not.
DbusWMHasFolder string = DbusInterfaceWM + ".hasFolder"
/*
DbusWMIsEnabled indicates if KWallet is enabled.
TODO: Is this accurate?
*/
DbusWMIsEnabled string = DbusInterfaceWM + ".isEnabled"
// DbusWMIsOpen indicates if a Wallet is open (unlocked).
DbusWMIsOpen string = DbusInterfaceWM + ".isOpen"
// DbusWMKeyNotExist indicates if a Folder has a WalletItem or not.
DbusWMKeyNotExist string = DbusInterfaceWM + ".keyDoesNotExist"
// DbusWMLocalWallet gives the name of the local (default?) Wallet.
DbusWMLocalWallet string = DbusInterfaceWM + ".localWallet"
// DbusWMMapList gives a list of Map names in a Folder.
DbusWMMapList string = DbusInterfaceWM + ".mapList"
/*
DbusWMNetWallet indicates if a Wallet is a Network Wallet or not.
TODO: is/was this ever used?
*/
DbusWMNetWallet string = DbusInterfaceWM + ".networkWallet"
// DbusWMOpen opens (unlocks) a Wallet.
DbusWMOpen string = DbusInterfaceWM + ".open"
// DbusWMOpenAsync opens (unlocks) a Wallet asynchronously.
DbusWMOpenAsync string = DbusInterfaceWM + ".openAsync"
// DbusWMOpenPath opens a Wallet by its filepath.
DbusWMOpenPath string = DbusInterfaceWM + ".openPath"
// DbusWMOpenPathAsync opens a Wallet by its filepath asynchronously.
DbusWMOpenPathAsync string = DbusInterfaceWM + ".openPath"
// DbusWMPamOpen opens (unlocks) a Wallet via PAM.
DbusWMPamOpen string = DbusInterfaceWM + ".pamOpen"
/*
DbusWMPasswordList returns a map of Password objects in a Folder.
Password.Name is the map key.
*/
DbusWMPasswordList string = DbusInterfaceWM + ".passwordList"
// DbusWMReadEntry fetches a WalletItem by its name from a Folder (as a byteslice).
DbusWMReadEntry string = DbusInterfaceWM + ".readEntry"
/*
DbusWMReadEntryList returns a map of WalletItem objects in a Folder.
Deprecated: use DbusWMEntriesList instead.
*/
// DbusWMReadEntryList string = DbusInterfaceWM + ".readEntryList"
// DbusWMReadMap returns a Map from a Folder (as a byteslice).
DbusWMReadMap string = DbusInterfaceWM + ".readMap"
/*
DbusWMReadMapList returns a map of Map objects in a Folder.
Deprecated: use DbusWMMapList instead.
*/
// DbusWMReadMapList string = DbusInterfaceWM + ".readMapList"
// DbusWMReadPassword returns a Password from a Folder (as a byteslice).
DbusWMReadPassword string = DbusInterfaceWM + ".readPassword"
/*
DbusWMReadPasswordList returns a map of Password objects in a Folder.
Deprecated: use DbusWMPasswordList instead.
*/
// DbusWMReadPasswordList string = DbusInterfaceWM + ".readPasswordList"
// DbusWMReconfigure is [FUNCTION UNKNOWN/UNDOCUMENTED; TODO? NOT IMPLEMENTED.]
// DbusWMReconfigure string = DbusInterfaceWM + ".reconfigure"
// DbusWMRemoveEntry removes a WalletItem from a Folder.
DbusWMRemoveEntry string = DbusInterfaceWM + ".removeEntry"
// DbusWMRemoveFolder removes a Folder from a Wallet.
DbusWMRemoveFolder string = DbusInterfaceWM + ".removeFolder"
// DbusWMRenameEntry renames ("moves") a WalletItem.
DbusWMRenameEntry string = DbusInterfaceWM + ".renameEntry"
// DbusWMSync is [FUNCTION UNKNOWN/UNDOCUMENTED; TODO? RELATED TO ASYNC? NOT IMPLEMENTED.]
// DbusWMSync string = DbusInterfaceWM + ".sync"
// DbusWMUsers returns a slice of users.
DbusWMUsers string = DbusInterfaceWM + ".users"
// DbusWMWallets returns an array of Wallet names.
DbusWMWallets string = DbusInterfaceWM + ".wallets"
// DbusWMWriteEntry writes (creates) a WalletItem to/in a Folder.
DbusWMWriteEntry string = DbusInterfaceWM + ".writeEntry"
// DbusWMWriteMap writes (creates) a Map (via a byteslice) to/in a Folder.
DbusWMWriteMap string = DbusInterfaceWM + ".writeMap"
// DbusWMWritePassword writes (creates) a Password to/in a Folder.
DbusWMWritePassword string = DbusInterfaceWM + ".writePassword"
)
// Dbus paths.
const (
// DbusPath is the path for DbusService.
DbusPath string = "/modules/kwalletd5"
)