Skip to content

Request for catalog listing access for finding packages #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adityapatwardhan
Copy link
Member

PR Summary

This pull request refactors the ContainerRegistryServerAPICalls class to introduce a needCatalogAccess 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

  • Added catalogScope, grantTypeTemplate, and authUrlTemplate 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

  • Updated GetContainerRegistryAccessToken to include a needCatalogAccess 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))
  • Updated IsContainerRegistryUnauthenticated to include the needCatalogAccess 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

  • Modified logic in IsContainerRegistryUnauthenticated to use the needCatalogAccess 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))
  • Updated calls to GetContainerRegistryAccessToken across methods like InstallVersion, PushNupkgContainerRegistry, FindPackagesWithVersionHelper, and FindPackages to specify the needCatalogAccess 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

  • Added a debug log for successful retrieval of the anonymous access token. ([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

@adityapatwardhan adityapatwardhan marked this pull request as draft May 22, 2025 20:01
@adityapatwardhan
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant