Push an accumulator for a PUBLIC HTTP method on an endpoint class.
(self, node: ast.FunctionDef | ast.AsyncFunctionDef)
| 1014 | self.generic_visit(node) |
| 1015 | |
| 1016 | def _enter_input(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> bool: |
| 1017 | """Push an accumulator for a PUBLIC HTTP method on an endpoint class.""" |
| 1018 | if len(self._class_stack) != 1 or self._function_depth != 0: |
| 1019 | return False |
| 1020 | if not self._publish_status or node.name not in HTTP_METHODS: |
| 1021 | return False |
| 1022 | if self._publish_status.get(node.name.upper()) != "PUBLIC": |
| 1023 | return False |
| 1024 | decorators = self._class_decorators + node.decorator_list |
| 1025 | self._input_stack.append( |
| 1026 | _InputCtx( |
| 1027 | _declared_names(decorators, "parameters"), |
| 1028 | _declared_names(decorators, "request"), |
| 1029 | ) |
| 1030 | ) |
| 1031 | return True |
| 1032 | |
| 1033 | def _record_input_call(self, node: ast.Call) -> None: |
| 1034 | """A `.get()` read, or the whole dict handed to something else.""" |
no test coverage detected