Skip to content

Fix URI regex and validate baseURL as AbsoluteUrl#67

Open
ErikGaida wants to merge 1 commit into
5G-MAG:3GPP-Rel17from
ErikGaida:bugfix/ingest-baseurl-validation
Open

Fix URI regex and validate baseURL as AbsoluteUrl#67
ErikGaida wants to merge 1 commit into
5G-MAG:3GPP-Rel17from
ErikGaida:bugfix/ingest-baseurl-validation

Conversation

@ErikGaida
Copy link
Copy Markdown

This PR Fixes the validation bug of the baseURL:

baseURL uses AbsoluteUrl data type according to 3GPP TS 26.512 V17.10.0 (2025-01)

in TS26512_CommonData.yaml is "AbsoluteUrl" defined as:

    AbsoluteUrl:
      type: string
      format: uri
      description: 'Absolute Uniform Resource Locator, conforming with the "absolute-URI" production specified in IETF RFC 3986, section 4.3 in which the scheme part is "http" or "https". Note that the "query" suffix is permitted by this production but the "fragment" suffix is not.'

IETF RFC 3986, section 4.3:

4.3. Absolute URI

Some protocol elements allow only the absolute form of a URI without
a fragment identifier. For example, defining a base URI for later
use by relative references calls for an absolute-URI syntax rule that
does not allow a fragment.

  absolute-URI  = scheme ":" hier-part [ "?" query ]

URI scheme specifications must define their own syntax so that all
strings matching their scheme-specific syntax will also match the
grammar. Scheme specifications will not define
fragment identifier syntax or usage, regardless of its applicability
to resources identifiable via that scheme, as fragment identification
is orthogonal to scheme definition. However, scheme specifications
are encouraged to include a wide range of examples, including
examples that show use of the scheme's URIs with fragment identifiers
when such usage is appropriate.

The existing generic URI regex is too broad for baseURL, because it accepts valid non-HTTP(S) URIs such as:
mailto:someone@example.com

As far as I understand it, the libmpd++ regex and the regex from the template that is currently used is still too broad for BaseURL. it allows schemes other than http and https.

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.

1 participant