PowerShell / PSResourceGet

PSResourceGet is the package manager for PowerShell
https://www.powershellgallery.com/packages/Microsoft.PowerShell.PSResourceGet
MIT License
483 stars 92 forks source link

Non-PSGallery v2 endpoints not working #1529

Closed alerickson closed 7 months ago

alerickson commented 7 months ago

Prerequisites

Steps to reproduce

New issue opened that is tangential to issue #1526

Also, to clarify: even adding -Type Module doesn't fix the issue either (at least from the module perspective). The HTTP call to Search() lacks a searchTerm parameter. Based on my experimentation with Artifactory, not providing a searchTerm is not the same as providing searchTerm=''.

Even if the type endpoint vpath was fixed for non-PSGallery calls, the lack of a searchTerm means Artifactory will still return a null response.

Based on the current structure of V2ServerAPICalls, I see two possible options for fixing that issue:

Add searchTerm='' to the built URLs in FindAllFromTypeEndPoint and FindTagFromEndpoint Conditionalize adding searchTerm='' to the URLs built in the methods described above based on whether the repo appears to be Artifactory Our Artifactory server is selfhosted and does not include jfrog in the FQDN, so the JFrog quirk flag may need to be adjusted to turn on for more situations (I can cut a separate issue for this if you'd like)

Expected behavior

Artifactory v2 endpoint should work

Actual behavior

Throws error

Error details

No response

Environment data

all environments

Visuals

No response

sean-r-williams commented 7 months ago

@alerickson: based on https://github.com/PowerShell/PSResourceGet/issues/1485#issuecomment-1897197544, I filed #1532 and #1533 which might help clean up some of the bugs here.

alerickson commented 7 months ago

Closing this in favor of #1530, #1531 and #1534, which have better descriptions of this issue.