Request for catalog listing access for finding packages #1824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request refactors the
ContainerRegistryServerAPICalls
class to introduce aneedCatalogAccess
parameter for more granular control over catalog access when generating access tokens and checking authentication. It also adds new constants for templates and updates method signatures and logic to incorporate the new parameter. Below are the key changes:New Constants and Templates
catalogScope
,grantTypeTemplate
, andauthUrlTemplate
constants to streamline URL and request content generation for catalog-specific access. ([src/code/ContainerRegistryServerAPICalls.csR50-R53](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046R50-R53)
)Method Signature Updates
GetContainerRegistryAccessToken
to include aneedCatalogAccess
parameter, enabling differentiation between catalog and repository access needs. ([src/code/ContainerRegistryServerAPICalls.csL374-R378](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L374-R378)
)IsContainerRegistryUnauthenticated
to include theneedCatalogAccess
parameter for determining the appropriate scope. ([src/code/ContainerRegistryServerAPICalls.csL447-R451](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L447-R451)
)Logic Adjustments for Catalog Access
IsContainerRegistryUnauthenticated
to use theneedCatalogAccess
parameter for constructing URLs and request content dynamically based on the scope. ([src/code/ContainerRegistryServerAPICalls.csL485-R493](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L485-R493)
)GetContainerRegistryAccessToken
across methods likeInstallVersion
,PushNupkgContainerRegistry
,FindPackagesWithVersionHelper
, andFindPackages
to specify theneedCatalogAccess
parameter explicitly. ([[1]](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L326-R330)
,[[2]](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L1233-R1238)
,[[3]](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L1698-R1703)
,[[4]](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046L1807-R1812)
)Minor Additions
[src/code/ContainerRegistryServerAPICalls.csR511](https://github.com/PowerShell/PSResourceGet/pull/1824/files#diff-797089eb5a2953d0c9625b558ce132908a233a537c9b4131369a1e990a6b3046R511)
)PR Context
In some non-microsoft tenants, finding packages was not working.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.