docs(design): record the identity field validation contract #75
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-docs!75
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "docs/identity-validation-contract"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
ADR 0038 settles who owns each identity field. It does not say what a valid value is, and
that question has a different answer in each of the three systems a value reaches. The union existed
only in code, with nothing pointing at it from the decision records and nothing tying it to the
upgrade cadence.
Adds
design/identity-field-validation.md: the intersection rule for username, email and displayname; which of the portal, Kanidm and Forgejo contributes each constraint and why it is
load-bearing, so a future reader can tell a rule that matters from one that is incidental; the
pinned versions each rule was read from; and the upgrade obligation.
The obligation is the point of the note. Nothing detects upstream drift on its own — the tests
assert our transcription of the upstream rules, not upstream itself, so they keep passing
against a version whose rules have moved. There is no runtime check either: a value that has become
invalid downstream produces the same silent first-sign-in failure the intersection exists to
prevent. A human re-reading the source at bump time is the whole mechanism, which is why the
versions are written down.
Linked from ADR 0038, and added to ADR 0028's upgrade decisions as item 8.
The issue's premise was out of date
The issue says the union "exists only as a regex in the sign-up endpoint whose comment misdescribes
it". That was true when it was filed and was fixed before it was worked: gitborg/gitborg-web#151 and
gitborg/gitborg-web#152 shipped
src/lib/identity-rules.tsand removed the regex. The notetherefore documents shipped behaviour in the present tense rather than specifying work to be done.
The gap the issue identified is still real — the contract lived only in code comments, and nothing
tied it to the upgrade cadence.
Verified, not assumed
Every figure in the note was read from the source rather than paraphrased, and re-checked
independently before this was opened:
bitborg-infra, not from the issue: Forgejo16.0.1-rootless(
ansible/group_vars/all/vars.yml), Kanidm1.10.4(ansible/roles/kanidm/defaults/main.yml).Both agree with what the code cites.
MaxSize(40)) and binds over Kanidm's 64 — confirmedagainst
identity-rules.ts, which states both..atom,.gpg,.keys,.rss,.png) —counted from the source, not estimated.
src/lib/profile.ts, not inidentity-rules.ts, and to be far less constrained: non-empty after trimming, no C0/C1 controlcharacters, at most 100 characters. Confirmed line by line, including the reason each rule exists.
The note says so plainly rather than inventing symmetry with the other two fields.
isKanidmNamealone, not the sign-upintersection, so an account created before the rules existed can still be recovered.
pnpm format:checkandpnpm mdlintclean; both re-ran underlefthookat commit time.Closes #71. Part of #66.
d1377785d569db6d5656