You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will get an error when signify-ts is doing the fetch call:
TypeError: fetch failed
204 | });
205 | }
> 206 | const res = await fetch(this.url + path, {
| ^
207 | method: method,
208 | body: _body,
209 | headers: final_headers,
at async SignifyClient.fetch (../../src/keri/app/clienting.ts:206:21)
at async EventResult.op (../../src/keri/app/aiding.ts:467:21)
at async Object.<anonymous> (identifier-name-with-special-chars.test.ts:8:33)
Cause:
RequestContentLengthMismatchError: Request body length does not match content-length header
I also experimented with URL encoding the alias:
constalias=encodeURIComponent('ö');constresult=awaitclient.identifiers().create(alias,{});awaitwaitOperation(client,awaitresult.op());// Call below fails with a 401 Unauthorizedconstid=awaitclient.identifiers().get(alias);
Then the creation succeeds, but a subsequent identifiers().get(alias) results in a 401 Unauthorized from keria. The same thing happens when creating an alias with spaces:
constalias="a b";constresult=awaitclient.identifiers().create(alias,{});awaitwaitOperation(client,awaitresult.op());// Call below fails with a 401 Unauthorizedconstid=awaitclient.identifiers().get(alias);
Not sure if this issue should be in signify-ts or in keria. Depending on the route taken, it could affect both repos. I am totally fine with rejecting special characters in identifier names altogether, but then we should probably do some request input validation in keria to reject any invalid requests with a 4xx error.
The text was updated successfully, but these errors were encountered:
lenkan
changed the title
Handling of special characters in alias names
Handling of special characters and white space in alias names
Jan 26, 2024
From our keri dev meeting:
What is the expected behavior for alias names?
Should we be able to support all utf-8?
Localisation is a broader discussion.
The alias is in the path and is encoded.
A fix was added where the content length header was being manually calculated instead of by the fetch.
Probably it was unauthorized because the path changed and the verification of the signature failed.
Its safest thing is to avoid aliases in the urls. WebOfTrust/keria#202 WebOfTrust/keria#217
When creating an identifier with "special" characters, for example spaces or the "ö" letter used in Swedish and Finnish:
You will get an error when signify-ts is doing the fetch call:
I also experimented with URL encoding the alias:
Then the creation succeeds, but a subsequent
identifiers().get(alias)
results in a 401 Unauthorized from keria. The same thing happens when creating an alias with spaces:I have put the reproduction scripts here: https://github.com/lenkan/signify-ts/blob/2d21adae1f3706f7829566d9af10f0f57d8741dc/examples/integration-scripts/identifier-name-with-special-chars.test.ts
Not sure if this issue should be in signify-ts or in keria. Depending on the route taken, it could affect both repos. I am totally fine with rejecting special characters in identifier names altogether, but then we should probably do some request input validation in keria to reject any invalid requests with a 4xx error.
The text was updated successfully, but these errors were encountered: