-
Notifications
You must be signed in to change notification settings - Fork 99
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
fix: Scrutinize references for digests posing as tags #326
fix: Scrutinize references for digests posing as tags #326
Conversation
2ce27ee
to
d5f02ab
Compare
Codecov Report
@@ Coverage Diff @@
## main #326 +/- ##
==========================================
- Coverage 72.18% 72.09% -0.10%
==========================================
Files 38 38
Lines 3635 3669 +34
==========================================
+ Hits 2624 2645 +21
- Misses 752 766 +14
+ Partials 259 258 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting that updating the implementation of the ParseReference()
function only without touching others should fix the bug.
ecf0009
to
92c149a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annotated the changes in an attempt to add more clarity.
92c149a
to
c26dda2
Compare
Added a couple more tests in the last push; no code-changes otherwise. |
52ed305
to
a4558ea
Compare
a4558ea
to
e2cc8b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try not to have any breaking changes unless it is necessary with justifications.
2d32441
to
056dc8c
Compare
97f3c2b
to
e8cf363
Compare
e8cf363
to
8bd2510
Compare
8bd2510
to
5850036
Compare
Signed-off-by: Nima Talebi <github@nima.id.au>
5850036
to
960f612
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This change prevents a token sneaking in as a tag, then later getting validated as a digest. In order to do that, a new struct member has been introduced to
registry.Reference
, namely,ReferenceType
. This can take one of the small finite set of values:Undefined
,None
,Tag
, andDigest
.None
is applicable only to valid form D, andUndefined
is thezero/null/empty
default value to force explicitness.Also note that in valid form B, we're still allowing the redundantjust noticed this was already answered by @Wwwsylvia in #303.tag
, is there a reason to allow for this (as opposed to considering it ambiguous, and deeming it invalid)?Resolves #303.
Signed-off-by: Nima Talebi github@nima.id.au