Add .netrc support when using --auth-type bearer
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- authentication, cli
Hướng nghiên cứu
Bắt đầu bằng cách truy vết cách --auth-type bearer xử lý thông tin xác thực và cách cơ chế xác thực basic hiện có đọc .netrc. So sánh ví dụ machine/password được yêu cầu với hành vi xh được liên kết, sau đó xác minh rằng header bearer được tạo mà không có token hard-coded và ghi lại entry .netrc bắt buộc nếu cần.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Checklist
- I've searched for similar feature requests. The closest I found is where this was implemented in xh
Enhancement request
When using https, I don't want to have to hard-code my token in all scripts, rather I would like to have a central location where the token can be read from. This already works for the basic authentication type, but not, as far as I can tell, for the bearer auth type.
If this is implemented, then this enhancement request is to document it clearly, what needs to be in the file as https://httpie.io/docs/cli/netrc does not seem to cover it.
Problem it solves
I'm always frustrated when writing a script that I need to hard code the token in it, as it makes the script harder to share.
Additional information, screenshots, or code examples
This is implemented in xh and with the following in the .netrc:
machine host.local.lan password SecretToken
then
xh --json --auth-type bearer "https://host.local.lan/rest/api/latest/…"
Correctly sends the header:
Authorization: Bearer SecretToken
It would be great if httpie would support this same functionality.
- Ngôn ngữ chính
- Python
- Star
- 38.6k
- Fork
- 4k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của httpie/cli
-
new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug new
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
argparser.py: HTTPieArgumentParser has high cyclomatic complexity and mixed responsibilities Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·