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

Aperta
#2,049 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, powershell
Ambito
security, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C#
Stelle
576
Fork
114
Merge medio
1g 2h
PR unite (30g)
7

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PSResourceGet

Tutte le issue di PowerShell/PSResourceGet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.