Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Store access token in env variable CF_ACCESS_TOKEN alternatively to ~/.cf/config.json

Đang mở
#3,727 4 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
authentication, cli, security

Hướng nghiên cứu

Bắt đầu với các luồng của lệnh cf login và cf oauth-token, sau đó truy vết cách ~/.cf/config.json được đọc cho các lệnh tiếp theo. Kiểm tra nơi có thể cung cấp access token từ môi trường và cách các tùy chọn đăng nhập được phân tích. Được xem là hoàn tất khi CF_ACCESS_TOKEN được hỗ trợ như phương án thay thế được yêu cầu mà không làm hỏng hành vi lưu trữ token hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What's the user value of this feature request?
User will get the option to store access code only in current session rather then writing it to the filesystem.

Who is the functionality for?
Any cf user be it an end user or an operator.

How often will this functionality be used by the user?
When logging in from an unsafe environment e.g. using a shared account on a jump host.

Who else is affected by the change?
No. It should be implemented as an alternative to how it is handled currently.

Is your feature request related to a problem? Please describe.
In some cases we use shared environments like a jump host where in some cases shared accounts are used to login e.g. emergency user. If cf cli writes my access token to disk it can be seen and used by any other user logged in with the same account.

Same issue exists if you ssh into a container and use cf or if you use a webshell like jupyter notebook.

Describe the solution you'd like
cf login command should support an option e.g. --token-to-env which exports the access token to the environment e.g. variable CF_ACCESS_TOKEN . Subsequent cf commands would respect the env veriable if no access token is stored in .cf/config.json

Describe alternatives you've considered
cf login could also have a flag -oauth-token the would just return the access token like in cf oauth-token . So the user could store it in CF_ACCESS_TOKEN which would then need to be respected by other cf commands.

Additional context
n.a.

Ngôn ngữ chính
Go
Star
1.9k
Fork
989
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudfoundry/cli

Tất cả issue của cloudfoundry/cli

Issue tương tự

Thêm issue về Go

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.