Skip to content

Register MAR as default trusted repository#1955

Merged
adityapatwardhan merged 13 commits intomasterfrom
MARAsDefault
May 5, 2026
Merged

Register MAR as default trusted repository#1955
adityapatwardhan merged 13 commits intomasterfrom
MARAsDefault

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

PR Summary

This pull request adds support for the automatic registration and protection of the Microsoft Artifact Registry (MAR) repository in the PSResourceGet module. MAR is now registered by default alongside PSGallery, with a higher priority and trusted status. The changes ensure MAR cannot be manually registered, have its URI or credentials set, and update the documentation and tests to reflect its new behavior.

MAR Repository Registration and Protection

  • MAR is now automatically registered with default values (name, URI, priority, trusted status, and API version) when the repository store is created or reset, and appears in the default repository XML file. [1] [2] [3] [4]
  • Added logic to prevent manual registration of MAR via the Register-PSResourceRepository cmdlet, including case-insensitive name checking and error handling for hashtable registration. [1] [2] [3]
  • Prevented changes to MAR's URI or credentials via the Set-PSResourceRepository cmdlet, with appropriate error messages.
  • Updated dynamic parameter logic to ensure credential provider options are not shown for MAR.

Documentation and Messaging Updates

  • Updated commandlet documentation and verbose messages to indicate that both PSGallery and MAR are registered by default and after a reset. [1] [2] [3]

Testing Enhancements

  • Added new test utilities and a comprehensive test suite for MAR, verifying its default registration, protection against manual registration and modification, and behavior during repository store reset operations. [1] [2] [3]

PR Context

PR Checklist

@adityapatwardhan
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@adityapatwardhan
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@adityapatwardhan
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@adityapatwardhan
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@adityapatwardhan adityapatwardhan added this to the v1.3.0-Preview1 milestone Mar 13, 2026
@adityapatwardhan
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/code/RegisterPSResourceRepository.cs
Comment thread src/code/RepositorySettings.cs Outdated
@adityapatwardhan
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Member

@anamnavi anamnavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhan adityapatwardhan merged commit d389d79 into master May 5, 2026
12 checks passed
@adityapatwardhan adityapatwardhan deleted the MARAsDefault branch May 5, 2026 18:47
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.

3 participants