Read a secret from stdin without displaying the value on the screen. :param prompt: prompt to display to user :return: the secret read from stdin with all trailing new lines removed :raises EOFError: if the input stream is closed or the user signals EOF (e.g., Ctrl+D)
(
self,
prompt: str = "",
)
| 3574 | return self._read_raw_input(prompt, temp_session) |
| 3575 | |
| 3576 | def read_secret( |
| 3577 | self, |
| 3578 | prompt: str = "", |
| 3579 | ) -> str: |
| 3580 | """Read a secret from stdin without displaying the value on the screen. |
| 3581 | |
| 3582 | :param prompt: prompt to display to user |
| 3583 | :return: the secret read from stdin with all trailing new lines removed |
| 3584 | :raises EOFError: if the input stream is closed or the user signals EOF (e.g., Ctrl+D) |
| 3585 | :raises Exception: any other exceptions raised by prompt() |
| 3586 | """ |
| 3587 | temp_session: PromptSession[str] = PromptSession( |
| 3588 | input=self.main_session.input, |
| 3589 | output=self.main_session.output, |
| 3590 | ) |
| 3591 | |
| 3592 | return self._read_raw_input(prompt, temp_session, is_password=True) |
| 3593 | |
| 3594 | def _process_alerts(self) -> None: |
| 3595 | """Background worker that processes queued alerts and dynamic prompt updates.""" |