PowerShell / PowerShell/PSResourceGet
Add support for AWS CodeArtifact
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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