src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityContext.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8596
d64760b2da50
child 10479
856476537696
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityContext</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityContext</h1>
10
11 <p>
12 Module implementing a context class for security related checks.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#SecurityContext">SecurityContext</a></td>
25 <td>Class implementing a context class for security related checks.</td>
26 </tr>
27 </table>
28 <h3>Functions</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <hr />
34 <hr />
35 <a NAME="SecurityContext" ID="SecurityContext"></a>
36 <h2>SecurityContext</h2>
37
38 <p>
39 Class implementing a context class for security related checks.
40 </p>
41 <h3>Derived from</h3>
42 None
43 <h3>Class Attributes</h3>
44
45 <table>
46 <tr><td>None</td></tr>
47 </table>
48 <h3>Class Methods</h3>
49
50 <table>
51 <tr><td>None</td></tr>
52 </table>
53 <h3>Methods</h3>
54
55 <table>
56
57 <tr>
58 <td><a href="#SecurityContext.__init__">SecurityContext</a></td>
59 <td>Constructor</td>
60 </tr>
61 <tr>
62 <td><a href="#SecurityContext.__getLiteralValue">__getLiteralValue</a></td>
63 <td>Private method to turn AST literals into native Python types.</td>
64 </tr>
65 <tr>
66 <td><a href="#SecurityContext.__repr__">__repr__</a></td>
67 <td>Special method to generate representation of object for printing or interactive use.</td>
68 </tr>
69 <tr>
70 <td><a href="#SecurityContext.bytesVal">bytesVal</a></td>
71 <td>Public method to get the value of a standalone bytes object.</td>
72 </tr>
73 <tr>
74 <td><a href="#SecurityContext.callArgs">callArgs</a></td>
75 <td>Public method to get a list of function args.</td>
76 </tr>
77 <tr>
78 <td><a href="#SecurityContext.callArgsCount">callArgsCount</a></td>
79 <td>Public method to get the number of args a function call has.</td>
80 </tr>
81 <tr>
82 <td><a href="#SecurityContext.callFunctionName">callFunctionName</a></td>
83 <td>Public method to get the name (not FQ) of a function call.</td>
84 </tr>
85 <tr>
86 <td><a href="#SecurityContext.callFunctionNameQual">callFunctionNameQual</a></td>
87 <td>Public method to get the FQ name of a function call.</td>
88 </tr>
89 <tr>
90 <td><a href="#SecurityContext.callKeywords">callKeywords</a></td>
91 <td>Public method to get a dictionary of keyword parameters.</td>
92 </tr>
93 <tr>
94 <td><a href="#SecurityContext.checkCallArgValue">checkCallArgValue</a></td>
95 <td>Public method to check for a value of a named argument in a function call.</td>
96 </tr>
97 <tr>
98 <td><a href="#SecurityContext.functionDefDefaultsQual">functionDefDefaultsQual</a></td>
99 <td>Public method to get a list of fully qualified default values in a function def.</td>
100 </tr>
101 <tr>
102 <td><a href="#SecurityContext.getCallArgAtPosition">getCallArgAtPosition</a></td>
103 <td>Public method to get a positional argument at the specified position (if it exists).</td>
104 </tr>
105 <tr>
106 <td><a href="#SecurityContext.getCallArgValue">getCallArgValue</a></td>
107 <td>Public method to get the value of a named argument in a function call.</td>
108 </tr>
109 <tr>
110 <td><a href="#SecurityContext.getLinenoForCallArg">getLinenoForCallArg</a></td>
111 <td>Public method to get the line number for a specific named argument.</td>
112 </tr>
113 <tr>
114 <td><a href="#SecurityContext.getOffsetForCallArg">getOffsetForCallArg</a></td>
115 <td>Public method to get the offset for a specific named argument.</td>
116 </tr>
117 <tr>
118 <td><a href="#SecurityContext.isModuleBeingImported">isModuleBeingImported</a></td>
119 <td>Public method to check for the given module is currently being imported.</td>
120 </tr>
121 <tr>
122 <td><a href="#SecurityContext.isModuleImportedExact">isModuleImportedExact</a></td>
123 <td>Public method to check if a given module has been imported; only exact matches.</td>
124 </tr>
125 <tr>
126 <td><a href="#SecurityContext.isModuleImportedLike">isModuleImportedLike</a></td>
127 <td>Public method to check if a given module has been imported; given module exists.</td>
128 </tr>
129 <tr>
130 <td><a href="#SecurityContext.node">node</a></td>
131 <td>Public method to get the raw AST node associated with the context.</td>
132 </tr>
133 <tr>
134 <td><a href="#SecurityContext.statement">statement</a></td>
135 <td>Public method to get the raw AST for the current statement.</td>
136 </tr>
137 <tr>
138 <td><a href="#SecurityContext.stringVal">stringVal</a></td>
139 <td>Public method to get the value of a standalone string object.</td>
140 </tr>
141 <tr>
142 <td><a href="#SecurityContext.stringValAsEscapedBytes">stringValAsEscapedBytes</a></td>
143 <td>Public method to get the escaped value of the object.</td>
144 </tr>
145 </table>
146 <h3>Static Methods</h3>
147
148 <table>
149 <tr><td>None</td></tr>
150 </table>
151
152 <a NAME="SecurityContext.__init__" ID="SecurityContext.__init__"></a>
153 <h4>SecurityContext (Constructor)</h4>
154 <b>SecurityContext</b>(<i>contextObject=None</i>)
155
156 <p>
157 Constructor
158 </p>
159 <p>
160 Initialize the class with a context dictionary or an empty
161 dictionary.
162 </p>
163 <dl>
164
165 <dt><i>contextObject</i> (dict)</dt>
166 <dd>
167 context dictionary to be used to populate the
168 class
169 </dd>
170 </dl>
171 <a NAME="SecurityContext.__getLiteralValue" ID="SecurityContext.__getLiteralValue"></a>
172 <h4>SecurityContext.__getLiteralValue</h4>
173 <b>__getLiteralValue</b>(<i>literal</i>)
174
175 <p>
176 Private method to turn AST literals into native Python types.
177 </p>
178 <dl>
179
180 <dt><i>literal</i> (ast.AST)</dt>
181 <dd>
182 AST literal to be converted
183 </dd>
184 </dl>
185 <dl>
186 <dt>Return:</dt>
187 <dd>
188 converted Python object
189 </dd>
190 </dl>
191 <dl>
192 <dt>Return Type:</dt>
193 <dd>
194 Any
195 </dd>
196 </dl>
197 <a NAME="SecurityContext.__repr__" ID="SecurityContext.__repr__"></a>
198 <h4>SecurityContext.__repr__</h4>
199 <b>__repr__</b>(<i></i>)
200
201 <p>
202 Special method to generate representation of object for printing or
203 interactive use.
204 </p>
205 <dl>
206 <dt>Return:</dt>
207 <dd>
208 string representation of the object
209 </dd>
210 </dl>
211 <dl>
212 <dt>Return Type:</dt>
213 <dd>
214 str
215 </dd>
216 </dl>
217 <a NAME="SecurityContext.bytesVal" ID="SecurityContext.bytesVal"></a>
218 <h4>SecurityContext.bytesVal</h4>
219 <b>bytesVal</b>(<i></i>)
220
221 <p>
222 Public method to get the value of a standalone bytes object.
223 </p>
224 <dl>
225 <dt>Return:</dt>
226 <dd>
227 value of a standalone bytes object
228 </dd>
229 </dl>
230 <dl>
231 <dt>Return Type:</dt>
232 <dd>
233 bytes
234 </dd>
235 </dl>
236 <a NAME="SecurityContext.callArgs" ID="SecurityContext.callArgs"></a>
237 <h4>SecurityContext.callArgs</h4>
238 <b>callArgs</b>(<i></i>)
239
240 <p>
241 Public method to get a list of function args.
242 </p>
243 <dl>
244 <dt>Return:</dt>
245 <dd>
246 list of function args
247 </dd>
248 </dl>
249 <dl>
250 <dt>Return Type:</dt>
251 <dd>
252 list
253 </dd>
254 </dl>
255 <a NAME="SecurityContext.callArgsCount" ID="SecurityContext.callArgsCount"></a>
256 <h4>SecurityContext.callArgsCount</h4>
257 <b>callArgsCount</b>(<i></i>)
258
259 <p>
260 Public method to get the number of args a function call has.
261 </p>
262 <dl>
263 <dt>Return:</dt>
264 <dd>
265 number of args a function call has
266 </dd>
267 </dl>
268 <dl>
269 <dt>Return Type:</dt>
270 <dd>
271 int
272 </dd>
273 </dl>
274 <a NAME="SecurityContext.callFunctionName" ID="SecurityContext.callFunctionName"></a>
275 <h4>SecurityContext.callFunctionName</h4>
276 <b>callFunctionName</b>(<i></i>)
277
278 <p>
279 Public method to get the name (not FQ) of a function call.
280 </p>
281 <dl>
282 <dt>Return:</dt>
283 <dd>
284 name (not FQ) of a function call
285 </dd>
286 </dl>
287 <dl>
288 <dt>Return Type:</dt>
289 <dd>
290 str
291 </dd>
292 </dl>
293 <a NAME="SecurityContext.callFunctionNameQual" ID="SecurityContext.callFunctionNameQual"></a>
294 <h4>SecurityContext.callFunctionNameQual</h4>
295 <b>callFunctionNameQual</b>(<i></i>)
296
297 <p>
298 Public method to get the FQ name of a function call.
299 </p>
300 <dl>
301 <dt>Return:</dt>
302 <dd>
303 FQ name of a function call
304 </dd>
305 </dl>
306 <dl>
307 <dt>Return Type:</dt>
308 <dd>
309 str
310 </dd>
311 </dl>
312 <a NAME="SecurityContext.callKeywords" ID="SecurityContext.callKeywords"></a>
313 <h4>SecurityContext.callKeywords</h4>
314 <b>callKeywords</b>(<i></i>)
315
316 <p>
317 Public method to get a dictionary of keyword parameters.
318 </p>
319 <dl>
320 <dt>Return:</dt>
321 <dd>
322 dictionary of keyword parameters
323 </dd>
324 </dl>
325 <dl>
326 <dt>Return Type:</dt>
327 <dd>
328 dict
329 </dd>
330 </dl>
331 <a NAME="SecurityContext.checkCallArgValue" ID="SecurityContext.checkCallArgValue"></a>
332 <h4>SecurityContext.checkCallArgValue</h4>
333 <b>checkCallArgValue</b>(<i>argumentName, argumentValues=None</i>)
334
335 <p>
336 Public method to check for a value of a named argument in a function
337 call.
338 </p>
339 <dl>
340
341 <dt><i>argumentName</i> (str)</dt>
342 <dd>
343 name of the argument to be checked
344 </dd>
345 <dt><i>argumentValues</i> (Any or list of Any)</dt>
346 <dd>
347 value or list of values to test against
348 </dd>
349 </dl>
350 <dl>
351 <dt>Return:</dt>
352 <dd>
353 True if argument found and matched, False if found and not
354 matched, None if argument not found at all
355 </dd>
356 </dl>
357 <dl>
358 <dt>Return Type:</dt>
359 <dd>
360 bool or None
361 </dd>
362 </dl>
363 <a NAME="SecurityContext.functionDefDefaultsQual" ID="SecurityContext.functionDefDefaultsQual"></a>
364 <h4>SecurityContext.functionDefDefaultsQual</h4>
365 <b>functionDefDefaultsQual</b>(<i></i>)
366
367 <p>
368 Public method to get a list of fully qualified default values in a
369 function def.
370 </p>
371 <dl>
372 <dt>Return:</dt>
373 <dd>
374 list of fully qualified default values in a function def
375 </dd>
376 </dl>
377 <dl>
378 <dt>Return Type:</dt>
379 <dd>
380 list
381 </dd>
382 </dl>
383 <a NAME="SecurityContext.getCallArgAtPosition" ID="SecurityContext.getCallArgAtPosition"></a>
384 <h4>SecurityContext.getCallArgAtPosition</h4>
385 <b>getCallArgAtPosition</b>(<i>positionNum</i>)
386
387 <p>
388 Public method to get a positional argument at the specified position
389 (if it exists).
390 </p>
391 <dl>
392
393 <dt><i>positionNum</i> (int)</dt>
394 <dd>
395 index of the argument to get the value for
396 </dd>
397 </dl>
398 <dl>
399 <dt>Return:</dt>
400 <dd>
401 value of the argument at the specified position if it exists
402 </dd>
403 </dl>
404 <dl>
405 <dt>Return Type:</dt>
406 <dd>
407 Any or None
408 </dd>
409 </dl>
410 <a NAME="SecurityContext.getCallArgValue" ID="SecurityContext.getCallArgValue"></a>
411 <h4>SecurityContext.getCallArgValue</h4>
412 <b>getCallArgValue</b>(<i>argumentName</i>)
413
414 <p>
415 Public method to get the value of a named argument in a function call.
416 </p>
417 <dl>
418
419 <dt><i>argumentName</i> (str)</dt>
420 <dd>
421 name of the argument to get the value for
422 </dd>
423 </dl>
424 <dl>
425 <dt>Return:</dt>
426 <dd>
427 value of the named argument
428 </dd>
429 </dl>
430 <dl>
431 <dt>Return Type:</dt>
432 <dd>
433 Any
434 </dd>
435 </dl>
436 <a NAME="SecurityContext.getLinenoForCallArg" ID="SecurityContext.getLinenoForCallArg"></a>
437 <h4>SecurityContext.getLinenoForCallArg</h4>
438 <b>getLinenoForCallArg</b>(<i>argumentName</i>)
439
440 <p>
441 Public method to get the line number for a specific named argument.
442 </p>
443 <dl>
444
445 <dt><i>argumentName</i> (str)</dt>
446 <dd>
447 name of the argument to get the line number for
448 </dd>
449 </dl>
450 <dl>
451 <dt>Return:</dt>
452 <dd>
453 line number of the found argument or -1
454 </dd>
455 </dl>
456 <dl>
457 <dt>Return Type:</dt>
458 <dd>
459 int
460 </dd>
461 </dl>
462 <a NAME="SecurityContext.getOffsetForCallArg" ID="SecurityContext.getOffsetForCallArg"></a>
463 <h4>SecurityContext.getOffsetForCallArg</h4>
464 <b>getOffsetForCallArg</b>(<i>argumentName</i>)
465
466 <p>
467 Public method to get the offset for a specific named argument.
468 </p>
469 <dl>
470
471 <dt><i>argumentName</i> (str)</dt>
472 <dd>
473 name of the argument to get the line number for
474 </dd>
475 </dl>
476 <dl>
477 <dt>Return:</dt>
478 <dd>
479 offset of the found argument or -1
480 </dd>
481 </dl>
482 <dl>
483 <dt>Return Type:</dt>
484 <dd>
485 int
486 </dd>
487 </dl>
488 <a NAME="SecurityContext.isModuleBeingImported" ID="SecurityContext.isModuleBeingImported"></a>
489 <h4>SecurityContext.isModuleBeingImported</h4>
490 <b>isModuleBeingImported</b>(<i>module</i>)
491
492 <p>
493 Public method to check for the given module is currently being
494 imported.
495 </p>
496 <dl>
497
498 <dt><i>module</i> (str)</dt>
499 <dd>
500 module name to look for
501 </dd>
502 </dl>
503 <dl>
504 <dt>Return:</dt>
505 <dd>
506 flag indicating the given module was found
507 </dd>
508 </dl>
509 <dl>
510 <dt>Return Type:</dt>
511 <dd>
512 bool
513 </dd>
514 </dl>
515 <a NAME="SecurityContext.isModuleImportedExact" ID="SecurityContext.isModuleImportedExact"></a>
516 <h4>SecurityContext.isModuleImportedExact</h4>
517 <b>isModuleImportedExact</b>(<i>module</i>)
518
519 <p>
520 Public method to check if a given module has been imported; only exact
521 matches.
522 </p>
523 <dl>
524
525 <dt><i>module</i> (str)</dt>
526 <dd>
527 module name to look for
528 </dd>
529 </dl>
530 <dl>
531 <dt>Return:</dt>
532 <dd>
533 flag indicating the given module was found
534 </dd>
535 </dl>
536 <dl>
537 <dt>Return Type:</dt>
538 <dd>
539 bool
540 </dd>
541 </dl>
542 <a NAME="SecurityContext.isModuleImportedLike" ID="SecurityContext.isModuleImportedLike"></a>
543 <h4>SecurityContext.isModuleImportedLike</h4>
544 <b>isModuleImportedLike</b>(<i>module</i>)
545
546 <p>
547 Public method to check if a given module has been imported; given
548 module exists.
549 </p>
550 <dl>
551
552 <dt><i>module</i> (str)</dt>
553 <dd>
554 module name to look for
555 </dd>
556 </dl>
557 <dl>
558 <dt>Return:</dt>
559 <dd>
560 flag indicating the given module was found
561 </dd>
562 </dl>
563 <dl>
564 <dt>Return Type:</dt>
565 <dd>
566 bool
567 </dd>
568 </dl>
569 <a NAME="SecurityContext.node" ID="SecurityContext.node"></a>
570 <h4>SecurityContext.node</h4>
571 <b>node</b>(<i></i>)
572
573 <p>
574 Public method to get the raw AST node associated with the context.
575 </p>
576 <dl>
577 <dt>Return:</dt>
578 <dd>
579 raw AST node associated with the context
580 </dd>
581 </dl>
582 <dl>
583 <dt>Return Type:</dt>
584 <dd>
585 ast.AST
586 </dd>
587 </dl>
588 <a NAME="SecurityContext.statement" ID="SecurityContext.statement"></a>
589 <h4>SecurityContext.statement</h4>
590 <b>statement</b>(<i></i>)
591
592 <p>
593 Public method to get the raw AST for the current statement.
594 </p>
595 <dl>
596 <dt>Return:</dt>
597 <dd>
598 raw AST for the current statement
599 </dd>
600 </dl>
601 <dl>
602 <dt>Return Type:</dt>
603 <dd>
604 ast.AST
605 </dd>
606 </dl>
607 <a NAME="SecurityContext.stringVal" ID="SecurityContext.stringVal"></a>
608 <h4>SecurityContext.stringVal</h4>
609 <b>stringVal</b>(<i></i>)
610
611 <p>
612 Public method to get the value of a standalone string object.
613 </p>
614 <dl>
615 <dt>Return:</dt>
616 <dd>
617 value of a standalone string object
618 </dd>
619 </dl>
620 <dl>
621 <dt>Return Type:</dt>
622 <dd>
623 str
624 </dd>
625 </dl>
626 <a NAME="SecurityContext.stringValAsEscapedBytes" ID="SecurityContext.stringValAsEscapedBytes"></a>
627 <h4>SecurityContext.stringValAsEscapedBytes</h4>
628 <b>stringValAsEscapedBytes</b>(<i></i>)
629
630 <p>
631 Public method to get the escaped value of the object.
632 </p>
633 <p>
634 Turn the value of a string or bytes object into a byte sequence with
635 unknown, control, and \\ characters escaped.
636 </p>
637 <p>
638 This function should be used when looking for a known sequence in a
639 potentially badly encoded string in the code.
640 </p>
641 <dl>
642 <dt>Return:</dt>
643 <dd>
644 sequence of printable ascii bytes representing original string
645 </dd>
646 </dl>
647 <dl>
648 <dt>Return Type:</dt>
649 <dd>
650 str
651 </dd>
652 </dl>
653 <div align="right"><a href="#top">Up</a></div>
654 <hr />
655 </body></html>

eric ide

mercurial