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

oci: casext: extend scope of valid reference names #234

Merged
merged 1 commit into from
Mar 23, 2018

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Mar 22, 2018

Previously we only supported a very limited subset of reference names
(as per the specification), but the restrictions have been expanded to
allow for any reference of the form

refname   ::= component ("/" component)*
component ::= alphanum (separator alphanum)*
alphanum  ::= [A-Za-z0-9]+
separator ::= [-._:@+] | "--"

Add support for this newly expanded set of reference names. In addition,
refactor the checks for whether a reference name is valid.

Signed-off-by: Aleksa Sarai [email protected]

@cyphar cyphar added this to the 0.4.1 milestone Mar 22, 2018
@cyphar cyphar added the oci-spec Issue directly related to OCI image-spec. label Mar 22, 2018
@cyphar cyphar force-pushed the extend-valid-refname-scope branch from dd6308b to 129f97c Compare March 22, 2018 22:25
// IsValidReferenceName returns whether the provided annotation value for
// "org.opencontainers.image.ref.name" is actually valid according to the
// OCI specification. This only matches against the MUST requirement, not the
// SHOULD requirement. The EBNF defined in the speciifcation is:
Copy link
Contributor

Choose a reason for hiding this comment

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

specification

@cyphar cyphar force-pushed the extend-valid-refname-scope branch from 129f97c to 0e56922 Compare March 23, 2018 00:06
Previously we only supported a very limited subset of reference names
(as per the specification), but the restrictions have been expanded to
allow for any reference of the form

    refname   ::= component ("/" component)*
    component ::= alphanum (separator alphanum)*
    alphanum  ::= [A-Za-z0-9]+
    separator ::= [-._:@+] | "--"

Add support for this newly expanded set of reference names. In addition,
refactor the checks for whether a reference name is valid.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the extend-valid-refname-scope branch from 0e56922 to 9d12668 Compare March 23, 2018 00:10
@cyphar
Copy link
Member Author

cyphar commented Mar 23, 2018

LGTM.

@cyphar cyphar merged commit 9d12668 into opencontainers:master Mar 23, 2018
cyphar added a commit that referenced this pull request Mar 23, 2018
  oci: casext: extend scope of valid reference names

LGTMs: @cyphar
Closes #234
@cyphar cyphar deleted the extend-valid-refname-scope branch March 23, 2018 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oci/casext oci-spec Issue directly related to OCI image-spec.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants