You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many oras commands require tag or digest input from the user, but in some cases validation is missing. And if invalid tags or digest is given, errors will be returned from remote registry server.
For example: oras tag does not validate if the given tag is valid. If given a digest, the operation will not fail until reaching the remote registry.
For oci-layout, tagging with digest won't even give an error.
Same for oras push
We could instead validate the tags/digests during command parsing, and fail fast if invalid input is found. oras-go contains the following methods that can be incorporated into func (opts *Target) Parse(cmd *cobra.Command) error of oras.
shizhMSFT
changed the title
oras should validate tag/digest input during command parsing stage
oras tag/push should fail fast on invalid input
Aug 27, 2024
Many oras commands require tag or digest input from the user, but in some cases validation is missing. And if invalid tags or digest is given, errors will be returned from remote registry server.
For example:
oras tag
does not validate if the given tag is valid. If given a digest, the operation will not fail until reaching the remote registry.For oci-layout, tagging with digest won't even give an error.
Same for
oras push
We could instead validate the tags/digests during command parsing, and fail fast if invalid input is found.
oras-go
contains the following methods that can be incorporated intofunc (opts *Target) Parse(cmd *cobra.Command) error
oforas
.func (r Reference) ValidateReference() error
func (r Reference) ValidateReferenceAsDigest() error
func (r Reference) ValidateReferenceAsTag() error
The text was updated successfully, but these errors were encountered: