interledger / rafiki

An open-source, comprehensive Interledger service for wallet providers, enabling them to provide Interledger functionality to their users.
https://rafiki.dev/
Apache License 2.0
231 stars 82 forks source link

Ensure wallet addresses are case insensitive #2815

Open mkurapov opened 1 month ago

mkurapov commented 1 month ago

Context

Because wallet addresses (and payment pointers) are in fact URLs, they should be case INsensitive. Currently, we are storing them in the DB simply as unique string without doing any cleanup beforehand, meaning, they are technically case-sensitive now.

Todos

s100tist commented 1 month ago

Is there anyone working on this yet? I'd like to try it:)

golobitch commented 1 month ago

Is there anyone working on this yet? I'd like to try it:)

Go for it :)

s100tist commented 1 month ago

Hi, I looked at the code and then I thought it would be enough modifying the wallet addres url to lower case before it got registered in the database.

When i tested the wallet address creation in Rafiki Admin it stored the wallet address url in lower case successfully. Then I tested a wallet address creation via bruno scenarios and the wallet address was succesfully created as well. However the sucessive events failed; this because the middleware was still case sensitive.

By this time i left my code letting both the storage and the getWalletAddressUrl using the 'toLowerCase' function. This seems to patch the case-sensitiveness in the storing and in the looking. I don't know if the modified storage would affect any other scenarios. What would your feedback be?

mkurapov commented 1 month ago

When i tested the wallet address creation in Rafiki Admin it stored the wallet address url in lower case successfully.

Even if you had upper case characters in the URL, correct?

However the sucessive events failed; this because the middleware was still case sensitive.

What exactly did you end up trying? So I can understand correctly

s100tist commented 1 month ago

That's correct, it stores the url in lower case even if it has a upper case characters.

In first place i just convert to lowercase the url image And then i added this to the methods where we obtain the url image

s100tist commented 1 month ago

I made the middleware modifications because when i did some tests rafiki looked for the wallet address as it was firstly written it looked for it using the url with the upper case, when they're only stored in lower case

sabineschaller commented 1 month ago

@s100tist feel free to open a draft PR such that we can see what you did 🙂