adobe / adobe/xdm

Define limitations on the set of characters to be used for the xdm:id property

Open
#432 4 comments 0 reactions 0 assignees View on GitHub
v0.9.4
Dominant language
JavaScript
Stars
266
Forks
380
Avg merge
5d 8h
Merged PRs (30d)
9

Description

In issue #419 @jbeckert comments:

> Does xdm:id for Identity need a "pattern" property to reject ids with prohibited characters, e.g. characters that would mess up the usage of the value in URL path components?

This is a very valid concern and we should absolutely work through it and properly handle it.

Assuming the intent would be for this to be the "URL-safe" characters, correct ?

I propose to add two pieces:

* Amend the description to state, that only characters are supported for the `xdm:id` property.
* Define a `pattern` property codifying the valid set of characters for validation

The question is, what set of characters we should be supporting.

Looking at the [section 3.3. Path](https://tools.ietf.org/html/rfc3986#section-3.3) of [RFC 3986](https://tools.ietf.org/html/rfc3986) one option would be to support `pchar` except `percent-encoded` which would be forbidden:

pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="

But then, I am not so sure, there is any value in most of the `sub-delims` in an identifier. So I propose to just use `unreserved` plus `:`, `@`, `+`. This gives us a good ability for identifiers, such as UUIDs, email addresses, and even some URNs.

So the proposed `pattern` would be:

pattern = "^[a-zA-Z0-9:@+._~-]+$"

## What are the schemas that are affected by the issue

Identity, EndUserIds, Profile, ExperienceEvent (and their extensions)

## What are examples of products that are impacted by the issue

Analytics, Campaign, Ad Cloud, Target

Contributor guide

Open the contributing guide

Research direction

Review issue #419 and RFC 3986 section 3.3, then compare the proposed character set with the affected Identity, EndUserIds, Profile, and ExperienceEvent schemas and their extensions. Done means agreeing on the supported characters, updating the xdm:id description and pattern consistently, and confirming the impacted product use cases remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.