|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.Helpviewer.Passwords.PasswordManager</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.Helpviewer.Passwords.PasswordManager</h1> |
|
12 <p> |
|
13 Module implementing the password manager. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#LoginForm">LoginForm</a></td> |
|
23 <td>Class implementing a data structure for login forms.</td> |
|
24 </tr><tr> |
|
25 <td><a href="#PasswordManager">PasswordManager</a></td> |
|
26 <td>Class implementing the password manager.</td> |
|
27 </tr> |
|
28 </table> |
|
29 <h3>Functions</h3> |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /><hr /> |
|
34 <a NAME="LoginForm" ID="LoginForm"></a> |
|
35 <h2>LoginForm</h2> |
|
36 <p> |
|
37 Class implementing a data structure for login forms. |
|
38 </p> |
|
39 <h3>Derived from</h3> |
|
40 object |
|
41 <h3>Class Attributes</h3> |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <h3>Methods</h3> |
|
46 <table> |
|
47 <tr> |
|
48 <td><a href="#LoginForm.__init__">LoginForm</a></td> |
|
49 <td>Constructor</td> |
|
50 </tr><tr> |
|
51 <td><a href="#LoginForm.isValid">isValid</a></td> |
|
52 <td>Public method to test for validity.</td> |
|
53 </tr><tr> |
|
54 <td><a href="#LoginForm.load">load</a></td> |
|
55 <td>Public method to load the form data from a file.</td> |
|
56 </tr><tr> |
|
57 <td><a href="#LoginForm.save">save</a></td> |
|
58 <td>Public method to save the form data to a file.</td> |
|
59 </tr> |
|
60 </table> |
|
61 <a NAME="LoginForm.__init__" ID="LoginForm.__init__"></a> |
|
62 <h4>LoginForm (Constructor)</h4> |
|
63 <b>LoginForm</b>(<i></i>) |
|
64 <p> |
|
65 Constructor |
|
66 </p><a NAME="LoginForm.isValid" ID="LoginForm.isValid"></a> |
|
67 <h4>LoginForm.isValid</h4> |
|
68 <b>isValid</b>(<i></i>) |
|
69 <p> |
|
70 Public method to test for validity. |
|
71 </p><dl> |
|
72 <dt>Returns:</dt> |
|
73 <dd> |
|
74 flag indicating a valid form (boolean) |
|
75 </dd> |
|
76 </dl><a NAME="LoginForm.load" ID="LoginForm.load"></a> |
|
77 <h4>LoginForm.load</h4> |
|
78 <b>load</b>(<i>data</i>) |
|
79 <p> |
|
80 Public method to load the form data from a file. |
|
81 </p><dl> |
|
82 <dt><i>data</i></dt> |
|
83 <dd> |
|
84 list of strings to load data from (list of strings) |
|
85 </dd> |
|
86 </dl><dl> |
|
87 <dt>Returns:</dt> |
|
88 <dd> |
|
89 flag indicating success (boolean) |
|
90 </dd> |
|
91 </dl><a NAME="LoginForm.save" ID="LoginForm.save"></a> |
|
92 <h4>LoginForm.save</h4> |
|
93 <b>save</b>(<i>f</i>) |
|
94 <p> |
|
95 Public method to save the form data to a file. |
|
96 </p><dl> |
|
97 <dt><i>f</i></dt> |
|
98 <dd> |
|
99 file or file like object open for writing |
|
100 </dd> |
|
101 </dl><dl> |
|
102 <dt>Returns:</dt> |
|
103 <dd> |
|
104 flag indicating success (booelan) |
|
105 </dd> |
|
106 </dl> |
|
107 <div align="right"><a href="#top">Up</a></div> |
|
108 <hr /><hr /> |
|
109 <a NAME="PasswordManager" ID="PasswordManager"></a> |
|
110 <h2>PasswordManager</h2> |
|
111 <p> |
|
112 Class implementing the password manager. |
|
113 </p><h4>Signals</h4> |
|
114 <dl> |
|
115 <dt>changed()</dt> |
|
116 <dd> |
|
117 emitted to indicate a change |
|
118 </dd> |
|
119 </dl> |
|
120 <h3>Derived from</h3> |
|
121 QObject |
|
122 <h3>Class Attributes</h3> |
|
123 <table> |
|
124 <tr><td>FORMS</td></tr><tr><td>NEVER</td></tr><tr><td>SEPARATOR</td></tr> |
|
125 </table> |
|
126 <h3>Methods</h3> |
|
127 <table> |
|
128 <tr> |
|
129 <td><a href="#PasswordManager.__init__">PasswordManager</a></td> |
|
130 <td>Constructor</td> |
|
131 </tr><tr> |
|
132 <td><a href="#PasswordManager.__createKey">__createKey</a></td> |
|
133 <td>Private method to create the key string for the login credentials.</td> |
|
134 </tr><tr> |
|
135 <td><a href="#PasswordManager.__extractMultipartQueryItems">__extractMultipartQueryItems</a></td> |
|
136 <td>Private method to extract the query items for a post operation.</td> |
|
137 </tr><tr> |
|
138 <td><a href="#PasswordManager.__findForm">__findForm</a></td> |
|
139 <td>Private method to find the form used for logging in.</td> |
|
140 </tr><tr> |
|
141 <td><a href="#PasswordManager.__load">__load</a></td> |
|
142 <td>Private method to load the saved login credentials.</td> |
|
143 </tr><tr> |
|
144 <td><a href="#PasswordManager.__stripUrl">__stripUrl</a></td> |
|
145 <td>Private method to strip off all unneeded parts of a URL.</td> |
|
146 </tr><tr> |
|
147 <td><a href="#PasswordManager.allSiteNames">allSiteNames</a></td> |
|
148 <td>Public method to get a list of all site names.</td> |
|
149 </tr><tr> |
|
150 <td><a href="#PasswordManager.clear">clear</a></td> |
|
151 <td>Public slot to clear the saved passwords.</td> |
|
152 </tr><tr> |
|
153 <td><a href="#PasswordManager.close">close</a></td> |
|
154 <td>Public method to close the open search engines manager.</td> |
|
155 </tr><tr> |
|
156 <td><a href="#PasswordManager.fill">fill</a></td> |
|
157 <td>Public slot to fill login forms with saved data.</td> |
|
158 </tr><tr> |
|
159 <td><a href="#PasswordManager.getLogin">getLogin</a></td> |
|
160 <td>Public method to get the login credentials.</td> |
|
161 </tr><tr> |
|
162 <td><a href="#PasswordManager.post">post</a></td> |
|
163 <td>Public method to check, if the data to be sent contains login data.</td> |
|
164 </tr><tr> |
|
165 <td><a href="#PasswordManager.removePassword">removePassword</a></td> |
|
166 <td>Public method to remove a password entry.</td> |
|
167 </tr><tr> |
|
168 <td><a href="#PasswordManager.save">save</a></td> |
|
169 <td>Public slot to save the login entries to disk.</td> |
|
170 </tr><tr> |
|
171 <td><a href="#PasswordManager.setLogin">setLogin</a></td> |
|
172 <td>Public method to set the login credentials.</td> |
|
173 </tr><tr> |
|
174 <td><a href="#PasswordManager.siteInfo">siteInfo</a></td> |
|
175 <td>Public method to get a reference to the named site.</td> |
|
176 </tr><tr> |
|
177 <td><a href="#PasswordManager.sitesCount">sitesCount</a></td> |
|
178 <td>Public method to get the number of available sites.</td> |
|
179 </tr> |
|
180 </table> |
|
181 <a NAME="PasswordManager.__init__" ID="PasswordManager.__init__"></a> |
|
182 <h4>PasswordManager (Constructor)</h4> |
|
183 <b>PasswordManager</b>(<i>parent = None</i>) |
|
184 <p> |
|
185 Constructor |
|
186 </p><dl> |
|
187 <dt><i>parent</i></dt> |
|
188 <dd> |
|
189 reference to the parent object (QObject) |
|
190 </dd> |
|
191 </dl><a NAME="PasswordManager.__createKey" ID="PasswordManager.__createKey"></a> |
|
192 <h4>PasswordManager.__createKey</h4> |
|
193 <b>__createKey</b>(<i>url, realm</i>) |
|
194 <p> |
|
195 Private method to create the key string for the login credentials. |
|
196 </p><dl> |
|
197 <dt><i>url</i></dt> |
|
198 <dd> |
|
199 URL to get the credentials for (QUrl) |
|
200 </dd><dt><i>realm</i></dt> |
|
201 <dd> |
|
202 realm to get the credentials for (string) |
|
203 </dd> |
|
204 </dl><dl> |
|
205 <dt>Returns:</dt> |
|
206 <dd> |
|
207 key string (string) |
|
208 </dd> |
|
209 </dl><a NAME="PasswordManager.__extractMultipartQueryItems" ID="PasswordManager.__extractMultipartQueryItems"></a> |
|
210 <h4>PasswordManager.__extractMultipartQueryItems</h4> |
|
211 <b>__extractMultipartQueryItems</b>(<i>data, boundary</i>) |
|
212 <p> |
|
213 Private method to extract the query items for a post operation. |
|
214 </p><dl> |
|
215 <dt><i>data</i></dt> |
|
216 <dd> |
|
217 data to be sent (QByteArray) |
|
218 </dd><dt><i>boundary</i></dt> |
|
219 <dd> |
|
220 boundary string (QByteArray) |
|
221 </dd> |
|
222 </dl><dl> |
|
223 <dt>Returns:</dt> |
|
224 <dd> |
|
225 set of name, value pairs (set of tuple of string, string) |
|
226 </dd> |
|
227 </dl><a NAME="PasswordManager.__findForm" ID="PasswordManager.__findForm"></a> |
|
228 <h4>PasswordManager.__findForm</h4> |
|
229 <b>__findForm</b>(<i>webPage, data, boundary = None</i>) |
|
230 <p> |
|
231 Private method to find the form used for logging in. |
|
232 </p><dl> |
|
233 <dt><i>webPage</i></dt> |
|
234 <dd> |
|
235 reference to the web page (QWebPage) |
|
236 </dd><dt><i>data</i></dt> |
|
237 <dd> |
|
238 data to be sent (QByteArray) |
|
239 </dd><dt><i>boundary=</i></dt> |
|
240 <dd> |
|
241 boundary string (QByteArray) for multipart encoded data, |
|
242 None for urlencoded data |
|
243 </dd> |
|
244 </dl><dl> |
|
245 <dt>Returns:</dt> |
|
246 <dd> |
|
247 parsed form (LoginForm) |
|
248 </dd> |
|
249 </dl><a NAME="PasswordManager.__load" ID="PasswordManager.__load"></a> |
|
250 <h4>PasswordManager.__load</h4> |
|
251 <b>__load</b>(<i></i>) |
|
252 <p> |
|
253 Private method to load the saved login credentials. |
|
254 </p><a NAME="PasswordManager.__stripUrl" ID="PasswordManager.__stripUrl"></a> |
|
255 <h4>PasswordManager.__stripUrl</h4> |
|
256 <b>__stripUrl</b>(<i>url</i>) |
|
257 <p> |
|
258 Private method to strip off all unneeded parts of a URL. |
|
259 </p><dl> |
|
260 <dt><i>url</i></dt> |
|
261 <dd> |
|
262 URL to be stripped (QUrl) |
|
263 </dd> |
|
264 </dl><dl> |
|
265 <dt>Returns:</dt> |
|
266 <dd> |
|
267 stripped URL (QUrl) |
|
268 </dd> |
|
269 </dl><a NAME="PasswordManager.allSiteNames" ID="PasswordManager.allSiteNames"></a> |
|
270 <h4>PasswordManager.allSiteNames</h4> |
|
271 <b>allSiteNames</b>(<i></i>) |
|
272 <p> |
|
273 Public method to get a list of all site names. |
|
274 </p><dl> |
|
275 <dt>Returns:</dt> |
|
276 <dd> |
|
277 sorted list of all site names (list of strings) |
|
278 </dd> |
|
279 </dl><a NAME="PasswordManager.clear" ID="PasswordManager.clear"></a> |
|
280 <h4>PasswordManager.clear</h4> |
|
281 <b>clear</b>(<i></i>) |
|
282 <p> |
|
283 Public slot to clear the saved passwords. |
|
284 </p><a NAME="PasswordManager.close" ID="PasswordManager.close"></a> |
|
285 <h4>PasswordManager.close</h4> |
|
286 <b>close</b>(<i></i>) |
|
287 <p> |
|
288 Public method to close the open search engines manager. |
|
289 </p><a NAME="PasswordManager.fill" ID="PasswordManager.fill"></a> |
|
290 <h4>PasswordManager.fill</h4> |
|
291 <b>fill</b>(<i>page</i>) |
|
292 <p> |
|
293 Public slot to fill login forms with saved data. |
|
294 </p><dl> |
|
295 <dt><i>page</i></dt> |
|
296 <dd> |
|
297 reference to the web page (QWebPage) |
|
298 </dd> |
|
299 </dl><a NAME="PasswordManager.getLogin" ID="PasswordManager.getLogin"></a> |
|
300 <h4>PasswordManager.getLogin</h4> |
|
301 <b>getLogin</b>(<i>url, realm</i>) |
|
302 <p> |
|
303 Public method to get the login credentials. |
|
304 </p><dl> |
|
305 <dt><i>url</i></dt> |
|
306 <dd> |
|
307 URL to get the credentials for (QUrl) |
|
308 </dd><dt><i>realm</i></dt> |
|
309 <dd> |
|
310 realm to get the credentials for (string) |
|
311 </dd> |
|
312 </dl><dl> |
|
313 <dt>Returns:</dt> |
|
314 <dd> |
|
315 tuple containing the user name (string) and password (string) |
|
316 </dd> |
|
317 </dl><a NAME="PasswordManager.post" ID="PasswordManager.post"></a> |
|
318 <h4>PasswordManager.post</h4> |
|
319 <b>post</b>(<i>request, data</i>) |
|
320 <p> |
|
321 Public method to check, if the data to be sent contains login data. |
|
322 </p><dl> |
|
323 <dt><i>request</i></dt> |
|
324 <dd> |
|
325 reference to the network request (QNetworkRequest) |
|
326 </dd><dt><i>data</i></dt> |
|
327 <dd> |
|
328 data to be sent (QByteArray) |
|
329 </dd> |
|
330 </dl><a NAME="PasswordManager.removePassword" ID="PasswordManager.removePassword"></a> |
|
331 <h4>PasswordManager.removePassword</h4> |
|
332 <b>removePassword</b>(<i>site</i>) |
|
333 <p> |
|
334 Public method to remove a password entry. |
|
335 </p><dl> |
|
336 <dt><i>site</i></dt> |
|
337 <dd> |
|
338 web site name (string) |
|
339 </dd> |
|
340 </dl><a NAME="PasswordManager.save" ID="PasswordManager.save"></a> |
|
341 <h4>PasswordManager.save</h4> |
|
342 <b>save</b>(<i></i>) |
|
343 <p> |
|
344 Public slot to save the login entries to disk. |
|
345 </p><a NAME="PasswordManager.setLogin" ID="PasswordManager.setLogin"></a> |
|
346 <h4>PasswordManager.setLogin</h4> |
|
347 <b>setLogin</b>(<i>url, realm, username, password</i>) |
|
348 <p> |
|
349 Public method to set the login credentials. |
|
350 </p><dl> |
|
351 <dt><i>url</i></dt> |
|
352 <dd> |
|
353 URL to set the credentials for (QUrl) |
|
354 </dd><dt><i>realm</i></dt> |
|
355 <dd> |
|
356 realm to set the credentials for (string) |
|
357 </dd><dt><i>username</i></dt> |
|
358 <dd> |
|
359 username for the login (string) |
|
360 </dd><dt><i>password</i></dt> |
|
361 <dd> |
|
362 password for the login (string) |
|
363 </dd> |
|
364 </dl><a NAME="PasswordManager.siteInfo" ID="PasswordManager.siteInfo"></a> |
|
365 <h4>PasswordManager.siteInfo</h4> |
|
366 <b>siteInfo</b>(<i>site</i>) |
|
367 <p> |
|
368 Public method to get a reference to the named site. |
|
369 </p><dl> |
|
370 <dt><i>site</i></dt> |
|
371 <dd> |
|
372 web site name (string) |
|
373 </dd> |
|
374 </dl><dl> |
|
375 <dt>Returns:</dt> |
|
376 <dd> |
|
377 tuple containing the user name (string) and password (string) |
|
378 </dd> |
|
379 </dl><a NAME="PasswordManager.sitesCount" ID="PasswordManager.sitesCount"></a> |
|
380 <h4>PasswordManager.sitesCount</h4> |
|
381 <b>sitesCount</b>(<i></i>) |
|
382 <p> |
|
383 Public method to get the number of available sites. |
|
384 </p><dl> |
|
385 <dt>Returns:</dt> |
|
386 <dd> |
|
387 number of sites (integer) |
|
388 </dd> |
|
389 </dl> |
|
390 <div align="right"><a href="#top">Up</a></div> |
|
391 <hr /> |
|
392 </body></html> |