Skip to content

trusted signing: add filter to sign files with .cip extension #28207

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

Merged
merged 3 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/TrustedSigning/TrustedSigning/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
- Additional information about change #1
-->
## Upcoming Release
* Updated InvokeCIPolicySigning to support signing files with the .cip extension

## Version 0.1.1
* Modified InvokeCiPolicySigning to include ShouldProcess command confirmation
* Modified InvokeCIPolicySigning to include ShouldProcess command confirmation

## Version 0.1.0
* Renamed from Az.CodeSigning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public class InvokeCIPolicySigning : CodeSigningCmdletBase
HelpMessage = "The endpoint url used to submit request to Azure TrustedSigning.")]
public string EndpointUrl { get; set; }


/// <summary>
/// Metadata File Path
/// </summary>
Expand Down Expand Up @@ -143,7 +142,9 @@ private void WriteMessage(string message)

private void ValidateFileType(string fullInPath)
{
if (string.Equals(System.IO.Path.GetExtension(fullInPath), ".bin", StringComparison.OrdinalIgnoreCase))
string fileExtension = System.IO.Path.GetExtension(fullInPath);
if (string.Equals(fileExtension, ".bin", StringComparison.OrdinalIgnoreCase) ||
string.Equals(fileExtension, ".cip", StringComparison.OrdinalIgnoreCase))
{
WriteMessage(Environment.NewLine);
WriteMessage("CI Policy file submitted");
Expand All @@ -166,7 +167,7 @@ private void ValidateFileType(string fullInPath)
if (doc?.Root.Name == SiPolicyRootElementName)
{
WriteWarning("Input file is an XML-based policy file.");
WriteWarning("Please run 'ConvertFrom-CiPolicy' to create a .bin file before running this command.");
WriteWarning("Please run 'ConvertFrom-CiPolicy' to create a .bin or .cip file before running this command.");
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@ public CodeSigningServiceClient(IAuthenticationFactory authFactory, IAzureContex
if (context == null)
throw new ArgumentNullException(nameof(context));
if (context.Environment == null)
//throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment);
{
throw new ArgumentException("Invalid Environment");
}

Initialize(authFactory, context);
}

private Exception GetInnerException(Exception exception)
{
while (exception.InnerException != null) exception = exception.InnerException;
return exception;
}

private void Initialize(IAuthenticationFactory authFactory, IAzureContext context)
{
Expand Down