PowerShell / PowerShell/PSResourceGet

Add support for AWS CodeArtifact

Open
#1,650 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Find feature_request New-Repo-Request Status: In PR Up-For-Grabs
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Summary of the new feature / enhancement

As a user I want to use AWS CodeArtifact as a NuGet v3 PSResourceGet repository.

Proposed technical implementation details (optional)

AWS CodeArtifact supports NuGet v3. Accordingly, it works as a repository when using PSResourceGet (using this guidance for obtaining nuget credentials), however there are some capabilities that should be unblocked in the PSResourceGet source.

I have made changes to the source locally to trial a few capabilities. FindNameGlobbing and FindNameGlobbingWithTag both seem to work as expected.

Additionally, FindAll should be possible with AWS CodeArtifact as well. Some test code is below that I've used with Invoke-RestMethod to retrieve the the list of all available published packages (with my AccountId hidden). Based on this, the ability to retrieve all resources from an AWS CodeArtifact NuGet v3 feed may also need to be unblocked.

In terms of identifying an AWS CodeArtifact repository, a domain name could be used (similar to identifying JFrog feeds, etc), however it might be more appropriate to have a different method of marking a repository for CodeArtifact. Not all AWS Regions or partitions use the same domain name (eg AWS GovCloud), and using only domain name would prevent this from working in those other partitions.

# Given a CodeArtifact Domain `psrepo`, and a CodeArtifact Repository `psrepo` in the AWS Region `us-west-`:
$domain = 'psrepo'
$region = 'us-west-2'
$accountId = '<hidden>'

$token = Get-CAAuthorizationToken -Domain $domain -Region $region
$cred = [PSCredential]::new('aws', (ConvertTo-SecureString -String $token.AuthorizationToken -AsPlainText -Force))

$baseUri = "https://$domain-$accountId.d.codeartifact.$region.amazonaws.com"

# Find the available resources
(Invoke-RestMethod -Credential $cred -Uri "$baseUri/nuget/psrepo/v3/index.json").Resources

# Perform a base query
(Invoke-RestMethod -Credential $cred -Uri "$baseUri/nuget/psrepo/v3/query").data

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/code/V3ServerAPICalls.cs, especially FindAll, FindNameGlobbing, and FindNameGlobbingWithTag, alongside the linked local trial changes. Determine how AWS CodeArtifact NuGet v3 repositories should be identified across regions and partitions, then verify that the listed repository queries work with CodeArtifact credentials and feeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, powershell
Domain
cloud, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.