Skip to content

Download URL pattern not compatible with corporate environment with long DNS TLDs #79

Description

@Fiouz

Consider a corporate environment that meet the following criteria:

  • Internal DNS root with private top level domain (TLD) producing such DNS FQDN: https://foobar.abcdefg.vwxyz/ (TLD vwxyz is 5 characters long)
  • The corporate IT infrastructure is configured (e.g. via /etc/resolv.conf) with DNS search suffix .vwxyz, so that users are only exposed to the "shorter" DNS names such as https://foobar.abcdefg/ (the OS automatically adds .vwxyz suffix as foobar.abcdefg.vwxyz is a valid DNS entry). The corporate private X.509 infrastructure also delivers certificates designed with these short names in mind (in case there is any concern regarding certificate validation).
  • Build tools (e.g. Gradle) configured to use a corporate repository manager (i.e. Sonatype Nexus Repository Manager, JFrog Artifactory, etc.) on such internal URL https://artifacts.abcdefg/ (note the absence of .vwxyz as we rely on DNS search suffix), instead of Sonatype Central

With the above, the "apparent TLD" to users/build tools for artifact URLs is abcdefg (7 characters) instead of vwxyz (5 characters).

This does not match the URL pattern at

private static final String URL_PATTERN = "([^:/?#]+://)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?";
as it restricts the TLD to be 5 characters at most .[a-z]{2,5}, even though URLs are valid within the corporate environment. This causes SPDX URL checks (such as when using the Gradle SPDX plugin) to fail.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions