Skip to content
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

support digests in br module references #5024

Merged
merged 1 commit into from
Oct 29, 2021
Merged

Conversation

majastrz
Copy link
Member

@majastrz majastrz commented Oct 29, 2021

This fixes #4741.

The reference syntax is the following:

module test 'br:example.com/one/two@sha256:4aea1793a7ae4883972fb25443524817c51a457a7303b4f9966aca540199aece' = {
 ...
}

bicep publish will reject digests in values of the --target parameter.

@majastrz majastrz marked this pull request as ready for review October 29, 2021 02:36
@@ -29,21 +29,35 @@ public class OciArtifactModuleReference : ModuleReference
// must be kept in sync with the tag max length
private static readonly Regex TagRegex = new(@"^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant);

private static readonly Regex DigestRegex = new(@"^sha256:[a-f0-9]{64}$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant);
Copy link
Member

Choose a reason for hiding this comment

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

Does the OCI spec support upper-case hex letters?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not for sha256 and sha512 digest algorithms. It is theoretically allowed for other algorithms, but those algorithms are not considered "registered" by the spec. And even then, both ACR and Bicep just assume sha256 for now.

@majastrz majastrz merged commit b333fc3 into main Oct 29, 2021
@majastrz majastrz deleted the majastrz/just-the-sha branch October 29, 2021 18:07
This pull request was closed.
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.

Support @SHA in module references
2 participants