(dsc): Support credentials, `acceptLicense` and PSGallery registration

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

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
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, powershell
Lĩnh vực
security, tooling

Hướng nghiên cứu

Start by tracing the Repository registration flow for Register-PSResourceRepository and the PSResourceList install flow for Install-PSResource. Verify PSGallery parameter-set handling, credentialInfo and acceptLicense support, then check that get, test and export expose only vault and secret names.

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

Mô tả

feature_request Needs-Triage
Summary of the new feature / enhancement

The DSC resources cannot express three things that the underlying cmdlets support and that are needed in real deployments:

  1. Credentials. Register-PSResourceRepository -CredentialInfo and Install-PSResource -Credential are not modelled, so a private feed (Azure Artifacts, GitHub Packages, an internal NuGet server) cannot be used from a configuration.
  2. acceptLicense. Install-PSResource -AcceptLicense is not passed, so a module that requires license acceptance fails during set with exit code 4.
  3. PSGallery registration. Register-PSResourceRepository -PSGallery is a separate parameter set. Declaring { name: PSGallery } in a Repository instance on a machine where it was unregistered fails, because the script always calls Register-PSResourceRepository -Name -Uri.

Example of what this could look like:

resources:
- name: Internal feed
  type: Microsoft.PowerShell.PSResourceGet/Repository
  properties:
    name: Internal
    uri: https://pkgs.dev.azure.com/contoso/_packaging/internal/nuget/v3/index.json
    trusted: true
    credentialInfo:
      vaultName: ContosoVault
      secretName: InternalFeedPat
- name: Modules
  type: Microsoft.PowerShell.PSResourceGet/PSResourceList
  properties:
    repositoryName: Internal
    acceptLicense: true
    resources:
    - name: Contoso.Tools
Proposed technical implementation details (optional)
  • Repository: add an optional credentialInfo object (vaultName, secretName) mapped to -CredentialInfo on register and set, and handle name: PSGallery without uri by calling Register-PSResourceRepository -PSGallery.
  • PSResourceList: add an optional acceptLicense boolean passed to Install-PSResource -AcceptLicense, and allow credential via SecretManagement rather than plain text in the configuration.
  • Never emit secrets in get, test or export output; return only the vault and secret names.
Ngôn ngữ chính
C#
Star
576
Fork
114
Merge trung bình
23 giờ 17 phút
Pull request đã merge (30 ngày)
8

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

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

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 PowerShell/PSResourceGet

Tất cả issue của PowerShell/PSResourceGet

Issue tương tự

Thêm issue về C#

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.