ipython / ipython/ipykernel

Ipykernel replacement of `getpass` not fully compatible with it

Đang mở
#1,123 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

The `getpass` API requires that the `GetPassWarning` is generated in case a password cannot be asked to the user in a secure way.

This is an important piece of the API, because it lets the programmer turn the warning into an error to handle the case when the terminal is not suited to securely prompt for a password *before* the user is asked for a password. In turn this is important because most users will carelessly type in a password regardless of any warning and is particularly bad for interfaces where the password will remain available for view via scrollback. Being able to handle the condition will let the program try different ways to get the password rather than prompting the user in an insecure way.

The problem here is that ipykernel replaces `getpass` with its own version that does not issue the `GetPassWarning`, so resulting in a different API from the standard `getpass` that ends up with the code prompting the user for a password insecurely without even realizing it.

At present time the workaround is clearly for the code to check if `getpass` comes from `ipykernel` and deal with this case specially.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.