rest.li icon indicating copy to clipboard operation
rest.li copied to clipboard

Use of urn:li violates RFC 8141

Open stpeter opened this issue 1 year ago • 2 comments

LinkedIn's issuance of Uniform Resource Names (URNs) in the urn:li namespace violates RFC 8141 in several ways.

First, formal URN namespace identifiers should be registered with IANA, but Microsoft has neglected to request addition of "li" to the registry:

https://www.iana.org/assignments/urn-namespaces/urn-namespaces.xhtml

Second, RFC 8141 forbids two-character namespace identifiers like "li", since they can conflict with ISO 3166 country codes (and in this case do, since "li" is the country code for Liechtenstein). See in particular section 5.1, which specifies the following constraint on namespace identifiers:

  1. It MUST be more than two characters long, and it MUST NOT start with ALPHA ALPHA "-", i.e., any string consisting of two letters followed by one hyphen; such strings are reserved for potential use as NIDs based on ISO alpha-2 country codes [ISO.3166-1] for eventual national registrations of URN namespaces (however, the definition and scoping of rules for allocation of responsibility for such country-code-based URN namespaces are beyond the scope of this document). As a consequence, it MUST NOT start with the string "xn--" or any other string consisting of two letters followed by two hyphens; such strings are reserved for potential representation of DNS A-labels and similar strings in the future [RFC5890].

Discussion of this topic is underway on the [email protected] discussion list. The following messages are relevant:

https://mailarchive.ietf.org/arch/msg/urn/x4m6YsxIGJF5R5oxwH6t6urPuqA/

https://mailarchive.ietf.org/arch/msg/urn/B00jD6vT8CQeUIGkaz_jMVFca_E/

https://mailarchive.ietf.org/arch/msg/urn/50HEPE2E4V72HWrAA-LUFl0Dcr8/

https://mailarchive.ietf.org/arch/msg/urn/mmsJ7c8tZdXsQvqPz8B8Kf2aux8/

My apologies if this repository is not the right place to lodge this issue, but the pages at https://learn.microsoft.com/en-us/linkedin/shared/api-guide/concepts/urns?context=linkedin%2Fcontext and https://learn.microsoft.com/en-us/linkedin/shared/references/v2/urn-namespace?context=linkedin%2Fcontext do not state the underlying source in GitHub for their content.

Please engage in this GitHub issue or on the IETF discussion list at https://www.ietf.org/mailman/listinfo/urn to work with the standards community on a solution to this problem.

stpeter avatar Feb 03 '24 01:02 stpeter

Just curious, where does it live in their code?

albertocavalcante avatar Sep 24 '24 13:09 albertocavalcante

@albertocavalcante I'm not sure exactly where it lives, but here are some files in this repository that refer to URNs:

./restli-example-api/src/main/pegasus/com/linkedin/restli/example/Photo.pdl ./restli-example-api/src/main/pegasus/com/linkedin/restli/example/Album.pdl ./restli-int-test/src/test/java/com/linkedin/restli/examples/TestAltKeyResource.java: ./restli-int-test-server/src/main/java/com/linkedin/restli/examples/greetings/server/altkey/StringKeyCoercer.java ./gradle-plugins/src/integTest/groovy/com/linkedin/pegasus/gradle/publishing/PegasusPluginLegacyIvyPublishIntegrationTest.groovy ./gradle-plugins/src/integTest/groovy/com/linkedin/pegasus/gradle/publishing/PegasusPluginIvyPublishIntegrationTest.groovy ./data/src/test/resources/pegasus/com/linkedin/restli/example/Album.pdl

stpeter avatar Sep 24 '24 14:09 stpeter